diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp --- a/bolt/lib/Core/BinaryFunction.cpp +++ b/bolt/lib/Core/BinaryFunction.cpp @@ -992,7 +992,7 @@ if (!Islands) return 0; - if (Islands->DataOffsets.find(Offset) == Islands->DataOffsets.end()) + if (!llvm::is_contained(Islands->DataOffsets, Offset)) return 0; auto Iter = Islands->CodeOffsets.upper_bound(Offset); diff --git a/bolt/lib/Passes/FrameAnalysis.cpp b/bolt/lib/Passes/FrameAnalysis.cpp --- a/bolt/lib/Passes/FrameAnalysis.cpp +++ b/bolt/lib/Passes/FrameAnalysis.cpp @@ -352,7 +352,7 @@ // offset specially after an epilogue, where tailcalls happen. It should be // -8. for (std::pair Elem : Iter->second) { - if (ArgsTouchedMap[&BF].find(Elem) == ArgsTouchedMap[&BF].end()) { + if (!llvm::is_contained(ArgsTouchedMap[&BF], Elem)) { ArgsTouchedMap[&BF].emplace(Elem); Changed = true; } diff --git a/bolt/lib/Passes/Instrumentation.cpp b/bolt/lib/Passes/Instrumentation.cpp --- a/bolt/lib/Passes/Instrumentation.cpp +++ b/bolt/lib/Passes/Instrumentation.cpp @@ -343,7 +343,7 @@ const BinaryBasicBlock *Pred; std::tie(Pred, BB) = Stack.top(); Stack.pop(); - if (VisitedSet.find(BB) != VisitedSet.end()) + if (llvm::is_contained(VisitedSet, BB)) continue; VisitedSet.insert(BB); @@ -411,7 +411,7 @@ } if (TargetFunc) { // Do not instrument edges in the spanning tree - if (STOutSet[&BB].find(TargetBB) != STOutSet[&BB].end()) { + if (llvm::is_contained(STOutSet[&BB], TargetBB)) { auto L = BC.scopeLock(); createEdgeDescription(*FuncDesc, Function, FromOffset, BBToID[&BB], Function, ToOffset, BBToID[TargetBB], @@ -428,7 +428,7 @@ if (IsJumpTable) { for (BinaryBasicBlock *&Succ : BB.successors()) { // Do not instrument edges in the spanning tree - if (STOutSet[&BB].find(&*Succ) != STOutSet[&BB].end()) { + if (llvm::is_contained(STOutSet[&BB], &*Succ)) { auto L = BC.scopeLock(); createEdgeDescription(*FuncDesc, Function, FromOffset, BBToID[&BB], Function, Succ->getInputOffset(), @@ -471,7 +471,7 @@ FromOffset = *BC.MIB->getOffset(*LastInstr); // Do not instrument edges in the spanning tree - if (STOutSet[&BB].find(FTBB) != STOutSet[&BB].end()) { + if (llvm::is_contained(STOutSet[&BB], FTBB)) { auto L = BC.scopeLock(); createEdgeDescription(*FuncDesc, Function, FromOffset, BBToID[&BB], Function, FTBB->getInputOffset(), BBToID[FTBB],