summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-03 16:23:04 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-03 16:23:04 +0000
commitc5bd3e01df02b0101f69749208c17d87e9a2e610 (patch)
tree00a2323d6786d4312d1108e1ae8ec0de172589b8 /llvm/lib/CodeGen/MachineInstr.cpp
parentefece52160095fb4837c51e304a23c22af860107 (diff)
downloadbcm5719-llvm-c5bd3e01df02b0101f69749208c17d87e9a2e610.tar.gz
bcm5719-llvm-c5bd3e01df02b0101f69749208c17d87e9a2e610.zip
CodeGen: Fix MachineInstr::print() for DBG_VALUE
Grab the `MDLocalVariable` from the second-to-last argument; the last argument is an `MDExpression`, and mixing them up will crash. llvm-svn: 234019
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index c2accbd1a2a..f1c0d8ef2ad 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1711,9 +1711,9 @@ void MachineInstr::print(raw_ostream &OS, bool SkipOpers) const {
}
// Print debug location information.
- if (isDebugValue() && getOperand(e - 1).isMetadata()) {
+ if (isDebugValue() && getOperand(e - 2).isMetadata()) {
if (!HaveSemi) OS << ";";
- DIVariable DV(getOperand(e - 1).getMetadata());
+ DIVariable DV(getOperand(e - 2).getMetadata());
OS << " line no:" << DV.getLineNumber();
if (auto *InlinedAt = DV.getInlinedAt()) {
DebugLoc InlinedAtDL(InlinedAt);
OpenPOWER on IntegriCloud