diff options
author | Fangrui Song <i@maskray.me> | 2020-12-11 12:45:22 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2020-12-11 12:45:22 -0800 |
commit | b5ad32ef5c68c8c6ebf16f1955ea884421b3750e (patch) | |
tree | a4d0ea4292944cce59fdf5a8d29199722889cbf3 /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | |
parent | 7ea37d2f9449320baf3f3c96f2ea8b2d002a9ceb (diff) | |
download | llvm-b5ad32ef5c68c8c6ebf16f1955ea884421b3750e.zip llvm-b5ad32ef5c68c8c6ebf16f1955ea884421b3750e.tar.gz llvm-b5ad32ef5c68c8c6ebf16f1955ea884421b3750e.tar.bz2 |
Migrate deprecated DebugLoc::get to DILocation::get
This migrates all LLVM (except Kaleidoscope and
CodeGen/StackProtector.cpp) DebugLoc::get to DILocation::get.
The CodeGen/StackProtector.cpp usage may have a nullptr Scope
and can trigger an assertion failure, so I don't migrate it.
Reviewed By: #debug-info, dblaikie
Differential Revision: https://reviews.llvm.org/D93087
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp index 69179d0..e7256a9 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -756,8 +756,9 @@ public: /// just return the builder for it. MachineInstrBuilder emitLoc(Optional<LocIdx> MLoc, const DebugVariable &Var, const DbgValueProperties &Properties) { - DebugLoc DL = - DebugLoc::get(0, 0, Var.getVariable()->getScope(), Var.getInlinedAt()); + DebugLoc DL = DILocation::get(Var.getVariable()->getContext(), 0, 0, + Var.getVariable()->getScope(), + const_cast<DILocation *>(Var.getInlinedAt())); auto MIB = BuildMI(MF, DL, TII.get(TargetOpcode::DBG_VALUE)); const DIExpression *Expr = Properties.DIExpr; @@ -1280,8 +1281,9 @@ public: MachineInstrBuilder emitMOLoc(const MachineOperand &MO, const DebugVariable &Var, const DbgValueProperties &Properties) { - DebugLoc DL = - DebugLoc::get(0, 0, Var.getVariable()->getScope(), Var.getInlinedAt()); + DebugLoc DL = DILocation::get(Var.getVariable()->getContext(), 0, 0, + Var.getVariable()->getScope(), + const_cast<DILocation *>(Var.getInlinedAt())); auto MIB = BuildMI(MF, DL, TII->get(TargetOpcode::DBG_VALUE)); MIB.add(MO); if (Properties.Indirect) |