IR: Add VariableInstruction.getASTVariable

This commit is contained in:
Robert Marsh
2019-10-03 13:12:06 -07:00
parent c1e3821ab0
commit 6e587f3f2a
5 changed files with 25 additions and 0 deletions

View File

@@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() }
final IRVariable getIRVariable() { result = var }
/**
* Gets the AST variable that this instruction's IR variable refers to, if one exists.
*/
final Language::Variable getASTVariable() { result = var.(IRUserVariable).getVariable() }
}
class FieldInstruction extends Instruction {

View File

@@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() }
final IRVariable getIRVariable() { result = var }
/**
* Gets the AST variable that this instruction's IR variable refers to, if one exists.
*/
final Language::Variable getASTVariable() { result = var.(IRUserVariable).getVariable() }
}
class FieldInstruction extends Instruction {

View File

@@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() }
final IRVariable getIRVariable() { result = var }
/**
* Gets the AST variable that this instruction's IR variable refers to, if one exists.
*/
final Language::Variable getASTVariable() { result = var.(IRUserVariable).getVariable() }
}
class FieldInstruction extends Instruction {

View File

@@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() }
final IRVariable getIRVariable() { result = var }
/**
* Gets the AST variable that this instruction's IR variable refers to, if one exists.
*/
final Language::Variable getASTVariable() { result = var.(IRUserVariable).getVariable() }
}
class FieldInstruction extends Instruction {

View File

@@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
override string getImmediateString() { result = var.toString() }
final IRVariable getIRVariable() { result = var }
/**
* Gets the AST variable that this instruction's IR variable refers to, if one exists.
*/
final Language::Variable getASTVariable() { result = var.(IRUserVariable).getVariable() }
}
class FieldInstruction extends Instruction {