@@ -42,6 +42,14 @@ private predicate shouldPrintFunction(Language::Declaration decl) {
4242 exists ( PrintIRConfiguration config | config .shouldPrintFunction ( decl ) )
4343}
4444
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+
4553private string getAdditionalInstructionProperty ( Instruction instr , string key ) {
4654 exists ( IRPropertyProvider provider | result = provider .getInstructionProperty ( instr , key ) )
4755}
@@ -84,7 +92,9 @@ private string getOperandPropertyString(Operand operand) {
8492private newtype TPrintableIRNode =
8593 TPrintableIRFunction ( IRFunction irFunc ) { shouldPrintFunction ( irFunc .getFunction ( ) ) } or
8694 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+ }
8898
8999/**
90100 * A node to be emitted in the IR graph.
@@ -252,7 +262,8 @@ private class PrintableInstruction extends PrintableIRNode, TPrintableInstructio
252262 private string getOperandsString ( ) {
253263 result =
254264 concat ( Operand operand |
255- operand = instr .getAnOperand ( )
265+ operand = instr .getAnOperand ( ) and
266+ shouldPrintOperand ( operand )
256267 |
257268 operand .getDumpString ( ) + getOperandPropertyString ( operand ) , ", "
258269 order by
0 commit comments