mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Simplify handling of variables with complex address (i.e. blocks variables)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -192,16 +192,10 @@ void CompileUnit::addSourceLine(DIE *Die, DINameSpace NS) {
|
||||
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
||||
}
|
||||
|
||||
/// addFrameVariableAddress - Add DW_AT_location attribute for a
|
||||
/// DbgVariable based on provided frame index.
|
||||
void CompileUnit::addFrameVariableAddress(DbgVariable *&DV, DIE *Die,
|
||||
int64_t FI) {
|
||||
MachineLocation Location;
|
||||
unsigned FrameReg;
|
||||
const TargetFrameLowering *TFI = Asm->TM.getFrameLowering();
|
||||
int Offset = TFI->getFrameIndexReference(*Asm->MF, FI, FrameReg);
|
||||
Location.set(FrameReg, Offset);
|
||||
|
||||
/// addVariableAddress - Add DW_AT_location attribute for a
|
||||
/// DbgVariable based on provided MachineLocation.
|
||||
void CompileUnit::addVariableAddress(DbgVariable *&DV, DIE *Die,
|
||||
MachineLocation Location) {
|
||||
if (DV->variableHasComplexAddress())
|
||||
addComplexAddress(DV, Die, dwarf::DW_AT_location, Location);
|
||||
else if (DV->isBlockByrefVariable())
|
||||
@ -255,17 +249,6 @@ void CompileUnit::addAddress(DIE *Die, unsigned Attribute,
|
||||
addBlock(Die, Attribute, 0, Block);
|
||||
}
|
||||
|
||||
/// addRegisterAddress - Add register location entry in variable DIE.
|
||||
bool CompileUnit::addRegisterAddress(DIE *Die, const MachineOperand &MO) {
|
||||
assert (MO.isReg() && "Invalid machine operand!");
|
||||
if (!MO.getReg())
|
||||
return false;
|
||||
MachineLocation Location;
|
||||
Location.set(MO.getReg());
|
||||
addAddress(Die, dwarf::DW_AT_location, Location);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// addComplexAddress - Start with the address based on the location provided,
|
||||
/// and generate the DWARF information necessary to find the actual variable
|
||||
/// given the extra address information encoded in the DIVariable, starting from
|
||||
|
Reference in New Issue
Block a user