From 7f48777609b85f3c60bbeed625e7888ed2e84663 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Thu, 10 Apr 2014 17:39:48 +0000 Subject: Debug info: Factor the retrieving of the DIVariable from a MachineInstr into a function. llvm-svn: 205973 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 11345eb288a..fde3604e04f 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/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)) -- cgit v1.2.3