From 5e6b71ce34512670be9a55e859bbacfdfa8edaaf Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 27 May 2010 16:47:30 +0000 Subject: inlined function's arguments need a label to mark the start point because they are not directly attached to current function. llvm-svn: 104848 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 4d7743d0f6c..502da07c149 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2635,13 +2635,16 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { const MachineInstr *MI = II; DebugLoc DL = MI->getDebugLoc(); if (MI->isDebugValue()) { - // DBG_VALUE needs a label if the variable is local variable or - // an argument whose location is changing. assert (MI->getNumOperands() > 1 && "Invalid machine instruction!"); DIVariable DV(MI->getOperand(MI->getNumOperands() - 1).getMetadata()); if (!DV.Verify()) continue; + // If DBG_VALUE is for a local variable then it needs a label. if (DV.getTag() != dwarf::DW_TAG_arg_variable) InsnNeedsLabel.insert(MI); + // DBG_VALUE for inlined functions argument needs a label. + else if (!DISubprogram(DV.getContext()).describes(MF->getFunction())) + InsnNeedsLabel.insert(MI); + // DBG_VALUE indicating argument location change needs a label. else if (!ProcessedArgs.insert(DV)) InsnNeedsLabel.insert(MI); } else { -- cgit v1.2.3