IR: rename getVariable to getIRVariable

This commit is contained in:
Robert Marsh
2019-10-03 12:51:58 -07:00
parent 3313af5189
commit c1e3821ab0
15 changed files with 22 additions and 22 deletions

View File

@@ -611,7 +611,7 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() } override string getImmediateString() { result = var.toString() }
final IRVariable getVariable() { result = var } final IRVariable getIRVariable() { result = var }
} }
class FieldInstruction extends Instruction { class FieldInstruction extends Instruction {

View File

@@ -135,14 +135,14 @@ private predicate variableAddressValueNumber(
VariableAddressInstruction instr, IRFunction irFunc, IRVariable var VariableAddressInstruction instr, IRFunction irFunc, IRVariable var
) { ) {
instr.getEnclosingIRFunction() = irFunc and instr.getEnclosingIRFunction() = irFunc and
instr.getVariable() = var instr.getIRVariable() = var
} }
private predicate initializeParameterValueNumber( private predicate initializeParameterValueNumber(
InitializeParameterInstruction instr, IRFunction irFunc, IRVariable var InitializeParameterInstruction instr, IRFunction irFunc, IRVariable var
) { ) {
instr.getEnclosingIRFunction() = irFunc and instr.getEnclosingIRFunction() = irFunc and
instr.getVariable() = var instr.getIRVariable() = var
} }
private predicate initializeThisValueNumber(InitializeThisInstruction instr, IRFunction irFunc) { private predicate initializeThisValueNumber(InitializeThisInstruction instr, IRFunction irFunc) {

View File

@@ -282,7 +282,7 @@ private predicate automaticVariableAddressEscapes(IRAutomaticVariable var) {
// The variable's address escapes if the result of any // The variable's address escapes if the result of any
// VariableAddressInstruction that computes the variable's address escapes. // VariableAddressInstruction that computes the variable's address escapes.
exists(VariableAddressInstruction instr | exists(VariableAddressInstruction instr |
instr.getVariable() = var and instr.getIRVariable() = var and
resultEscapesNonReturn(instr) resultEscapesNonReturn(instr)
) )
} }
@@ -305,7 +305,7 @@ predicate variableAddressEscapes(IRVariable var) {
*/ */
predicate resultPointsTo(Instruction instr, IRVariable var, IntValue bitOffset) { predicate resultPointsTo(Instruction instr, IRVariable var, IntValue bitOffset) {
// The address of a variable points to that variable, at offset 0. // The address of a variable points to that variable, at offset 0.
instr.(VariableAddressInstruction).getVariable() = var and instr.(VariableAddressInstruction).getIRVariable() = var and
bitOffset = 0 bitOffset = 0
or or
exists(Operand operand, IntValue originalBitOffset, IntValue propagatedBitOffset | exists(Operand operand, IntValue originalBitOffset, IntValue propagatedBitOffset |

View File

@@ -334,7 +334,7 @@ private module Cached {
IRVariable getInstructionVariable(Instruction instruction) { IRVariable getInstructionVariable(Instruction instruction) {
result = getNewIRVariable(getOldInstruction(instruction) result = getNewIRVariable(getOldInstruction(instruction)
.(OldIR::VariableInstruction) .(OldIR::VariableInstruction)
.getVariable()) .getIRVariable())
} }
cached cached

View File

@@ -611,7 +611,7 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() } override string getImmediateString() { result = var.toString() }
final IRVariable getVariable() { result = var } final IRVariable getIRVariable() { result = var }
} }
class FieldInstruction extends Instruction { class FieldInstruction extends Instruction {

View File

@@ -135,14 +135,14 @@ private predicate variableAddressValueNumber(
VariableAddressInstruction instr, IRFunction irFunc, IRVariable var VariableAddressInstruction instr, IRFunction irFunc, IRVariable var
) { ) {
instr.getEnclosingIRFunction() = irFunc and instr.getEnclosingIRFunction() = irFunc and
instr.getVariable() = var instr.getIRVariable() = var
} }
private predicate initializeParameterValueNumber( private predicate initializeParameterValueNumber(
InitializeParameterInstruction instr, IRFunction irFunc, IRVariable var InitializeParameterInstruction instr, IRFunction irFunc, IRVariable var
) { ) {
instr.getEnclosingIRFunction() = irFunc and instr.getEnclosingIRFunction() = irFunc and
instr.getVariable() = var instr.getIRVariable() = var
} }
private predicate initializeThisValueNumber(InitializeThisInstruction instr, IRFunction irFunc) { private predicate initializeThisValueNumber(InitializeThisInstruction instr, IRFunction irFunc) {

View File

@@ -611,7 +611,7 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() } override string getImmediateString() { result = var.toString() }
final IRVariable getVariable() { result = var } final IRVariable getIRVariable() { result = var }
} }
class FieldInstruction extends Instruction { class FieldInstruction extends Instruction {

View File

@@ -135,14 +135,14 @@ private predicate variableAddressValueNumber(
VariableAddressInstruction instr, IRFunction irFunc, IRVariable var VariableAddressInstruction instr, IRFunction irFunc, IRVariable var
) { ) {
instr.getEnclosingIRFunction() = irFunc and instr.getEnclosingIRFunction() = irFunc and
instr.getVariable() = var instr.getIRVariable() = var
} }
private predicate initializeParameterValueNumber( private predicate initializeParameterValueNumber(
InitializeParameterInstruction instr, IRFunction irFunc, IRVariable var InitializeParameterInstruction instr, IRFunction irFunc, IRVariable var
) { ) {
instr.getEnclosingIRFunction() = irFunc and instr.getEnclosingIRFunction() = irFunc and
instr.getVariable() = var instr.getIRVariable() = var
} }
private predicate initializeThisValueNumber(InitializeThisInstruction instr, IRFunction irFunc) { private predicate initializeThisValueNumber(InitializeThisInstruction instr, IRFunction irFunc) {

View File

@@ -282,7 +282,7 @@ private predicate automaticVariableAddressEscapes(IRAutomaticVariable var) {
// The variable's address escapes if the result of any // The variable's address escapes if the result of any
// VariableAddressInstruction that computes the variable's address escapes. // VariableAddressInstruction that computes the variable's address escapes.
exists(VariableAddressInstruction instr | exists(VariableAddressInstruction instr |
instr.getVariable() = var and instr.getIRVariable() = var and
resultEscapesNonReturn(instr) resultEscapesNonReturn(instr)
) )
} }
@@ -305,7 +305,7 @@ predicate variableAddressEscapes(IRVariable var) {
*/ */
predicate resultPointsTo(Instruction instr, IRVariable var, IntValue bitOffset) { predicate resultPointsTo(Instruction instr, IRVariable var, IntValue bitOffset) {
// The address of a variable points to that variable, at offset 0. // The address of a variable points to that variable, at offset 0.
instr.(VariableAddressInstruction).getVariable() = var and instr.(VariableAddressInstruction).getIRVariable() = var and
bitOffset = 0 bitOffset = 0
or or
exists(Operand operand, IntValue originalBitOffset, IntValue propagatedBitOffset | exists(Operand operand, IntValue originalBitOffset, IntValue propagatedBitOffset |

View File

@@ -334,7 +334,7 @@ private module Cached {
IRVariable getInstructionVariable(Instruction instruction) { IRVariable getInstructionVariable(Instruction instruction) {
result = getNewIRVariable(getOldInstruction(instruction) result = getNewIRVariable(getOldInstruction(instruction)
.(OldIR::VariableInstruction) .(OldIR::VariableInstruction)
.getVariable()) .getIRVariable())
} }
cached cached

View File

@@ -611,7 +611,7 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() } override string getImmediateString() { result = var.toString() }
final IRVariable getVariable() { result = var } final IRVariable getIRVariable() { result = var }
} }
class FieldInstruction extends Instruction { class FieldInstruction extends Instruction {

View File

@@ -611,7 +611,7 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() } override string getImmediateString() { result = var.toString() }
final IRVariable getVariable() { result = var } final IRVariable getIRVariable() { result = var }
} }
class FieldInstruction extends Instruction { class FieldInstruction extends Instruction {

View File

@@ -135,14 +135,14 @@ private predicate variableAddressValueNumber(
VariableAddressInstruction instr, IRFunction irFunc, IRVariable var VariableAddressInstruction instr, IRFunction irFunc, IRVariable var
) { ) {
instr.getEnclosingIRFunction() = irFunc and instr.getEnclosingIRFunction() = irFunc and
instr.getVariable() = var instr.getIRVariable() = var
} }
private predicate initializeParameterValueNumber( private predicate initializeParameterValueNumber(
InitializeParameterInstruction instr, IRFunction irFunc, IRVariable var InitializeParameterInstruction instr, IRFunction irFunc, IRVariable var
) { ) {
instr.getEnclosingIRFunction() = irFunc and instr.getEnclosingIRFunction() = irFunc and
instr.getVariable() = var instr.getIRVariable() = var
} }
private predicate initializeThisValueNumber(InitializeThisInstruction instr, IRFunction irFunc) { private predicate initializeThisValueNumber(InitializeThisInstruction instr, IRFunction irFunc) {

View File

@@ -269,7 +269,7 @@ private predicate automaticVariableAddressEscapes(IRAutomaticVariable var) {
// The variable's address escapes if the result of any // The variable's address escapes if the result of any
// VariableAddressInstruction that computes the variable's address escapes. // VariableAddressInstruction that computes the variable's address escapes.
exists(VariableAddressInstruction instr | exists(VariableAddressInstruction instr |
instr.getVariable() = var and instr.getIRVariable() = var and
resultEscapesNonReturn(instr) resultEscapesNonReturn(instr)
) )
} }
@@ -292,7 +292,7 @@ predicate variableAddressEscapes(IRVariable var) {
*/ */
predicate resultPointsTo(Instruction instr, IRVariable var, IntValue bitOffset) { predicate resultPointsTo(Instruction instr, IRVariable var, IntValue bitOffset) {
// The address of a variable points to that variable, at offset 0. // The address of a variable points to that variable, at offset 0.
instr.(VariableAddressInstruction).getVariable() = var and instr.(VariableAddressInstruction).getIRVariable() = var and
bitOffset = 0 bitOffset = 0
or or
exists(Operand operand, IntValue originalBitOffset, IntValue propagatedBitOffset | exists(Operand operand, IntValue originalBitOffset, IntValue propagatedBitOffset |

View File

@@ -337,7 +337,7 @@ private module Cached {
IRVariable getInstructionVariable(Instruction instruction) { IRVariable getInstructionVariable(Instruction instruction) {
result = getNewIRVariable(getOldInstruction(instruction) result = getNewIRVariable(getOldInstruction(instruction)
.(OldIR::VariableInstruction) .(OldIR::VariableInstruction)
.getVariable()) .getIRVariable())
} }
cached cached