mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 22:24:28 +00:00
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
This commit is contained in:
@ -129,12 +129,15 @@ public:
|
|||||||
class VISIBILITY_HIDDEN DbgVariable {
|
class VISIBILITY_HIDDEN DbgVariable {
|
||||||
DIVariable Var; // Variable Descriptor.
|
DIVariable Var; // Variable Descriptor.
|
||||||
unsigned FrameIndex; // Variable frame index.
|
unsigned FrameIndex; // Variable frame index.
|
||||||
|
bool InlinedFnVar; // Variable for an inlined function.
|
||||||
public:
|
public:
|
||||||
DbgVariable(DIVariable V, unsigned I) : Var(V), FrameIndex(I) {}
|
DbgVariable(DIVariable V, unsigned I, bool IFV)
|
||||||
|
: Var(V), FrameIndex(I), InlinedFnVar(IFV) {}
|
||||||
|
|
||||||
// Accessors.
|
// Accessors.
|
||||||
DIVariable getVariable() const { return Var; }
|
DIVariable getVariable() const { return Var; }
|
||||||
unsigned getFrameIndex() const { return FrameIndex; }
|
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());
|
AddType(Unit, VariableDie, VD.getType());
|
||||||
|
|
||||||
// Add variable address.
|
// Add variable address.
|
||||||
MachineLocation Location;
|
if (!DV->isInlinedFnVar()) {
|
||||||
Location.set(RI->getFrameRegister(*MF),
|
// Variables for abstract instances of inlined functions don't get a
|
||||||
RI->getFrameIndexOffset(*MF, DV->getFrameIndex()));
|
// location.
|
||||||
AddAddress(VariableDie, dwarf::DW_AT_location, Location);
|
MachineLocation Location;
|
||||||
|
Location.set(RI->getFrameRegister(*MF),
|
||||||
|
RI->getFrameIndexOffset(*MF, DV->getFrameIndex()));
|
||||||
|
AddAddress(VariableDie, dwarf::DW_AT_location, Location);
|
||||||
|
}
|
||||||
|
|
||||||
return VariableDie;
|
return VariableDie;
|
||||||
}
|
}
|
||||||
@ -2434,6 +2441,7 @@ void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex,
|
|||||||
|
|
||||||
DIDescriptor Desc(GV);
|
DIDescriptor Desc(GV);
|
||||||
DbgScope *Scope = NULL;
|
DbgScope *Scope = NULL;
|
||||||
|
bool InlinedFnVar = false;
|
||||||
|
|
||||||
if (Desc.getTag() == dwarf::DW_TAG_variable) {
|
if (Desc.getTag() == dwarf::DW_TAG_variable) {
|
||||||
// GV is a global variable.
|
// GV is a global variable.
|
||||||
@ -2472,6 +2480,7 @@ void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex,
|
|||||||
// or GV is an inlined local variable.
|
// or GV is an inlined local variable.
|
||||||
Scope = AI->second;
|
Scope = AI->second;
|
||||||
InlinedParamMap[V].insert(GV);
|
InlinedParamMap[V].insert(GV);
|
||||||
|
InlinedFnVar = true;
|
||||||
} else {
|
} else {
|
||||||
// or GV is a local variable.
|
// or GV is a local variable.
|
||||||
Scope = getOrCreateScope(V);
|
Scope = getOrCreateScope(V);
|
||||||
@ -2480,7 +2489,7 @@ void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(Scope && "Unable to find the variable's scope");
|
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);
|
Scope->AddVariable(DV);
|
||||||
|
|
||||||
if (TimePassesIsEnabled)
|
if (TimePassesIsEnabled)
|
||||||
|
Reference in New Issue
Block a user