diff options
author | Florian Mayer <fmayer@google.com> | 2024-03-07 17:28:37 -0800 |
---|---|---|
committer | Florian Mayer <fmayer@google.com> | 2024-03-07 17:42:01 -0800 |
commit | da4957be2365831c94eab0b52612367c29f1d299 (patch) | |
tree | 4ab9df26aa002f6e8ba7704dedf6e07652c6913f | |
parent | 474a73d979bdab8782c17829d72386e0da39eb39 (diff) | |
download | llvm-da4957be2365831c94eab0b52612367c29f1d299.zip llvm-da4957be2365831c94eab0b52612367c29f1d299.tar.gz llvm-da4957be2365831c94eab0b52612367c29f1d299.tar.bz2 |
[NFC] [hwasan] use for_each and move comment
-rw-r--r-- | llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp b/llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp index 2ffe89a..bfe474d 100644 --- a/llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp +++ b/llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp @@ -12,6 +12,7 @@ #include "llvm/Transforms/Utils/MemoryTaggingSupport.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Analysis/CFG.h" #include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/StackSafetyAnalysis.h" @@ -69,14 +70,12 @@ bool forAllReachableExits(const DominatorTree &DT, const PostDominatorTree &PDT, ++NumCoveredExits; } } - // If there's a mix of covered and non-covered exits, just put the untag - // on exits, so we avoid the redundancy of untagging twice. if (NumCoveredExits == ReachableRetVec.size()) { - for (auto *End : Ends) - Callback(End); + for_each(Ends, Callback); } else { - for (auto *RI : ReachableRetVec) - Callback(RI); + // If there's a mix of covered and non-covered exits, just put the untag + // on exits, so we avoid the redundancy of untagging twice. + for_each(ReachableRetVec, Callback); // We may have inserted untag outside of the lifetime interval. // Signal the caller to remove the lifetime end call for this alloca. return false; |