https://github.com/artempyanykh updated https://github.com/llvm/llvm-project/pull/129154
>From cf575ea42b6722ad90131bbb45f1104225a9f75d Mon Sep 17 00:00:00 2001 From: Artem Pianykh <a...@fb.com> Date: Tue, 25 Feb 2025 13:09:23 -0800 Subject: [PATCH] [NFC][Cloning] Move DebugInfoFinder decl closer to its place of usage Summary: This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update. Test Plan: ninja check-llvm-unit stack-info: PR: https://github.com/llvm/llvm-project/pull/129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12 --- llvm/lib/Transforms/Utils/CloneFunction.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index cde1ce8b43dbd..b411d4cb87fd4 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 = _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits