diff options
author | Artem Pianykh <artem.pyanykh@gmail.com> | 2025-03-16 11:25:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-16 11:25:42 +0000 |
commit | dc9a183ac6aa2d087ceac56970255b06c4772ca3 (patch) | |
tree | cc124bac386abfef40cd8972cf6b6231ca6d5315 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | 926d980017d82dedb9eb50147a82fdfb01659f16 (diff) | |
download | llvm-dc9a183ac6aa2d087ceac56970255b06c4772ca3.zip llvm-dc9a183ac6aa2d087ceac56970255b06c4772ca3.tar.gz llvm-dc9a183ac6aa2d087ceac56970255b06c4772ca3.tar.bz2 |
[NFC][Cloning] Move DebugInfoFinder decl closer to its place of usage (#129154)
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.
Test Plan:
ninja check-llvm-unit
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index cde1ce8..b411d4c 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -266,8 +266,6 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, if (OldFunc->isDeclaration()) return; - DebugInfoFinder DIFinder; - if (Changes < CloneFunctionChangeType::DifferentModule) { assert((NewFunc->getParent() == nullptr || NewFunc->getParent() == OldFunc->getParent()) && @@ -320,7 +318,8 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, Visited.insert(Operand); // Collect and clone all the compile units referenced from the instructions in - // the function (e.g. as a scope). + // the function (e.g. as instructions' scope). + DebugInfoFinder DIFinder; collectDebugInfoFromInstructions(*OldFunc, DIFinder); for (auto *Unit : DIFinder.compile_units()) { MDNode *MappedUnit = |