@@ -180,7 +180,7 @@ module Raw {
180
180
181
181
class TStageInstruction = TRawInstruction or TRawUnreachedInstruction ;
182
182
183
- predicate hasInstruction ( TRawInstruction instr ) { any ( ) }
183
+ predicate hasInstruction ( TStageInstruction instr ) { any ( ) }
184
184
185
185
predicate hasModeledMemoryResult ( Instruction instruction ) { none ( ) }
186
186
@@ -368,6 +368,11 @@ private predicate isStrictlyForwardGoto(GotoStmt goto) {
368
368
369
369
Locatable getInstructionAst ( TStageInstruction instr ) {
370
370
result = getInstructionTranslatedElement ( instr ) .getAst ( )
371
+ or
372
+ exists ( IRFunction irFunc |
373
+ instr = TRawUnreachedInstruction ( irFunc ) and
374
+ result = irFunc .getFunction ( )
375
+ )
371
376
}
372
377
373
378
/** DEPRECATED: Alias for getInstructionAst */
@@ -377,14 +382,22 @@ deprecated Locatable getInstructionAST(TStageInstruction instr) {
377
382
378
383
CppType getInstructionResultType ( TStageInstruction instr ) {
379
384
getInstructionTranslatedElement ( instr ) .hasInstruction ( _, getInstructionTag ( instr ) , result )
385
+ or
386
+ instr instanceof TRawUnreachedInstruction and
387
+ result = getVoidType ( )
380
388
}
381
389
382
390
predicate getInstructionOpcode ( Opcode opcode , TStageInstruction instr ) {
383
391
getInstructionTranslatedElement ( instr ) .hasInstruction ( opcode , getInstructionTag ( instr ) , _)
392
+ or
393
+ instr instanceof TRawUnreachedInstruction and
394
+ opcode instanceof Opcode:: Unreached
384
395
}
385
396
386
397
IRFunctionBase getInstructionEnclosingIRFunction ( TStageInstruction instr ) {
387
398
result .getFunction ( ) = getInstructionTranslatedElement ( instr ) .getFunction ( )
399
+ or
400
+ instr = TRawUnreachedInstruction ( result )
388
401
}
389
402
390
403
Instruction getPrimaryInstructionForSideEffect ( SideEffectInstruction instruction ) {
0 commit comments