diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-01-19 17:57:29 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-01-19 17:57:29 +0000 |
commit | 5883af3faaa5355cc886c0b66c95ab7669e024dc (patch) | |
tree | ca7fa021facd981f77260e5af019f357165ac39b /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 7c6f944cdf82c2faa5e2ae0a88184b5683474442 (diff) | |
download | bcm5719-llvm-5883af3faaa5355cc886c0b66c95ab7669e024dc.tar.gz bcm5719-llvm-5883af3faaa5355cc886c0b66c95ab7669e024dc.zip |
Remove support for DIVariable's FlagIndirectVariable and expect
frontends to use a DIExpression with a DW_OP_deref instead.
This is not only a much more natural place for this informationl; there
is also a technical reason: The FlagIndirectVariable is used to mark a
variable that is turned into a reference by virtue of the calling
convention; this happens for example to aggregate return values.
The inliner, for example, may actually need to undo this indirection to
correctly represent the value in its new context. This is impossible to
implement because the DIVariable can't be safely modified. We can however
safely construct a new DIExpression on the fly.
llvm-svn: 226476
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index b4dba9c5923..155cd4c0191 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -737,18 +737,16 @@ void DwarfCompileUnit::addVariableAddress(const DbgVariable &DV, DIE &Die, else if (DV.isBlockByrefVariable()) addBlockByrefAddress(DV, Die, dwarf::DW_AT_location, Location); else - addAddress(Die, dwarf::DW_AT_location, Location, - DV.getVariable().isIndirect()); + addAddress(Die, dwarf::DW_AT_location, Location); } /// Add an address attribute to a die based on the location provided. void DwarfCompileUnit::addAddress(DIE &Die, dwarf::Attribute Attribute, - const MachineLocation &Location, - bool Indirect) { + const MachineLocation &Location) { DIELoc *Loc = new (DIEValueAllocator) DIELoc(); bool validReg; - if (Location.isReg() && !Indirect) + if (Location.isReg()) validReg = addRegisterOpPiece(*Loc, Location.getReg()); else validReg = addRegisterOffset(*Loc, Location.getReg(), Location.getOffset()); @@ -756,9 +754,6 @@ void DwarfCompileUnit::addAddress(DIE &Die, dwarf::Attribute Attribute, if (!validReg) return; - if (!Location.isReg() && Indirect) - addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_deref); - // Now attach the location information to the DIE. addBlock(Die, Attribute, Loc); } @@ -775,16 +770,10 @@ void DwarfCompileUnit::addComplexAddress(const DbgVariable &DV, DIE &Die, DIExpression Expr = DV.getExpression(); if (Location.getOffset()) { if (DwarfExpr.AddMachineRegIndirect(Location.getReg(), - Location.getOffset())) { + Location.getOffset())) DwarfExpr.AddExpression(Expr); - assert(!DV.getVariable().isIndirect() - && "double indirection not handled"); - } - } else { - if (DwarfExpr.AddMachineRegExpression(Expr, Location.getReg())) - if (DV.getVariable().isIndirect()) - DwarfExpr.EmitOp(dwarf::DW_OP_deref); - } + } else + DwarfExpr.AddMachineRegExpression(Expr, Location.getReg()); // Now attach the location information to the DIE. addBlock(Die, Attribute, Loc); |