@@ -17,11 +17,11 @@ private import experimental.ir.Util
17
17
private import experimental.ir.internal.IRCSharpLanguage as Language
18
18
19
19
TranslatedElement getInstructionTranslatedElement ( Instruction instruction ) {
20
- instruction = TRawInstruction ( _ , _ , _ , result , _)
20
+ instruction = TRawInstruction ( result , _)
21
21
}
22
22
23
23
InstructionTag getInstructionTag ( Instruction instruction ) {
24
- instruction = TRawInstruction ( _, _ , _ , _ , result )
24
+ instruction = TRawInstruction ( _, result )
25
25
}
26
26
27
27
pragma [ noinline]
@@ -51,13 +51,8 @@ module Raw {
51
51
}
52
52
53
53
cached
54
- predicate hasInstruction (
55
- Callable callable , Opcode opcode , Language:: AST ast , TranslatedElement element ,
56
- InstructionTag tag
57
- ) {
58
- element .hasInstruction ( opcode , tag , _) and
59
- ast = element .getAST ( ) and
60
- callable = element .getFunction ( )
54
+ predicate hasInstruction ( TranslatedElement element , InstructionTag tag ) {
55
+ element .hasInstruction ( _, tag , _)
61
56
}
62
57
63
58
cached
@@ -173,11 +168,16 @@ import Cached
173
168
cached
174
169
private module Cached {
175
170
cached
176
- Opcode getInstructionOpcode ( TRawInstruction instr ) { instr = TRawInstruction ( _, result , _, _, _) }
171
+ Opcode getInstructionOpcode ( TRawInstruction instr ) {
172
+ exists ( TranslatedElement element , InstructionTag tag |
173
+ instructionOrigin ( instr , element , tag ) and
174
+ element .hasInstruction ( result , tag , _)
175
+ )
176
+ }
177
177
178
178
cached
179
179
IRFunctionBase getInstructionEnclosingIRFunction ( TRawInstruction instr ) {
180
- instr = TRawInstruction ( result , _ , _ , _ , _ )
180
+ result . getFunction ( ) = getInstructionTranslatedElement ( instr ) . getFunction ( )
181
181
}
182
182
183
183
cached
0 commit comments