Skip to content

Commit b600fb4

Browse files
committed
fixup! [Utils] Extract ProcessSubprogramAttachment from CloneFunctionInto
1 parent a415938 commit b600fb4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/Transforms/Utils/CloneFunction.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "llvm/IR/DebugInfo.h"
2424
#include "llvm/IR/DerivedTypes.h"
2525
#include "llvm/IR/Function.h"
26+
#include "llvm/IR/InstIterator.h"
2627
#include "llvm/IR/Instructions.h"
2728
#include "llvm/IR/IntrinsicInst.h"
2829
#include "llvm/IR/LLVMContext.h"
@@ -149,11 +150,8 @@ DISubprogram *llvm::ProcessSubprogramAttachment(const Function &F,
149150
const Module *M = F.getParent();
150151
if (Changes != CloneFunctionChangeType::ClonedModule && M) {
151152
// Inspect instructions to process e.g. DILexicalBlocks of inlined functions
152-
for (const auto &BB : F) {
153-
for (const auto &I : BB) {
154-
DIFinder.processInstruction(*M, I);
155-
}
156-
}
153+
for (const auto &I : instructions(F))
154+
DIFinder.processInstruction(*M, I);
157155
}
158156

159157
return SPClonedWithinModule;

0 commit comments

Comments
 (0)