diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-17 22:30:56 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-17 22:30:56 +0000 |
commit | 57bab0bc97d1e6ff118fb2f3a2a6856cbedff1de (patch) | |
tree | f4b956c4e0629db481c1ea19f9d9558c1de0ac80 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 1d89a02abbaa48745066a3c3eabe2fbaa2194def (diff) | |
download | bcm5719-llvm-57bab0bc97d1e6ff118fb2f3a2a6856cbedff1de.tar.gz bcm5719-llvm-57bab0bc97d1e6ff118fb2f3a2a6856cbedff1de.zip |
AsmPrinter: Take range in DwarfExpression::AddExpression(), NFC
Previously `DwarfExpression::AddExpression()` relied on
default-constructing the end iterators for `DIExpression` -- once the
operands are represented explicitly via `MDExpression` (instead of via
the strange `StringRef` navigator in `DIHeaderIterator`) this won't
work. Explicitly take an iterator for the end of the range.
llvm-svn: 229572
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 81f2329657b..a620ebba241 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -527,8 +527,11 @@ DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV, const TargetFrameLowering *TFI = Asm->TM.getSubtargetImpl()->getFrameLowering(); int Offset = TFI->getFrameIndexReference(*Asm->MF, FI, FrameReg); + assert(Expr != DV.getExpression().end() && + "Wrong number of expressions"); DwarfExpr.AddMachineRegIndirect(FrameReg, Offset); - DwarfExpr.AddExpression(*(Expr++)); + DwarfExpr.AddExpression(Expr->begin(), Expr->end()); + ++Expr; } addBlock(*VariableDie, dwarf::DW_AT_location, Loc); @@ -780,7 +783,7 @@ void DwarfCompileUnit::addComplexAddress(const DbgVariable &DV, DIE &Die, ValidReg = DwarfExpr.AddMachineRegIndirect(Location.getReg(), Location.getOffset()); if (ValidReg) - DwarfExpr.AddExpression(Expr); + DwarfExpr.AddExpression(Expr.begin(), Expr.end()); } else ValidReg = DwarfExpr.AddMachineRegExpression(Expr, Location.getReg()); |