Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f278f4f

Browse files
C++: Operands as IPA types
@rdmarsh2 has been working on various queries and libraries on top of the IR, and has pointed out that having to always refer to an operand of an instruction by the pair of (instruction, operandTag) makes using the IR a bit clunky. This PR adds a new `Operand` IPA type that represents an operand of an instruction. `OperandTag` still exists, but is now an internal type used only in the IR implementation.
1 parent 640de0c commit f278f4f

29 files changed

Lines changed: 1579 additions & 1347 deletions

config/identical-files.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/FunctionIR.qll",
2020
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/FunctionIR.qll"
2121
],
22-
"C++ IR OperandTag": [
23-
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/OperandTag.qll",
24-
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/OperandTag.qll",
25-
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/OperandTag.qll"
22+
"C++ IR Operand": [
23+
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/Operand.qll",
24+
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/Operand.qll",
25+
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/Operand.qll"
2626
],
2727
"C++ IR IRImpl": [
2828
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IR.qll",

cpp/ql/src/semmle/code/cpp/ir/implementation/MemoryAccessKind.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MemoryAccessKind extends TMemoryAccessKind {
1616

1717
/**
1818
* The operand or result accesses memory at the address specified by the
19-
* `LoadStoreAddressOperand` on the same instruction.
19+
* `AddressOperand` on the same instruction.
2020
*/
2121
class IndirectMemoryAccess extends MemoryAccessKind, TIndirectMemoryAccess {
2222
override string toString() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import FunctionIR
22
import Instruction
33
import IRBlock
44
import IRVariable
5-
import OperandTag
5+
import Operand
66
import semmle.code.cpp.ir.implementation.EdgeKind
77
import semmle.code.cpp.ir.implementation.MemoryAccessKind
88

0 commit comments

Comments
 (0)