@@ -81,6 +81,10 @@ llvm::cl::opt<bool>
81
81
SILPrintTypes (" sil-print-types" , llvm::cl::init(false ),
82
82
llvm::cl::desc(" always print type annotations for instruction operands in SIL output" ));
83
83
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
+
84
88
llvm::cl::opt<bool > SILPrintGenericSpecializationInfo (
85
89
" sil-print-generic-specialization-info" , llvm::cl::init(false ),
86
90
llvm::cl::desc(" Include generic specialization"
@@ -828,6 +832,9 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
828
832
}
829
833
830
834
void printBlockArgumentUses (const SILBasicBlock *BB) {
835
+ if (SILPrintNoUses)
836
+ return ;
837
+
831
838
if (BB->args_empty ())
832
839
return ;
833
840
@@ -942,7 +949,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
942
949
printBlockArguments (BB);
943
950
*this << " :" ;
944
951
945
- if (!BB->pred_empty ()) {
952
+ if (!BB->pred_empty () && !SILPrintNoUses ) {
946
953
PrintState.OS .PadToColumn (50 );
947
954
948
955
*this << " // Preds:" ;
@@ -1032,6 +1039,9 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
1032
1039
}
1033
1040
1034
1041
void printUserList (ArrayRef<SILValue> values, SILNodePointer node) {
1042
+ if (SILPrintNoUses)
1043
+ return ;
1044
+
1035
1045
// If the set of values is empty, we need to print the ID of
1036
1046
// the instruction. Otherwise, if none of the values has a use,
1037
1047
// we don't need to do anything.
0 commit comments