Skip to content

Commit 279d028

Browse files
committed
[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: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
1 parent e2e5b39 commit 279d028

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Utils/CloneFunction.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,6 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
266266
if (OldFunc->isDeclaration())
267267
return;
268268

269-
DebugInfoFinder DIFinder;
270-
271269
if (Changes < CloneFunctionChangeType::DifferentModule) {
272270
assert((NewFunc->getParent() == nullptr ||
273271
NewFunc->getParent() == OldFunc->getParent()) &&
@@ -320,7 +318,8 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
320318
Visited.insert(Operand);
321319

322320
// Collect and clone all the compile units referenced from the instructions in
323-
// the function (e.g. as a scope).
321+
// the function (e.g. as instructions' scope).
322+
DebugInfoFinder DIFinder;
324323
collectDebugInfoFromInstructions(*OldFunc, DIFinder);
325324
for (auto *Unit : DIFinder.compile_units()) {
326325
MDNode *MappedUnit =

0 commit comments

Comments
 (0)