summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 11345eb288..fde3604e04 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1198,7 +1198,7 @@ static DebugLocEntry getDebugLocEntry(AsmPrinter *Asm,
const MCSymbol *SLabel,
const MachineInstr *MI,
DwarfCompileUnit *Unit) {
- const MDNode *Var = MI->getOperand(MI->getNumOperands() - 1).getMetadata();
+ const MDNode *Var = MI->getDebugVariable();
assert(MI->getNumOperands() == 3);
if (MI->getOperand(0).isReg()) {
@@ -1493,8 +1493,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
assert(MI->getNumOperands() > 1 && "Invalid machine instruction!");
// Keep track of user variables.
- const MDNode *Var =
- MI->getOperand(MI->getNumOperands() - 1).getMetadata();
+ const MDNode *Var = MI->getDebugVariable();
// Variable is in a register, we need to check for clobbers.
if (isDbgValueInDefinedReg(MI))