diff options
author | Devang Patel <dpatel@apple.com> | 2011-04-27 22:45:24 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-04-27 22:45:24 +0000 |
commit | 77dc541b009401774633d9b28c6ff2612c3393d4 (patch) | |
tree | 707adb2485a44aed8db1fc5969dff6cb736a3b07 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 406c471b69f2d079582b6d09a752d96e826f0535 (diff) | |
download | bcm5719-llvm-77dc541b009401774633d9b28c6ff2612c3393d4.tar.gz bcm5719-llvm-77dc541b009401774633d9b28c6ff2612c3393d4.zip |
Simplify handling of variables with complex address (i.e. blocks variables)
llvm-svn: 130339
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 9ae57b56bd8..fa5cdd248a7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -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 |