diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -79,6 +79,9 @@ "simplify-mir", cl::Hidden, cl::desc("Leave out unnecessary information when printing MIR")); +static cl::opt PrintLocations("mir-debug-loc", cl::Hidden, cl::init(true), + cl::desc("Print MIR debug-locations")); + namespace { /// This structure describes how to print out stack object references. @@ -819,11 +822,13 @@ NeedComma = true; } - if (const DebugLoc &DL = MI.getDebugLoc()) { - if (NeedComma) - OS << ','; - OS << " debug-location "; - DL->printAsOperand(OS, MST); + if (PrintLocations) { + if (const DebugLoc &DL = MI.getDebugLoc()) { + if (NeedComma) + OS << ','; + OS << " debug-location "; + DL->printAsOperand(OS, MST); + } } if (!MI.memoperands_empty()) {