aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2024-08-09 10:17:48 +0100
committerGitHub <noreply@github.com>2024-08-09 10:17:48 +0100
commit92aec5192ce752c984837a93227200b54faa8679 (patch)
treee11cdafd28a93b2e1979fc61baf87427cc3d00a9 /clang/lib/CodeGen/CodeGenModule.cpp
parentcdadc2eb9ed50a811d45b1db64473dd321ef72ee (diff)
downloadllvm-92aec5192ce752c984837a93227200b54faa8679.zip
llvm-92aec5192ce752c984837a93227200b54faa8679.tar.gz
llvm-92aec5192ce752c984837a93227200b54faa8679.tar.bz2
[DebugInfo][RemoveDIs] Use iterator-inserters in clang (#102006)
As part of the LLVM effort to eliminate debug-info intrinsics, we're moving to a world where only iterators should be used to insert instructions. This isn't a problem in clang when instructions get generated before any debug-info is inserted, however we're planning on deprecating and removing the instruction-pointer insertion routines. Scatter some calls to getIterator in a few places, remove a deref-then-addrof on another iterator, and add an overload for the createLoadInstBefore utility. Some callers passes a null insertion point, which we need to handle explicitly now.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 9aaf90c..6d11bd1 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -5911,13 +5911,13 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old,
llvm::CallBase *newCall;
if (isa<llvm::CallInst>(callSite)) {
- newCall =
- llvm::CallInst::Create(newFn, newArgs, newBundles, "", callSite);
+ newCall = llvm::CallInst::Create(newFn, newArgs, newBundles, "",
+ callSite->getIterator());
} else {
auto *oldInvoke = cast<llvm::InvokeInst>(callSite);
- newCall = llvm::InvokeInst::Create(newFn, oldInvoke->getNormalDest(),
- oldInvoke->getUnwindDest(), newArgs,
- newBundles, "", callSite);
+ newCall = llvm::InvokeInst::Create(
+ newFn, oldInvoke->getNormalDest(), oldInvoke->getUnwindDest(),
+ newArgs, newBundles, "", callSite->getIterator());
}
newArgs.clear(); // for the next iteration