Skip to content

Commit da4957b

Browse files
committed
[NFC] [hwasan] use for_each and move comment
1 parent 474a73d commit da4957b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "llvm/Transforms/Utils/MemoryTaggingSupport.h"
1414

15+
#include "llvm/ADT/STLExtras.h"
1516
#include "llvm/Analysis/CFG.h"
1617
#include "llvm/Analysis/PostDominators.h"
1718
#include "llvm/Analysis/StackSafetyAnalysis.h"
@@ -69,14 +70,12 @@ bool forAllReachableExits(const DominatorTree &DT, const PostDominatorTree &PDT,
6970
++NumCoveredExits;
7071
}
7172
}
72-
// If there's a mix of covered and non-covered exits, just put the untag
73-
// on exits, so we avoid the redundancy of untagging twice.
7473
if (NumCoveredExits == ReachableRetVec.size()) {
75-
for (auto *End : Ends)
76-
Callback(End);
74+
for_each(Ends, Callback);
7775
} else {
78-
for (auto *RI : ReachableRetVec)
79-
Callback(RI);
76+
// If there's a mix of covered and non-covered exits, just put the untag
77+
// on exits, so we avoid the redundancy of untagging twice.
78+
for_each(ReachableRetVec, Callback);
8079
// We may have inserted untag outside of the lifetime interval.
8180
// Signal the caller to remove the lifetime end call for this alloca.
8281
return false;

0 commit comments

Comments
 (0)