diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-04-28 18:30:36 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-04-28 18:30:36 +0000 |
commit | 06d6096edc78c6a7aa6ddad2fe81c74d5661e631 (patch) | |
tree | 0d096a0048d9f5049f61e25c226f050d66777e42 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 15a50d34cd517c5f4a14fa4905eb18380659b253 (diff) | |
download | llvm-06d6096edc78c6a7aa6ddad2fe81c74d5661e631.zip llvm-06d6096edc78c6a7aa6ddad2fe81c74d5661e631.tar.gz llvm-06d6096edc78c6a7aa6ddad2fe81c74d5661e631.tar.bz2 |
Cleanup: Use DIExpression::prepend in buildDbgValueForSpill(). (NFC)
llvm-svn: 301665
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 1faf629..d665201 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/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) |