summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-05-27 16:47:30 +0000
committerDevang Patel <dpatel@apple.com>2010-05-27 16:47:30 +0000
commit55e9717e59165d15161991be56c75c3e80220ee8 (patch)
tree14b7852342609aa7f2e74612f539f476c09078bc /lib/CodeGen
parent098d3a41e11e12f6fe64cf9778d71942a9635e05 (diff)
downloadexternal_llvm-55e9717e59165d15161991be56c75c3e80220ee8.zip
external_llvm-55e9717e59165d15161991be56c75c3e80220ee8.tar.gz
external_llvm-55e9717e59165d15161991be56c75c3e80220ee8.tar.bz2
inlined function's arguments need a label to mark the start point because they are not directly attached to current function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 4d7743d..502da07 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/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 {