@@ -81,6 +81,10 @@ llvm::cl::opt<bool>
8181SILPrintTypes (" sil-print-types" , llvm::cl::init(false ),
8282 llvm::cl::desc(" always print type annotations for instruction operands in SIL output" ));
8383
84+ llvm::cl::opt<bool >
85+ SILPrintNoUses (" sil-print-no-uses" , llvm::cl::init(false ),
86+ llvm::cl::desc(" omit use comments in SIL output" ));
87+
8488llvm::cl::opt<bool > SILPrintGenericSpecializationInfo (
8589 " sil-print-generic-specialization-info" , llvm::cl::init(false ),
8690 llvm::cl::desc(" Include generic specialization"
@@ -828,6 +832,9 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
828832 }
829833
830834 void printBlockArgumentUses (const SILBasicBlock *BB) {
835+ if (SILPrintNoUses)
836+ return ;
837+
831838 if (BB->args_empty ())
832839 return ;
833840
@@ -942,7 +949,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
942949 printBlockArguments (BB);
943950 *this << " :" ;
944951
945- if (!BB->pred_empty ()) {
952+ if (!BB->pred_empty () && !SILPrintNoUses ) {
946953 PrintState.OS .PadToColumn (50 );
947954
948955 *this << " // Preds:" ;
@@ -1032,6 +1039,9 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
10321039 }
10331040
10341041 void printUserList (ArrayRef<SILValue> values, SILNodePointer node) {
1042+ if (SILPrintNoUses)
1043+ return ;
1044+
10351045 // If the set of values is empty, we need to print the ID of
10361046 // the instruction. Otherwise, if none of the values has a use,
10371047 // we don't need to do anything.
0 commit comments