[PATCH] D77575: [debugify] Add way to omit debug-location from MIR output
Daniel Sanders via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 11:25:40 PDT 2020
dsanders created this revision.
dsanders added reviewers: aprantl, bogner, vsk.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
dsanders added a child revision: D77576: [globalisel] Add lost debug locations verifier.
In lieu of a proper pass that strips debug info, add a way
to omit debug-locations from the MIR output so that
instructions with MMO's continue to match CHECK's when
mir-debugify is used
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77575
Files:
llvm/lib/CodeGen/MIRPrinter.cpp
Index: llvm/lib/CodeGen/MIRPrinter.cpp
===================================================================
--- llvm/lib/CodeGen/MIRPrinter.cpp
+++ 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<bool> 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()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77575.255415.patch
Type: text/x-patch
Size: 988 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200406/1c4ae4a0/attachment.bin>
More information about the llvm-commits
mailing list