Skip to content

Commit b4db726

Browse files
[LLVM][rtsan] Use convenient instructions iterator
1 parent bc0f8ed commit b4db726

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Instrumentation/RealtimeSanitizer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "llvm/IR/Analysis.h"
1717
#include "llvm/IR/IRBuilder.h"
18+
#include "llvm/IR/InstIterator.h"
1819
#include "llvm/IR/Module.h"
1920

2021
#include "llvm/Demangle/Demangle.h"
@@ -51,10 +52,9 @@ static void insertCallAtFunctionEntryPoint(Function &Fn,
5152
static void insertCallAtAllFunctionExitPoints(Function &Fn,
5253
const char *InsertFnName,
5354
ArrayRef<Value *> FunctionArgs) {
54-
for (auto &BB : Fn)
55-
for (auto &I : BB)
56-
if (isa<ReturnInst>(&I))
57-
insertCallBeforeInstruction(Fn, I, InsertFnName, FunctionArgs);
55+
for (auto &I : instructions(Fn))
56+
if (isa<ReturnInst>(&I))
57+
insertCallBeforeInstruction(Fn, I, InsertFnName, FunctionArgs);
5858
}
5959

6060
static PreservedAnalyses rtsanPreservedCFGAnalyses() {

0 commit comments

Comments
 (0)