File tree Expand file tree Collapse file tree 5 files changed +25
-0
lines changed
cpp/ql/src/semmle/code/cpp/ir/implementation
csharp/ql/src/semmle/code/csharp/ir/implementation Expand file tree Collapse file tree 5 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
612612 override string getImmediateString ( ) { result = var .toString ( ) }
613613
614614 final IRVariable getIRVariable ( ) { result = var }
615+
616+ /**
617+ * Gets the AST variable that this instruction's IR variable refers to, if one exists.
618+ */
619+ final Language:: Variable getASTVariable ( ) { result = var .( IRUserVariable ) .getVariable ( ) }
615620}
616621
617622class FieldInstruction extends Instruction {
Original file line number Diff line number Diff line change @@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
612612 override string getImmediateString ( ) { result = var .toString ( ) }
613613
614614 final IRVariable getIRVariable ( ) { result = var }
615+
616+ /**
617+ * Gets the AST variable that this instruction's IR variable refers to, if one exists.
618+ */
619+ final Language:: Variable getASTVariable ( ) { result = var .( IRUserVariable ) .getVariable ( ) }
615620}
616621
617622class FieldInstruction extends Instruction {
Original file line number Diff line number Diff line change @@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
612612 override string getImmediateString ( ) { result = var .toString ( ) }
613613
614614 final IRVariable getIRVariable ( ) { result = var }
615+
616+ /**
617+ * Gets the AST variable that this instruction's IR variable refers to, if one exists.
618+ */
619+ final Language:: Variable getASTVariable ( ) { result = var .( IRUserVariable ) .getVariable ( ) }
615620}
616621
617622class FieldInstruction extends Instruction {
Original file line number Diff line number Diff line change @@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
612612 override string getImmediateString ( ) { result = var .toString ( ) }
613613
614614 final IRVariable getIRVariable ( ) { result = var }
615+
616+ /**
617+ * Gets the AST variable that this instruction's IR variable refers to, if one exists.
618+ */
619+ final Language:: Variable getASTVariable ( ) { result = var .( IRUserVariable ) .getVariable ( ) }
615620}
616621
617622class FieldInstruction extends Instruction {
Original file line number Diff line number Diff line change @@ -612,6 +612,11 @@ class VariableInstruction extends Instruction {
612612 override string getImmediateString ( ) { result = var .toString ( ) }
613613
614614 final IRVariable getIRVariable ( ) { result = var }
615+
616+ /**
617+ * Gets the AST variable that this instruction's IR variable refers to, if one exists.
618+ */
619+ final Language:: Variable getASTVariable ( ) { result = var .( IRUserVariable ) .getVariable ( ) }
615620}
616621
617622class FieldInstruction extends Instruction {
You can’t perform that action at this time.
0 commit comments