diff options
author | Harald van Dijk <harald.vandijk@codeplay.com> | 2025-02-12 17:38:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-12 17:38:59 +0000 |
commit | 3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6 (patch) | |
tree | 89381a101050af46d7df249b16cd0d2c41885810 /llvm/unittests/Transforms/Utils/CloningTest.cpp | |
parent | f8c7457c79eece1bd1b7f15e7679517c7c63ad89 (diff) | |
download | llvm-3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6.zip llvm-3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6.tar.gz llvm-3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6.tar.bz2 |
[DebugInfo] Update DIBuilder insertion to take InsertPosition (#126059)
After #124287 updated several functions to return iterators rather than
Instruction *, it was no longer straightforward to pass their result to
DIBuilder. This commit updates DIBuilder methods to accept an
InsertPosition instead, so that they can be called with an iterator
(preferred), or with a deprecation warning an Instruction *, or a
BasicBlock *. This commit also updates the existing calls to the
DIBuilder methods to pass in iterators.
Diffstat (limited to 'llvm/unittests/Transforms/Utils/CloningTest.cpp')
-rw-r--r-- | llvm/unittests/Transforms/Utils/CloningTest.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/unittests/Transforms/Utils/CloningTest.cpp b/llvm/unittests/Transforms/Utils/CloningTest.cpp index f2b73c2..03769ff 100644 --- a/llvm/unittests/Transforms/Utils/CloningTest.cpp +++ b/llvm/unittests/Transforms/Utils/CloningTest.cpp @@ -508,7 +508,7 @@ protected: auto *Variable = DBuilder.createAutoVariable(Subprogram, "x", File, 5, IntType, true); auto *DL = DILocation::get(Subprogram->getContext(), 5, 0, Subprogram); - DBuilder.insertDeclare(Alloca, Variable, E, DL, Store); + DBuilder.insertDeclare(Alloca, Variable, E, DL, Store->getIterator()); DBuilder.insertDbgValueIntrinsic(AllocaContent, Variable, E, DL, Entry); // Also create an inlined variable. // Create a distinct struct type that we should not duplicate during @@ -528,7 +528,8 @@ protected: Subprogram->getContext(), 9, 4, Scope, DILocation::get(Subprogram->getContext(), 5, 2, Subprogram)); IBuilder.SetCurrentDebugLocation(InlinedDL); - DBuilder.insertDeclare(Alloca, InlinedVar, E, InlinedDL, Store); + DBuilder.insertDeclare(Alloca, InlinedVar, E, InlinedDL, + Store->getIterator()); IBuilder.CreateStore(IBuilder.getInt32(2), Alloca); // Finalize the debug info. DBuilder.finalize(); |