C++: Fix multiple toString consistency error in use-use dataflow

This commit is contained in:
Jeroen Ketema
2023-03-09 10:08:25 +01:00
parent a2248cb5a0
commit 55da3257bf
5 changed files with 10 additions and 160 deletions

View File

@@ -413,7 +413,11 @@ class InstructionNode extends Node0 {
/** Gets the instruction corresponding to this node. */
Instruction getInstruction() { result = instr }
override string toStringImpl() { result = instr.getAst().toString() }
override string toStringImpl() {
if instr.(InitializeParameterInstruction).getIRVariable() instanceof IRThisVariable
then result = "this"
else result = instr.getAst().toString()
}
}
/**
@@ -428,7 +432,11 @@ class OperandNode extends Node, Node0 {
/** Gets the operand corresponding to this node. */
Operand getOperand() { result = op }
override string toStringImpl() { result = op.getDef().getAst().toString() }
override string toStringImpl() {
if op.getDef().(InitializeParameterInstruction).getIRVariable() instanceof IRThisVariable
then result = "this"
else result = op.getDef().getAst().toString()
}
}
/**