diff --git a/llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp b/llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp index b4f3c5aa79852..cd719f2101679 100644 --- a/llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp +++ b/llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp @@ -377,8 +377,7 @@ Error linkDebugInfoImpl(object::ObjectFile &File, const Options &Options, if (Options.AccelTableKind == DwarfUtilAccelKind::None) AccelTableNamesToDelete.push_back(Sec.Name); - else if (std::find(AccelTables.begin(), AccelTables.end(), - *SrcAccelTableKind) == AccelTables.end()) + else if (!llvm::is_contained(AccelTables, *SrcAccelTableKind)) AccelTableNamesToReplace.push_back(Sec.Name); } else if (!knownByDWARFUtil(Sec.Name)) { assert(!SrcAccelTableKind); diff --git a/llvm/tools/llvm-profgen/MissingFrameInferrer.cpp b/llvm/tools/llvm-profgen/MissingFrameInferrer.cpp index 4127fdc54bd18..ee49950f39ca4 100644 --- a/llvm/tools/llvm-profgen/MissingFrameInferrer.cpp +++ b/llvm/tools/llvm-profgen/MissingFrameInferrer.cpp @@ -242,10 +242,8 @@ bool MissingFrameInferrer::inferMissingFrames( // Done with the inference if the calle is reachable via a single callsite. // This may not be accurate but it improves the search throughput. - for (auto Target : CallEdgesF[From]) { - if (Target == ToFRange->Func) - return true; - } + if (llvm::is_contained(CallEdgesF[From], ToFRange->Func)) + return true; // Bail out if callee is not tailcall reachable at all. if (!TailCallTargetFuncs.contains(ToFRange->Func))