diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-02 18:30:13 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-02 18:30:13 +0000 |
commit | a303c417bbdb53703c2c17398b08486bde78f1f6 (patch) | |
tree | 98366d6b93d863cefdc53f16c66c0c5ae7fb2261 /lib/CodeGen/MachineInstr.cpp | |
parent | 12f3ca4cdb95b193af905a00e722a4dcb40b3de3 (diff) |
Notes
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 1faf6292a9c1..d665201a5d17 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -2350,7 +2350,7 @@ MachineInstr *llvm::buildDbgValueForSpill(MachineBasicBlock &BB, const MachineInstr &Orig, int FrameIndex) { const MDNode *Var = Orig.getDebugVariable(); - auto *Expr = cast_or_null<DIExpression>(Orig.getDebugExpression()); + const auto *Expr = cast_or_null<DIExpression>(Orig.getDebugExpression()); bool IsIndirect = Orig.isIndirectDebugValue(); uint64_t Offset = IsIndirect ? Orig.getOperand(1).getImm() : 0; DebugLoc DL = Orig.getDebugLoc(); @@ -2359,13 +2359,8 @@ MachineInstr *llvm::buildDbgValueForSpill(MachineBasicBlock &BB, // If the DBG_VALUE already was a memory location, add an extra // DW_OP_deref. Otherwise just turning this from a register into a // memory/indirect location is sufficient. - if (IsIndirect) { - SmallVector<uint64_t, 8> Ops; - Ops.push_back(dwarf::DW_OP_deref); - if (Expr) - Ops.append(Expr->elements_begin(), Expr->elements_end()); - Expr = DIExpression::get(Expr->getContext(), Ops); - } + if (IsIndirect) + Expr = DIExpression::prepend(Expr, DIExpression::WithDeref); return BuildMI(BB, I, DL, Orig.getDesc()) .addFrameIndex(FrameIndex) .addImm(Offset) |