aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-05-18 23:08:55 +0000
committerBill Wendling <isanbard@gmail.com>2009-05-18 23:08:55 +0000
commit1180c7899ca101bdb96cf36a0101bf161e510fcb (patch)
treefa5b61ab34818f0951c98a6837e18366db5236f5 /lib/CodeGen
parentcde5d63d909c2c3b9c2a30cef107f77a7a556deb (diff)
downloadexternal_llvm-1180c7899ca101bdb96cf36a0101bf161e510fcb.zip
external_llvm-1180c7899ca101bdb96cf36a0101bf161e510fcb.tar.gz
external_llvm-1180c7899ca101bdb96cf36a0101bf161e510fcb.tar.bz2
Don't set the "location" information for inlined functions' variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 5ffe1fd..086a8a5 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -129,12 +129,15 @@ public:
class VISIBILITY_HIDDEN DbgVariable {
DIVariable Var; // Variable Descriptor.
unsigned FrameIndex; // Variable frame index.
+ bool InlinedFnVar; // Variable for an inlined function.
public:
- DbgVariable(DIVariable V, unsigned I) : Var(V), FrameIndex(I) {}
+ DbgVariable(DIVariable V, unsigned I, bool IFV)
+ : Var(V), FrameIndex(I), InlinedFnVar(IFV) {}
// Accessors.
- DIVariable getVariable() const { return Var; }
+ DIVariable getVariable() const { return Var; }
unsigned getFrameIndex() const { return FrameIndex; }
+ bool isInlinedFnVar() const { return InlinedFnVar; }
};
//===----------------------------------------------------------------------===//
@@ -956,10 +959,14 @@ DIE *DwarfDebug::NewDbgScopeVariable(DbgVariable *DV, CompileUnit *Unit) {
AddType(Unit, VariableDie, VD.getType());
// Add variable address.
- MachineLocation Location;
- Location.set(RI->getFrameRegister(*MF),
- RI->getFrameIndexOffset(*MF, DV->getFrameIndex()));
- AddAddress(VariableDie, dwarf::DW_AT_location, Location);
+ if (!DV->isInlinedFnVar()) {
+ // Variables for abstract instances of inlined functions don't get a
+ // location.
+ MachineLocation Location;
+ Location.set(RI->getFrameRegister(*MF),
+ RI->getFrameIndexOffset(*MF, DV->getFrameIndex()));
+ AddAddress(VariableDie, dwarf::DW_AT_location, Location);
+ }
return VariableDie;
}
@@ -2434,6 +2441,7 @@ void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex,
DIDescriptor Desc(GV);
DbgScope *Scope = NULL;
+ bool InlinedFnVar = false;
if (Desc.getTag() == dwarf::DW_TAG_variable) {
// GV is a global variable.
@@ -2472,6 +2480,7 @@ void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex,
// or GV is an inlined local variable.
Scope = AI->second;
InlinedParamMap[V].insert(GV);
+ InlinedFnVar = true;
} else {
// or GV is a local variable.
Scope = getOrCreateScope(V);
@@ -2480,7 +2489,7 @@ void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex,
}
assert(Scope && "Unable to find the variable's scope");
- DbgVariable *DV = new DbgVariable(DIVariable(GV), FrameIndex);
+ DbgVariable *DV = new DbgVariable(DIVariable(GV), FrameIndex, InlinedFnVar);
Scope->AddVariable(DV);
if (TimePassesIsEnabled)