@@ -42,6 +42,14 @@ private predicate shouldPrintFunction(Language::Declaration decl) {
42
42
exists ( PrintIRConfiguration config | config .shouldPrintFunction ( decl ) )
43
43
}
44
44
45
+ private predicate shouldPrintInstruction ( Instruction i ) {
46
+ exists ( IRPropertyProvider provider | provider .shouldPrintInstruction ( i ) )
47
+ }
48
+
49
+ private predicate shouldPrintOperand ( Operand operand ) {
50
+ exists ( IRPropertyProvider provider | provider .shouldPrintOperand ( operand ) )
51
+ }
52
+
45
53
private string getAdditionalInstructionProperty ( Instruction instr , string key ) {
46
54
exists ( IRPropertyProvider provider | result = provider .getInstructionProperty ( instr , key ) )
47
55
}
@@ -84,7 +92,9 @@ private string getOperandPropertyString(Operand operand) {
84
92
private newtype TPrintableIRNode =
85
93
TPrintableIRFunction ( IRFunction irFunc ) { shouldPrintFunction ( irFunc .getFunction ( ) ) } or
86
94
TPrintableIRBlock ( IRBlock block ) { shouldPrintFunction ( block .getEnclosingFunction ( ) ) } or
87
- TPrintableInstruction ( Instruction instr ) { shouldPrintFunction ( instr .getEnclosingFunction ( ) ) }
95
+ TPrintableInstruction ( Instruction instr ) {
96
+ shouldPrintInstruction ( instr ) and shouldPrintFunction ( instr .getEnclosingFunction ( ) )
97
+ }
88
98
89
99
/**
90
100
* A node to be emitted in the IR graph.
@@ -252,7 +262,8 @@ private class PrintableInstruction extends PrintableIRNode, TPrintableInstructio
252
262
private string getOperandsString ( ) {
253
263
result =
254
264
concat ( Operand operand |
255
- operand = instr .getAnOperand ( )
265
+ operand = instr .getAnOperand ( ) and
266
+ shouldPrintOperand ( operand )
256
267
|
257
268
operand .getDumpString ( ) + getOperandPropertyString ( operand ) , ", "
258
269
order by
0 commit comments