@@ -405,7 +405,11 @@ class InstructionNode extends Node0 {
405
405
/** Gets the instruction corresponding to this node. */
406
406
Instruction getInstruction ( ) { result = instr }
407
407
408
- override Location getLocationImpl ( ) { result = instr .getAst ( ) .getLocation ( ) }
408
+ override Location getLocationImpl ( ) {
409
+ if exists ( instr .getAst ( ) .getLocation ( ) )
410
+ then result = instr .getAst ( ) .getLocation ( )
411
+ else result instanceof UnknownDefaultLocation
412
+ }
409
413
410
414
override string toStringImpl ( ) {
411
415
if instr .( InitializeParameterInstruction ) .getIRVariable ( ) instanceof IRThisVariable
@@ -426,7 +430,11 @@ class OperandNode extends Node, Node0 {
426
430
/** Gets the operand corresponding to this node. */
427
431
Operand getOperand ( ) { result = op }
428
432
429
- override Location getLocationImpl ( ) { result = op .getDef ( ) .getAst ( ) .getLocation ( ) }
433
+ override Location getLocationImpl ( ) {
434
+ if exists ( op .getDef ( ) .getAst ( ) .getLocation ( ) )
435
+ then result = op .getDef ( ) .getAst ( ) .getLocation ( )
436
+ else result instanceof UnknownDefaultLocation
437
+ }
430
438
431
439
override string toStringImpl ( ) {
432
440
if op .getDef ( ) .( InitializeParameterInstruction ) .getIRVariable ( ) instanceof IRThisVariable
@@ -641,6 +649,8 @@ class IndirectParameterNode extends Node, IndirectInstruction {
641
649
642
650
override Declaration getFunction ( ) { result = this .getInstruction ( ) .getEnclosingFunction ( ) }
643
651
652
+ override Location getLocationImpl ( ) { result = this .getParameter ( ) .getLocation ( ) }
653
+
644
654
override string toStringImpl ( ) {
645
655
result = this .getParameter ( ) .toString ( ) + " indirection"
646
656
or
@@ -888,7 +898,11 @@ class RawIndirectOperand extends Node, TRawIndirectOperand {
888
898
)
889
899
}
890
900
891
- final override Location getLocationImpl ( ) { result = this .getOperand ( ) .getLocation ( ) }
901
+ final override Location getLocationImpl ( ) {
902
+ if exists ( this .getOperand ( ) .getLocation ( ) )
903
+ then result = this .getOperand ( ) .getLocation ( )
904
+ else result instanceof UnknownDefaultLocation
905
+ }
892
906
893
907
override string toStringImpl ( ) {
894
908
result = instructionNode ( this .getOperand ( ) .getDef ( ) ) .toStringImpl ( ) + " indirection"
@@ -987,7 +1001,11 @@ class RawIndirectInstruction extends Node, TRawIndirectInstruction {
987
1001
)
988
1002
}
989
1003
990
- final override Location getLocationImpl ( ) { result = this .getInstruction ( ) .getLocation ( ) }
1004
+ final override Location getLocationImpl ( ) {
1005
+ if exists ( this .getInstruction ( ) .getLocation ( ) )
1006
+ then result = this .getInstruction ( ) .getLocation ( )
1007
+ else result instanceof UnknownDefaultLocation
1008
+ }
991
1009
992
1010
override string toStringImpl ( ) {
993
1011
result = instructionNode ( this .getInstruction ( ) ) .toStringImpl ( ) + " indirection"
0 commit comments