Skip to content

Commit 3742275

Browse files
committed
track handled blocks2
1 parent fb5a4b3 commit 3742275

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Transforms/Utils/CFFunctionInstrumentation.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ CFFunctionInstrumentationPass::run(Module &M, ModuleAnalysisManager &AM) {
4040
// store already handled blocks
4141
std::set<BasicBlock *> HandledBlocks;
4242
for (auto &BB : F) {
43+
if (HandledBlocks.count(&BB)) {
44+
continue;
45+
}
4346
// Do NOT reinstrument the inserted blocks
4447
if (BB.getName() == "return" || BB.getName() == "print" ||
4548
BB.getName() == "open") {
@@ -120,6 +123,10 @@ CFFunctionInstrumentationPass::run(Module &M, ModuleAnalysisManager &AM) {
120123

121124
// place new BBs in the correct order
122125
ReturnBB->moveAfter(PrintBB);
126+
127+
HandledBlocks.insert(AccessBB);
128+
HandledBlocks.insert(PrintBB);
129+
HandledBlocks.insert(ReturnBB);
123130
}
124131
}
125132
HandledBlocks.insert(&BB);

0 commit comments

Comments
 (0)