aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorHarald van Dijk <harald.vandijk@codeplay.com>2024-05-08 17:02:25 +0100
committerGitHub <noreply@github.com>2024-05-08 17:02:25 +0100
commita6171900a446c85c3b53a4a9deba16b746f9f77f (patch)
treea4c708cfd36f3439d840b6d23d7bb8b4a1fad7d8 /llvm/lib/Transforms/Utils/CloneFunction.cpp
parent2ceb1291ef3ddb87cb58030cd61d965f4030338f (diff)
downloadllvm-a6171900a446c85c3b53a4a9deba16b746f9f77f.zip
llvm-a6171900a446c85c3b53a4a9deba16b746f9f77f.tar.gz
llvm-a6171900a446c85c3b53a4a9deba16b746f9f77f.tar.bz2
[RemoveDIs] Change remapDbgVariableRecord to remapDbgRecord (#91456)
We need to remap any DbgRecord, not just DbgVariableRecords. This is the followup to #91447. Co-authored-by: PietroGhg <pietro.ghiglio@codeplay.com>
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 6a3b3fa..9811836 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -278,8 +278,8 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
// attached debug-info records.
for (Instruction &II : *BB) {
RemapInstruction(&II, VMap, RemapFlag, TypeMapper, Materializer);
- RemapDbgVariableRecordRange(II.getModule(), II.getDbgRecordRange(), VMap,
- RemapFlag, TypeMapper, Materializer);
+ RemapDbgRecordRange(II.getModule(), II.getDbgRecordRange(), VMap,
+ RemapFlag, TypeMapper, Materializer);
}
// Only update !llvm.dbg.cu for DifferentModule (not CloneModule). In the
@@ -867,10 +867,10 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
Function::iterator Begin = cast<BasicBlock>(VMap[StartingBB])->getIterator();
for (BasicBlock &BB : make_range(Begin, NewFunc->end())) {
for (Instruction &I : BB) {
- RemapDbgVariableRecordRange(I.getModule(), I.getDbgRecordRange(), VMap,
- ModuleLevelChanges ? RF_None
- : RF_NoModuleLevelChanges,
- TypeMapper, Materializer);
+ RemapDbgRecordRange(I.getModule(), I.getDbgRecordRange(), VMap,
+ ModuleLevelChanges ? RF_None
+ : RF_NoModuleLevelChanges,
+ TypeMapper, Materializer);
}
}
@@ -969,9 +969,8 @@ void llvm::remapInstructionsInBlocks(ArrayRef<BasicBlock *> Blocks,
// Rewrite the code to refer to itself.
for (auto *BB : Blocks) {
for (auto &Inst : *BB) {
- RemapDbgVariableRecordRange(
- Inst.getModule(), Inst.getDbgRecordRange(), VMap,
- RF_NoModuleLevelChanges | RF_IgnoreMissingLocals);
+ RemapDbgRecordRange(Inst.getModule(), Inst.getDbgRecordRange(), VMap,
+ RF_NoModuleLevelChanges | RF_IgnoreMissingLocals);
RemapInstruction(&Inst, VMap,
RF_NoModuleLevelChanges | RF_IgnoreMissingLocals);
}