Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112583 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2010-08-31 06:11:28 +00:00
parent f53de86cba
commit 9e3bd2c476
2 changed files with 15 additions and 15 deletions

View File

@ -583,10 +583,15 @@ void DwarfDebug::addSourceLine(DIE *Die, DINameSpace NS) {
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
}
/// addVariableAddress - Add DW_AT_location attribute for a DbgVariable.
void DwarfDebug::addVariableAddress(DbgVariable *&DV, DIE *Die,
unsigned Attribute,
const MachineLocation &Location) {
/// addVariableAddress - Add DW_AT_location attribute for a DbgVariable based
/// on provided frame index.
void DwarfDebug::addVariableAddress(DbgVariable *&DV, DIE *Die, int64_t FI) {
MachineLocation Location;
unsigned FrameReg;
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
int Offset = RI->getFrameIndexReference(*Asm->MF, FI, FrameReg);
Location.set(FrameReg, Offset);
if (DV->variableHasComplexAddress())
addComplexAddress(DV, Die, dwarf::DW_AT_location, Location);
else if (DV->isBlockByrefVariable())
@ -1653,15 +1658,10 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) {
}
// .. else use frame index, if available.
MachineLocation Location;
unsigned FrameReg;
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
int FI = 0;
if (findVariableFrameIndex(DV, &FI)) {
int Offset = RI->getFrameIndexReference(*Asm->MF, FI, FrameReg);
Location.set(FrameReg, Offset);
addVariableAddress(DV, VariableDie, dwarf::DW_AT_location, Location);
}
if (findVariableFrameIndex(DV, &FI))
addVariableAddress(DV, VariableDie, FI);
DV->setDIE(VariableDie);
return VariableDie;

View File

@ -375,9 +375,9 @@ private:
void addBlockByrefAddress(DbgVariable *&DV, DIE *Die, unsigned Attribute,
const MachineLocation &Location);
/// addVariableAddress - Add DW_AT_location attribute for a DbgVariable.
void addVariableAddress(DbgVariable *&DV, DIE *Die, unsigned Attribute,
const MachineLocation &Location);
/// addVariableAddress - Add DW_AT_location attribute for a DbgVariable based
/// on provided frame index.
void addVariableAddress(DbgVariable *&DV, DIE *Die, int64_t FI);
/// addToContextOwner - Add Die into the list of its context owner's children.
void addToContextOwner(DIE *Die, DIDescriptor Context);