aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/MergeFunctions.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2020-12-11 12:45:22 -0800
committerFangrui Song <i@maskray.me>2020-12-11 12:45:22 -0800
commitb5ad32ef5c68c8c6ebf16f1955ea884421b3750e (patch)
treea4d0ea4292944cce59fdf5a8d29199722889cbf3 /llvm/lib/Transforms/IPO/MergeFunctions.cpp
parent7ea37d2f9449320baf3f3c96f2ea8b2d002a9ceb (diff)
downloadllvm-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/Transforms/IPO/MergeFunctions.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/MergeFunctions.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index 8cc1951..ec5d86b 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
@@ -725,8 +725,10 @@ void MergeFunctions::writeThunk(Function *F, Function *G) {
if (MergeFunctionsPDI) {
DISubprogram *DIS = G->getSubprogram();
if (DIS) {
- DebugLoc CIDbgLoc = DebugLoc::get(DIS->getScopeLine(), 0, DIS);
- DebugLoc RIDbgLoc = DebugLoc::get(DIS->getScopeLine(), 0, DIS);
+ DebugLoc CIDbgLoc =
+ DILocation::get(DIS->getContext(), DIS->getScopeLine(), 0, DIS);
+ DebugLoc RIDbgLoc =
+ DILocation::get(DIS->getContext(), DIS->getScopeLine(), 0, DIS);
CI->setDebugLoc(CIDbgLoc);
RI->setDebugLoc(RIDbgLoc);
} else {