@@ -71,7 +71,8 @@ module Raw {
71
71
cached
72
72
TIRVariable getInstructionVariable ( Instruction instruction ) {
73
73
exists ( TranslatedElement element , InstructionTag tag |
74
- instruction = TRawInstruction ( element , tag ) and
74
+ element = getInstructionTranslatedElement ( instruction ) and
75
+ tag = getInstructionTag ( instruction ) and
75
76
(
76
77
result = element .getInstructionVariable ( tag ) or
77
78
result .( IRStringLiteral ) .getAST ( ) = element .getInstructionStringLiteral ( tag )
@@ -81,10 +82,9 @@ module Raw {
81
82
82
83
cached
83
84
Field getInstructionField ( Instruction instruction ) {
84
- exists ( TranslatedElement element , InstructionTag tag |
85
- instruction = TRawInstruction ( element , tag ) and
86
- result = element .getInstructionField ( tag )
87
- )
85
+ result =
86
+ getInstructionTranslatedElement ( instruction )
87
+ .getInstructionField ( getInstructionTag ( instruction ) )
88
88
}
89
89
90
90
cached
@@ -103,10 +103,9 @@ module Raw {
103
103
104
104
cached
105
105
int getInstructionIndex ( Instruction instruction ) {
106
- exists ( TranslatedElement element , InstructionTag tag |
107
- instruction = TRawInstruction ( element , tag ) and
108
- result = element .getInstructionIndex ( tag )
109
- )
106
+ result =
107
+ getInstructionTranslatedElement ( instruction )
108
+ .getInstructionIndex ( getInstructionTag ( instruction ) )
110
109
}
111
110
112
111
cached
@@ -131,10 +130,9 @@ module Raw {
131
130
132
131
cached
133
132
int getInstructionElementSize ( Instruction instruction ) {
134
- exists ( TranslatedElement element , InstructionTag tag |
135
- instruction = TRawInstruction ( element , tag ) and
136
- result = element .getInstructionElementSize ( tag )
137
- )
133
+ result =
134
+ getInstructionTranslatedElement ( instruction )
135
+ .getInstructionElementSize ( getInstructionTag ( instruction ) )
138
136
}
139
137
140
138
cached
@@ -345,28 +343,21 @@ Locatable getInstructionAST(TStageInstruction instr) {
345
343
}
346
344
347
345
CppType getInstructionResultType ( TStageInstruction instr ) {
348
- exists ( TranslatedElement element , InstructionTag tag |
349
- instr = TRawInstruction ( element , tag ) and
350
- element .hasInstruction ( _, tag , result )
351
- )
346
+ getInstructionTranslatedElement ( instr ) .hasInstruction ( _, getInstructionTag ( instr ) , result )
352
347
}
353
348
354
349
Opcode getInstructionOpcode ( TStageInstruction instr ) {
355
- exists ( TranslatedElement element , InstructionTag tag |
356
- instr = TRawInstruction ( element , tag ) and
357
- element .hasInstruction ( result , tag , _)
358
- )
350
+ getInstructionTranslatedElement ( instr ) .hasInstruction ( result , getInstructionTag ( instr ) , _)
359
351
}
360
352
361
353
IRFunctionBase getInstructionEnclosingIRFunction ( TStageInstruction instr ) {
362
354
result .getFunction ( ) = getInstructionTranslatedElement ( instr ) .getFunction ( )
363
355
}
364
356
365
357
Instruction getPrimaryInstructionForSideEffect ( SideEffectInstruction instruction ) {
366
- exists ( TranslatedElement element , InstructionTag tag |
367
- instruction = TRawInstruction ( element , tag ) and
368
- result = element .getPrimaryInstructionForSideEffect ( tag )
369
- )
358
+ result =
359
+ getInstructionTranslatedElement ( instruction )
360
+ .getPrimaryInstructionForSideEffect ( getInstructionTag ( instruction ) )
370
361
}
371
362
372
363
import CachedForDebugging
0 commit comments