diff options
| author | Hans Wennborg <hans@hanshq.net> | 2019-04-12 12:54:52 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2019-04-12 12:54:52 +0000 |
| commit | 4e6b8579221c67b83901bcc621d330e7e99a9294 (patch) | |
| tree | c6bb9bfe17d1be6f330361618da2c63a6eee050f /llvm/lib/CodeGen/PrologEpilogInserter.cpp | |
| parent | 88089fed9c79857ce6bb17669c694912f6523955 (diff) | |
| download | bcm5719-llvm-4e6b8579221c67b83901bcc621d330e7e99a9294.tar.gz bcm5719-llvm-4e6b8579221c67b83901bcc621d330e7e99a9294.zip | |
Revert r358268 "[DebugInfo] DW_OP_deref_size in PrologEpilogInserter."
It causes clang to crash while building Chromium. See https://crbug.com/952230
for reproducer.
> The PrologEpilogInserter need to insert a DW_OP_deref_size before
> prepending a memory location expression to an already implicit
> expression to avoid having the existing expression act on the memory
> address instead of the value behind it.
>
> The reason for using DW_OP_deref_size and not plain DW_OP_deref is that
> big-endian targets need to read the right size as simply truncating a
> larger read would yield the wrong result (LSB bytes are not at the lower
> address).
>
> Differential Revision: https://reviews.llvm.org/D59687
llvm-svn: 358281
Diffstat (limited to 'llvm/lib/CodeGen/PrologEpilogInserter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/PrologEpilogInserter.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp index 31f962eba42..67834c8c352 100644 --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -1172,22 +1172,12 @@ void PEI::replaceFrameIndices(MachineBasicBlock *BB, MachineFunction &MF, assert(i == 0 && "Frame indices can only appear as the first " "operand of a DBG_VALUE machine instruction"); unsigned Reg; - unsigned FrameIdx = MI.getOperand(0).getIndex(); - unsigned Size = MF.getFrameInfo().getObjectSize(FrameIdx); - int64_t Offset = - TFI->getFrameIndexReference(MF, FrameIdx, Reg); + TFI->getFrameIndexReference(MF, MI.getOperand(0).getIndex(), Reg); MI.getOperand(0).ChangeToRegister(Reg, false /*isDef*/); MI.getOperand(0).setIsDebug(); - - const DIExpression *DIExpr = MI.getDebugExpression(); - // If we already have a Implicit location expression we need to insert - // a deref before prepending a Memory location expression. - if (DIExpr->isImplicit()) { - SmallVector<uint64_t, 2> Ops = {dwarf::DW_OP_deref_size, Size}; - DIExpr = DIExpression::prependOpcodes(DIExpr, Ops, DIExpression::WithStackValue); - } - DIExpr = DIExpression::prepend(DIExpr, DIExpression::NoDeref, Offset); + auto *DIExpr = DIExpression::prepend(MI.getDebugExpression(), + DIExpression::NoDeref, Offset); MI.getOperand(3).setMetadata(DIExpr); continue; } |

