mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
IR: Add VariableInstruction.getASTVariable
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user