summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-01-19 11:44:42 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-01-19 11:44:42 +0000
commit548add992ea50a41f7f7daf539e7fa333a00c48d (patch)
treee39b36cf74a2e36c99276ee3b92b37ba7d93182c /llvm/lib/CodeGen/MachineInstr.cpp
parent91f14e69b8f4d2cfa3905f6c25630935682837b3 (diff)
downloadbcm5719-llvm-548add992ea50a41f7f7daf539e7fa333a00c48d.tar.gz
bcm5719-llvm-548add992ea50a41f7f7daf539e7fa333a00c48d.zip
[CodeGen] Unify printing format of debug-location in both MIR and -debug
Use "debug-location" instead of "; dbg:" in MI::print. llvm-svn: 322936
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 1b3fabad897..32785dee0cb 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1425,6 +1425,15 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
}
}
+ if (!SkipDebugLoc) {
+ if (const DebugLoc &DL = getDebugLoc()) {
+ if (!FirstOp)
+ OS << ',';
+ OS << " debug-location ";
+ DL->printAsOperand(OS, MST);
+ }
+ }
+
bool HaveSemi = false;
if (!memoperands_empty()) {
if (!HaveSemi) {
@@ -1441,6 +1450,9 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
}
}
+ if (SkipDebugLoc)
+ return;
+
// Print debug location information.
if (isDebugValue() && getOperand(e - 2).isMetadata()) {
if (!HaveSemi)
@@ -1457,13 +1469,6 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
}
if (isIndirectDebugValue())
OS << " indirect";
- } else if (SkipDebugLoc) {
- return;
- } else if (debugLoc && MF) {
- if (!HaveSemi)
- OS << ";";
- OS << " dbg:";
- debugLoc.print(OS);
}
OS << '\n';
OpenPOWER on IntegriCloud