Skip to content

Commit 08f8660

Browse files
committed
C++/C#: Add pragma[noinline] to hasIndex predicates.
1 parent a7644db commit 08f8660

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ class InitializeParameterInstruction extends VariableInstruction {
593593
* Holds if this instruction initializes the parameter with index `index`, or
594594
* if `index` is `-1` and this instruction initializes `this`.
595595
*/
596+
pragma[noinline]
596597
final predicate hasIndex(int index) {
597598
index >= 0 and index = this.getParameter().getIndex()
598599
or
@@ -617,6 +618,7 @@ class InitializeIndirectionInstruction extends VariableInstruction {
617618
* index `index`, or if `index` is `-1` and this instruction initializes the memory
618619
* pointed to by `this`.
619620
*/
621+
pragma[noinline]
620622
final predicate hasIndex(int index) {
621623
index >= 0 and index = this.getParameter().getIndex()
622624
or
@@ -801,6 +803,7 @@ class ReturnIndirectionInstruction extends VariableInstruction {
801803
* Holds if this instruction is the return indirection for the parameter with index `index`, or
802804
* if this instruction is the return indirection for `this` and `index` is `-1`.
803805
*/
806+
pragma[noinline]
804807
final predicate hasIndex(int index) {
805808
index >= 0 and index = this.getParameter().getIndex()
806809
or

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/Instruction.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ class InitializeParameterInstruction extends VariableInstruction {
593593
* Holds if this instruction initializes the parameter with index `index`, or
594594
* if `index` is `-1` and this instruction initializes `this`.
595595
*/
596+
pragma[noinline]
596597
final predicate hasIndex(int index) {
597598
index >= 0 and index = this.getParameter().getIndex()
598599
or
@@ -617,6 +618,7 @@ class InitializeIndirectionInstruction extends VariableInstruction {
617618
* index `index`, or if `index` is `-1` and this instruction initializes the memory
618619
* pointed to by `this`.
619620
*/
621+
pragma[noinline]
620622
final predicate hasIndex(int index) {
621623
index >= 0 and index = this.getParameter().getIndex()
622624
or
@@ -801,6 +803,7 @@ class ReturnIndirectionInstruction extends VariableInstruction {
801803
* Holds if this instruction is the return indirection for the parameter with index `index`, or
802804
* if this instruction is the return indirection for `this` and `index` is `-1`.
803805
*/
806+
pragma[noinline]
804807
final predicate hasIndex(int index) {
805808
index >= 0 and index = this.getParameter().getIndex()
806809
or

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ class InitializeParameterInstruction extends VariableInstruction {
593593
* Holds if this instruction initializes the parameter with index `index`, or
594594
* if `index` is `-1` and this instruction initializes `this`.
595595
*/
596+
pragma[noinline]
596597
final predicate hasIndex(int index) {
597598
index >= 0 and index = this.getParameter().getIndex()
598599
or
@@ -617,6 +618,7 @@ class InitializeIndirectionInstruction extends VariableInstruction {
617618
* index `index`, or if `index` is `-1` and this instruction initializes the memory
618619
* pointed to by `this`.
619620
*/
621+
pragma[noinline]
620622
final predicate hasIndex(int index) {
621623
index >= 0 and index = this.getParameter().getIndex()
622624
or
@@ -801,6 +803,7 @@ class ReturnIndirectionInstruction extends VariableInstruction {
801803
* Holds if this instruction is the return indirection for the parameter with index `index`, or
802804
* if this instruction is the return indirection for `this` and `index` is `-1`.
803805
*/
806+
pragma[noinline]
804807
final predicate hasIndex(int index) {
805808
index >= 0 and index = this.getParameter().getIndex()
806809
or

csharp/ql/src/experimental/ir/implementation/raw/Instruction.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ class InitializeParameterInstruction extends VariableInstruction {
593593
* Holds if this instruction initializes the parameter with index `index`, or
594594
* if `index` is `-1` and this instruction initializes `this`.
595595
*/
596+
pragma[noinline]
596597
final predicate hasIndex(int index) {
597598
index >= 0 and index = this.getParameter().getIndex()
598599
or
@@ -617,6 +618,7 @@ class InitializeIndirectionInstruction extends VariableInstruction {
617618
* index `index`, or if `index` is `-1` and this instruction initializes the memory
618619
* pointed to by `this`.
619620
*/
621+
pragma[noinline]
620622
final predicate hasIndex(int index) {
621623
index >= 0 and index = this.getParameter().getIndex()
622624
or
@@ -801,6 +803,7 @@ class ReturnIndirectionInstruction extends VariableInstruction {
801803
* Holds if this instruction is the return indirection for the parameter with index `index`, or
802804
* if this instruction is the return indirection for `this` and `index` is `-1`.
803805
*/
806+
pragma[noinline]
804807
final predicate hasIndex(int index) {
805808
index >= 0 and index = this.getParameter().getIndex()
806809
or

csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Instruction.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ class InitializeParameterInstruction extends VariableInstruction {
593593
* Holds if this instruction initializes the parameter with index `index`, or
594594
* if `index` is `-1` and this instruction initializes `this`.
595595
*/
596+
pragma[noinline]
596597
final predicate hasIndex(int index) {
597598
index >= 0 and index = this.getParameter().getIndex()
598599
or
@@ -617,6 +618,7 @@ class InitializeIndirectionInstruction extends VariableInstruction {
617618
* index `index`, or if `index` is `-1` and this instruction initializes the memory
618619
* pointed to by `this`.
619620
*/
621+
pragma[noinline]
620622
final predicate hasIndex(int index) {
621623
index >= 0 and index = this.getParameter().getIndex()
622624
or
@@ -801,6 +803,7 @@ class ReturnIndirectionInstruction extends VariableInstruction {
801803
* Holds if this instruction is the return indirection for the parameter with index `index`, or
802804
* if this instruction is the return indirection for `this` and `index` is `-1`.
803805
*/
806+
pragma[noinline]
804807
final predicate hasIndex(int index) {
805808
index >= 0 and index = this.getParameter().getIndex()
806809
or

0 commit comments

Comments
 (0)