forked from OSchip/llvm-project
Range-style std::find{,_if} -> llvm::find{,_if}. NFC
llvm-svn: 357359
This commit is contained in:
parent
eaf4484e94
commit
75e74e077c
clang
include/clang
lib
ARCMigrate
AST
Basic/Targets
Driver
Edit
Frontend
Index
Lex
Sema
Serialization
StaticAnalyzer
tools
unittests
|
@ -113,12 +113,11 @@ public:
|
|||
}
|
||||
|
||||
DeclsTy &Vec = *getAsVector();
|
||||
DeclsTy::iterator I = std::find(Vec.begin(), Vec.end(), D);
|
||||
DeclsTy::iterator I = llvm::find(Vec, D);
|
||||
assert(I != Vec.end() && "list does not contain decl");
|
||||
Vec.erase(I);
|
||||
|
||||
assert(std::find(Vec.begin(), Vec.end(), D)
|
||||
== Vec.end() && "list still contains decl");
|
||||
assert(llvm::find(Vec, D) == Vec.end() && "list still contains decl");
|
||||
}
|
||||
|
||||
/// Remove any declarations which were imported from an external
|
||||
|
|
|
@ -1604,7 +1604,7 @@ public:
|
|||
|
||||
/// Return the index of BB, or Predecessors.size if BB is not a predecessor.
|
||||
unsigned findPredecessorIndex(const BasicBlock *BB) const {
|
||||
auto I = std::find(Predecessors.cbegin(), Predecessors.cend(), BB);
|
||||
auto I = llvm::find(Predecessors, BB);
|
||||
return std::distance(Predecessors.cbegin(), I);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,10 +64,10 @@ bool CapturedDiagList::hasDiagnostic(ArrayRef<unsigned> IDs,
|
|||
while (I != List.end()) {
|
||||
FullSourceLoc diagLoc = I->getLocation();
|
||||
if ((IDs.empty() || // empty means any diagnostic in the range.
|
||||
std::find(IDs.begin(), IDs.end(), I->getID()) != IDs.end()) &&
|
||||
llvm::find(IDs, I->getID()) != IDs.end()) &&
|
||||
!diagLoc.isBeforeInTranslationUnitThan(range.getBegin()) &&
|
||||
(diagLoc == range.getEnd() ||
|
||||
diagLoc.isBeforeInTranslationUnitThan(range.getEnd()))) {
|
||||
diagLoc.isBeforeInTranslationUnitThan(range.getEnd()))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -554,8 +554,7 @@ void OverridingMethods::add(unsigned OverriddenSubobject,
|
|||
UniqueVirtualMethod Overriding) {
|
||||
SmallVectorImpl<UniqueVirtualMethod> &SubobjectOverrides
|
||||
= Overrides[OverriddenSubobject];
|
||||
if (std::find(SubobjectOverrides.begin(), SubobjectOverrides.end(),
|
||||
Overriding) == SubobjectOverrides.end())
|
||||
if (llvm::find(SubobjectOverrides, Overriding) == SubobjectOverrides.end())
|
||||
SubobjectOverrides.push_back(Overriding);
|
||||
}
|
||||
|
||||
|
|
|
@ -1596,8 +1596,8 @@ void CXXRecordDecl::removeConversion(const NamedDecl *ConvDecl) {
|
|||
for (unsigned I = 0, E = Convs.size(); I != E; ++I) {
|
||||
if (Convs[I].getDecl() == ConvDecl) {
|
||||
Convs.erase(I);
|
||||
assert(std::find(Convs.begin(), Convs.end(), ConvDecl) == Convs.end()
|
||||
&& "conversion was found multiple times in unresolved set");
|
||||
assert(llvm::find(Convs, ConvDecl) == Convs.end() &&
|
||||
"conversion was found multiple times in unresolved set");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1268,8 +1268,7 @@ void MicrosoftCXXNameMangler::mangleOperatorName(OverloadedOperatorKind OO,
|
|||
|
||||
void MicrosoftCXXNameMangler::mangleSourceName(StringRef Name) {
|
||||
// <source name> ::= <identifier> @
|
||||
BackRefVec::iterator Found =
|
||||
std::find(NameBackReferences.begin(), NameBackReferences.end(), Name);
|
||||
BackRefVec::iterator Found = llvm::find(NameBackReferences, Name);
|
||||
if (Found == NameBackReferences.end()) {
|
||||
if (NameBackReferences.size() < 10)
|
||||
NameBackReferences.push_back(Name);
|
||||
|
@ -3462,8 +3461,7 @@ void MicrosoftMangleContextImpl::mangleStringLiteral(const StringLiteral *SL,
|
|||
} else {
|
||||
const char SpecialChars[] = {',', '/', '\\', ':', '.',
|
||||
' ', '\n', '\t', '\'', '-'};
|
||||
const char *Pos =
|
||||
std::find(std::begin(SpecialChars), std::end(SpecialChars), Byte);
|
||||
const char *Pos = llvm::find(SpecialChars, Byte);
|
||||
if (Pos != std::end(SpecialChars)) {
|
||||
Mangler.getStream() << '?' << (Pos - std::begin(SpecialChars));
|
||||
} else {
|
||||
|
|
|
@ -238,7 +238,7 @@ EmptySubobjectMap::CanPlaceSubobjectAtOffset(const CXXRecordDecl *RD,
|
|||
return true;
|
||||
|
||||
const ClassVectorTy &Classes = I->second;
|
||||
if (std::find(Classes.begin(), Classes.end(), RD) == Classes.end())
|
||||
if (llvm::find(Classes, RD) == Classes.end())
|
||||
return true;
|
||||
|
||||
// There is already an empty class of the same type at this offset.
|
||||
|
|
|
@ -1062,8 +1062,7 @@ void ItaniumVTableBuilder::AddThunk(const CXXMethodDecl *MD,
|
|||
SmallVectorImpl<ThunkInfo> &ThunksVector = Thunks[MD];
|
||||
|
||||
// Check if we have this thunk already.
|
||||
if (std::find(ThunksVector.begin(), ThunksVector.end(), Thunk) !=
|
||||
ThunksVector.end())
|
||||
if (llvm::find(ThunksVector, Thunk) != ThunksVector.end())
|
||||
return;
|
||||
|
||||
ThunksVector.push_back(Thunk);
|
||||
|
@ -2452,8 +2451,7 @@ private:
|
|||
SmallVector<ThunkInfo, 1> &ThunksVector = Thunks[MD];
|
||||
|
||||
// Check if we have this thunk already.
|
||||
if (std::find(ThunksVector.begin(), ThunksVector.end(), Thunk) !=
|
||||
ThunksVector.end())
|
||||
if (llvm::find(ThunksVector, Thunk) != ThunksVector.end())
|
||||
return;
|
||||
|
||||
ThunksVector.push_back(Thunk);
|
||||
|
|
|
@ -476,7 +476,7 @@ bool ARMTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
|
|||
Features.push_back("-neonfp");
|
||||
|
||||
// Remove front-end specific options which the backend handles differently.
|
||||
auto Feature = std::find(Features.begin(), Features.end(), "+soft-float-abi");
|
||||
auto Feature = llvm::find(Features, "+soft-float-abi");
|
||||
if (Feature != Features.end())
|
||||
Features.erase(Feature);
|
||||
|
||||
|
|
|
@ -214,31 +214,26 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
|
|||
static bool ppcUserFeaturesCheck(DiagnosticsEngine &Diags,
|
||||
const std::vector<std::string> &FeaturesVec) {
|
||||
|
||||
if (std::find(FeaturesVec.begin(), FeaturesVec.end(), "-vsx") !=
|
||||
FeaturesVec.end()) {
|
||||
if (std::find(FeaturesVec.begin(), FeaturesVec.end(), "+power8-vector") !=
|
||||
FeaturesVec.end()) {
|
||||
if (llvm::find(FeaturesVec, "-vsx") != FeaturesVec.end()) {
|
||||
if (llvm::find(FeaturesVec, "+power8-vector") != FeaturesVec.end()) {
|
||||
Diags.Report(diag::err_opt_not_valid_with_opt) << "-mpower8-vector"
|
||||
<< "-mno-vsx";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (std::find(FeaturesVec.begin(), FeaturesVec.end(), "+direct-move") !=
|
||||
FeaturesVec.end()) {
|
||||
if (llvm::find(FeaturesVec, "+direct-move") != FeaturesVec.end()) {
|
||||
Diags.Report(diag::err_opt_not_valid_with_opt) << "-mdirect-move"
|
||||
<< "-mno-vsx";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (std::find(FeaturesVec.begin(), FeaturesVec.end(), "+float128") !=
|
||||
FeaturesVec.end()) {
|
||||
if (llvm::find(FeaturesVec, "+float128") != FeaturesVec.end()) {
|
||||
Diags.Report(diag::err_opt_not_valid_with_opt) << "-mfloat128"
|
||||
<< "-mno-vsx";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (std::find(FeaturesVec.begin(), FeaturesVec.end(), "+power9-vector") !=
|
||||
FeaturesVec.end()) {
|
||||
if (llvm::find(FeaturesVec, "+power9-vector") != FeaturesVec.end()) {
|
||||
Diags.Report(diag::err_opt_not_valid_with_opt) << "-mpower9-vector"
|
||||
<< "-mno-vsx";
|
||||
return false;
|
||||
|
@ -311,8 +306,7 @@ bool PPCTargetInfo::initFeatureMap(
|
|||
return false;
|
||||
|
||||
if (!(ArchDefs & ArchDefinePwr9) && (ArchDefs & ArchDefinePpcgr) &&
|
||||
std::find(FeaturesVec.begin(), FeaturesVec.end(), "+float128") !=
|
||||
FeaturesVec.end()) {
|
||||
llvm::find(FeaturesVec, "+float128") != FeaturesVec.end()) {
|
||||
// We have __float128 on PPC but not power 9 and above.
|
||||
Diags.Report(diag::err_opt_not_valid_with_opt) << "-mfloat128" << CPU;
|
||||
return false;
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
bool handleTargetFeatures(std::vector<std::string> &Features,
|
||||
DiagnosticsEngine &Diags) override {
|
||||
// Check if software floating point is enabled
|
||||
auto Feature = std::find(Features.begin(), Features.end(), "+soft-float");
|
||||
auto Feature = llvm::find(Features, "+soft-float");
|
||||
if (Feature != Features.end()) {
|
||||
SoftFloat = true;
|
||||
}
|
||||
|
|
|
@ -427,23 +427,20 @@ bool X86TargetInfo::initFeatureMap(
|
|||
// Enable popcnt if sse4.2 is enabled and popcnt is not explicitly disabled.
|
||||
auto I = Features.find("sse4.2");
|
||||
if (I != Features.end() && I->getValue() &&
|
||||
std::find(FeaturesVec.begin(), FeaturesVec.end(), "-popcnt") ==
|
||||
FeaturesVec.end())
|
||||
llvm::find(FeaturesVec, "-popcnt") == FeaturesVec.end())
|
||||
Features["popcnt"] = true;
|
||||
|
||||
// Enable prfchw if 3DNow! is enabled and prfchw is not explicitly disabled.
|
||||
I = Features.find("3dnow");
|
||||
if (I != Features.end() && I->getValue() &&
|
||||
std::find(FeaturesVec.begin(), FeaturesVec.end(), "-prfchw") ==
|
||||
FeaturesVec.end())
|
||||
llvm::find(FeaturesVec, "-prfchw") == FeaturesVec.end())
|
||||
Features["prfchw"] = true;
|
||||
|
||||
// Additionally, if SSE is enabled and mmx is not explicitly disabled,
|
||||
// then enable MMX.
|
||||
I = Features.find("sse");
|
||||
if (I != Features.end() && I->getValue() &&
|
||||
std::find(FeaturesVec.begin(), FeaturesVec.end(), "-mmx") ==
|
||||
FeaturesVec.end())
|
||||
llvm::find(FeaturesVec, "-mmx") == FeaturesVec.end())
|
||||
Features["mmx"] = true;
|
||||
|
||||
return true;
|
||||
|
|
|
@ -250,8 +250,8 @@ void Command::Print(raw_ostream &OS, const char *Terminator, bool Quote,
|
|||
}
|
||||
}
|
||||
|
||||
auto Found = std::find_if(InputFilenames.begin(), InputFilenames.end(),
|
||||
[&Arg](StringRef IF) { return IF == Arg; });
|
||||
auto Found = llvm::find_if(InputFilenames,
|
||||
[&Arg](StringRef IF) { return IF == Arg; });
|
||||
if (Found != InputFilenames.end() &&
|
||||
(i == 0 || StringRef(Args[i - 1]) != "-main-file-name")) {
|
||||
// Replace the input file name with the crashinfo's file name.
|
||||
|
|
|
@ -3682,9 +3682,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
options::OPT_mllvm,
|
||||
};
|
||||
for (const auto &A : Args)
|
||||
if (std::find(std::begin(kBitcodeOptionBlacklist),
|
||||
std::end(kBitcodeOptionBlacklist),
|
||||
A->getOption().getID()) !=
|
||||
if (llvm::find(kBitcodeOptionBlacklist, A->getOption().getID()) !=
|
||||
std::end(kBitcodeOptionBlacklist))
|
||||
D.Diag(diag::err_drv_unsupported_embed_bitcode) << A->getSpelling();
|
||||
|
||||
|
|
|
@ -430,7 +430,7 @@ void HexagonToolChain::getHexagonLibraryPaths(const ArgList &Args,
|
|||
|
||||
std::string TargetDir = getHexagonTargetDir(D.getInstalledDir(),
|
||||
D.PrefixDirs);
|
||||
if (std::find(RootDirs.begin(), RootDirs.end(), TargetDir) == RootDirs.end())
|
||||
if (llvm::find(RootDirs, TargetDir) == RootDirs.end())
|
||||
RootDirs.push_back(TargetDir);
|
||||
|
||||
bool HasPIC = Args.hasArg(options::OPT_fpic, options::OPT_fPIC);
|
||||
|
|
|
@ -60,7 +60,7 @@ void EditedSource::finishedCommit() {
|
|||
MacroArgUse ArgUse;
|
||||
std::tie(ExpLoc, ArgUse) = ExpArg;
|
||||
auto &ArgUses = ExpansionToArgMap[ExpLoc.getRawEncoding()];
|
||||
if (std::find(ArgUses.begin(), ArgUses.end(), ArgUse) == ArgUses.end())
|
||||
if (llvm::find(ArgUses, ArgUse) == ArgUses.end())
|
||||
ArgUses.push_back(ArgUse);
|
||||
}
|
||||
CurrCommitMacroArgExps.clear();
|
||||
|
|
|
@ -1413,9 +1413,9 @@ static bool checkVerifyPrefixes(const std::vector<std::string> &VerifyPrefixes,
|
|||
for (const auto &Prefix : VerifyPrefixes) {
|
||||
// Every prefix must start with a letter and contain only alphanumeric
|
||||
// characters, hyphens, and underscores.
|
||||
auto BadChar = std::find_if(Prefix.begin(), Prefix.end(),
|
||||
[](char C){return !isAlphanumeric(C)
|
||||
&& C != '-' && C != '_';});
|
||||
auto BadChar = llvm::find_if(Prefix, [](char C) {
|
||||
return !isAlphanumeric(C) && C != '-' && C != '_';
|
||||
});
|
||||
if (BadChar != Prefix.end() || !isLetter(Prefix[0])) {
|
||||
Success = false;
|
||||
if (Diags) {
|
||||
|
|
|
@ -333,8 +333,7 @@ static void selectInterestingSourceRegion(std::string &SourceLine,
|
|||
|
||||
// No special characters are allowed in CaretLine.
|
||||
assert(CaretLine.end() ==
|
||||
std::find_if(CaretLine.begin(), CaretLine.end(),
|
||||
[](char c) { return c < ' ' || '~' < c; }));
|
||||
llvm::find_if(CaretLine, [](char c) { return c < ' ' || '~' < c; }));
|
||||
|
||||
// Find the slice that we need to display the full caret line
|
||||
// correctly.
|
||||
|
|
|
@ -411,10 +411,9 @@ bool IndexingContext::handleDeclOccurrence(const Decl *D, SourceLocation Loc,
|
|||
FinalRelations.reserve(Relations.size()+1);
|
||||
|
||||
auto addRelation = [&](SymbolRelation Rel) {
|
||||
auto It = std::find_if(FinalRelations.begin(), FinalRelations.end(),
|
||||
[&](SymbolRelation Elem)->bool {
|
||||
return Elem.RelatedSymbol == Rel.RelatedSymbol;
|
||||
});
|
||||
auto It = llvm::find_if(FinalRelations, [&](SymbolRelation Elem) -> bool {
|
||||
return Elem.RelatedSymbol == Rel.RelatedSymbol;
|
||||
});
|
||||
if (It != FinalRelations.end()) {
|
||||
It->Roles |= Rel.Roles;
|
||||
} else {
|
||||
|
|
|
@ -2210,8 +2210,7 @@ bool Preprocessor::ReadMacroParameterList(MacroInfo *MI, Token &Tok) {
|
|||
|
||||
// If this is already used as a parameter, it is used multiple times (e.g.
|
||||
// #define X(A,A.
|
||||
if (std::find(Parameters.begin(), Parameters.end(), II) !=
|
||||
Parameters.end()) { // C99 6.10.3p6
|
||||
if (llvm::find(Parameters, II) != Parameters.end()) { // C99 6.10.3p6
|
||||
Diag(Tok, diag::err_pp_duplicate_name_in_arg_list) << II;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1132,14 +1132,14 @@ bool Preprocessor::parseSimpleIntegerLiteral(Token &Tok, uint64_t &Value) {
|
|||
|
||||
void Preprocessor::addCommentHandler(CommentHandler *Handler) {
|
||||
assert(Handler && "NULL comment handler");
|
||||
assert(std::find(CommentHandlers.begin(), CommentHandlers.end(), Handler) ==
|
||||
CommentHandlers.end() && "Comment handler already registered");
|
||||
assert(llvm::find(CommentHandlers, Handler) == CommentHandlers.end() &&
|
||||
"Comment handler already registered");
|
||||
CommentHandlers.push_back(Handler);
|
||||
}
|
||||
|
||||
void Preprocessor::removeCommentHandler(CommentHandler *Handler) {
|
||||
std::vector<CommentHandler *>::iterator Pos =
|
||||
std::find(CommentHandlers.begin(), CommentHandlers.end(), Handler);
|
||||
llvm::find(CommentHandlers, Handler);
|
||||
assert(Pos != CommentHandlers.end() && "Comment handler not registered");
|
||||
CommentHandlers.erase(Pos);
|
||||
}
|
||||
|
|
|
@ -126,8 +126,7 @@ struct EffectiveContext {
|
|||
|
||||
bool includesClass(const CXXRecordDecl *R) const {
|
||||
R = R->getCanonicalDecl();
|
||||
return std::find(Records.begin(), Records.end(), R)
|
||||
!= Records.end();
|
||||
return llvm::find(Records, R) != Records.end();
|
||||
}
|
||||
|
||||
/// Retrieves the innermost "useful" context. Can be null if we're
|
||||
|
|
|
@ -13923,8 +13923,7 @@ void Sema::DiscardMisalignedMemberAddress(const Type *T, Expr *E) {
|
|||
cast<UnaryOperator>(E)->getOpcode() == UO_AddrOf) {
|
||||
auto *Op = cast<UnaryOperator>(E)->getSubExpr()->IgnoreParens();
|
||||
if (isa<MemberExpr>(Op)) {
|
||||
auto MA = std::find(MisalignedMembers.begin(), MisalignedMembers.end(),
|
||||
MisalignedMember(Op));
|
||||
auto MA = llvm::find(MisalignedMembers, MisalignedMember(Op));
|
||||
if (MA != MisalignedMembers.end() &&
|
||||
(T->isIntegerType() ||
|
||||
(T->isPointerType() && (T->getPointeeType()->isIncompleteType() ||
|
||||
|
|
|
@ -8084,8 +8084,7 @@ static bool isOpenCLSizeDependentType(ASTContext &C, QualType Ty) {
|
|||
QualType DesugaredTy = Ty;
|
||||
do {
|
||||
ArrayRef<StringRef> Names(SizeTypeNames);
|
||||
auto Match =
|
||||
std::find(Names.begin(), Names.end(), DesugaredTy.getAsString());
|
||||
auto Match = llvm::find(Names, DesugaredTy.getAsString());
|
||||
if (Names.end() != Match)
|
||||
return true;
|
||||
|
||||
|
|
|
@ -16975,10 +16975,9 @@ ExprResult Sema::ActOnObjCAvailabilityCheckExpr(
|
|||
|
||||
StringRef Platform = getASTContext().getTargetInfo().getPlatformName();
|
||||
|
||||
auto Spec = std::find_if(AvailSpecs.begin(), AvailSpecs.end(),
|
||||
[&](const AvailabilitySpec &Spec) {
|
||||
return Spec.getPlatform() == Platform;
|
||||
});
|
||||
auto Spec = llvm::find_if(AvailSpecs, [&](const AvailabilitySpec &Spec) {
|
||||
return Spec.getPlatform() == Platform;
|
||||
});
|
||||
|
||||
VersionTuple Version;
|
||||
if (Spec != AvailSpecs.end())
|
||||
|
|
|
@ -4338,9 +4338,8 @@ void TypoCorrectionConsumer::NamespaceSpecifierSet::addNameSpecifier(
|
|||
SpecifierOStream.flush();
|
||||
SameNameSpecifier = NewNameSpecifier == CurNameSpecifier;
|
||||
}
|
||||
if (SameNameSpecifier ||
|
||||
std::find(CurContextIdentifiers.begin(), CurContextIdentifiers.end(),
|
||||
Name) != CurContextIdentifiers.end()) {
|
||||
if (SameNameSpecifier || llvm::find(CurContextIdentifiers, Name) !=
|
||||
CurContextIdentifiers.end()) {
|
||||
// Rebuild the NestedNameSpecifier as a globally-qualified specifier.
|
||||
NNS = NestedNameSpecifier::GlobalSpecifier(Context);
|
||||
NumSpecifiers =
|
||||
|
|
|
@ -1942,11 +1942,10 @@ static void DiagnoseUnimplementedAccessor(
|
|||
llvm::SmallPtrSet<const ObjCMethodDecl *, 8> &SMap) {
|
||||
// Check to see if we have a corresponding selector in SMap and with the
|
||||
// right method type.
|
||||
auto I = std::find_if(SMap.begin(), SMap.end(),
|
||||
[&](const ObjCMethodDecl *x) {
|
||||
return x->getSelector() == Method &&
|
||||
x->isClassMethod() == Prop->isClassProperty();
|
||||
});
|
||||
auto I = llvm::find_if(SMap, [&](const ObjCMethodDecl *x) {
|
||||
return x->getSelector() == Method &&
|
||||
x->isClassMethod() == Prop->isClassProperty();
|
||||
});
|
||||
// When reporting on missing property setter/getter implementation in
|
||||
// categories, do not report when they are declared in primary class,
|
||||
// class's protocol, or one of it super classes. This is because,
|
||||
|
|
|
@ -8528,7 +8528,7 @@ unsigned ASTReader::getModuleFileID(ModuleFile *F) {
|
|||
return ((F->BaseSubmoduleID + NUM_PREDEF_SUBMODULE_IDS) << 1) | 1;
|
||||
|
||||
auto PCHModules = getModuleManager().pch_modules();
|
||||
auto I = std::find(PCHModules.begin(), PCHModules.end(), F);
|
||||
auto I = llvm::find(PCHModules, F);
|
||||
assert(I != PCHModules.end() && "emitting reference to unknown file");
|
||||
return (I - PCHModules.end()) << 1;
|
||||
}
|
||||
|
|
|
@ -254,8 +254,7 @@ void ModuleManager::removeModules(
|
|||
// Remove the modules from the PCH chain.
|
||||
for (auto I = First; I != Last; ++I) {
|
||||
if (!I->isModule()) {
|
||||
PCHChain.erase(std::find(PCHChain.begin(), PCHChain.end(), &*I),
|
||||
PCHChain.end());
|
||||
PCHChain.erase(llvm::find(PCHChain, &*I), PCHChain.end());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,10 +204,10 @@ void MIGChecker::checkPostCall(const CallEvent &Call, CheckerContext &C) const {
|
|||
if (!isInMIGCall(C))
|
||||
return;
|
||||
|
||||
auto I = std::find_if(Deallocators.begin(), Deallocators.end(),
|
||||
[&](const std::pair<CallDescription, unsigned> &Item) {
|
||||
return Call.isCalled(Item.first);
|
||||
});
|
||||
auto I = llvm::find_if(Deallocators,
|
||||
[&](const std::pair<CallDescription, unsigned> &Item) {
|
||||
return Call.isCalled(Item.first);
|
||||
});
|
||||
if (I == Deallocators.end())
|
||||
return;
|
||||
|
||||
|
|
|
@ -1369,8 +1369,7 @@ static void addContextEdges(PathPieces &pieces, SourceManager &SM,
|
|||
break;
|
||||
|
||||
// If the source is in the same context, we're already good.
|
||||
if (std::find(SrcContexts.begin(), SrcContexts.end(), DstContext) !=
|
||||
SrcContexts.end())
|
||||
if (llvm::find(SrcContexts, DstContext) != SrcContexts.end())
|
||||
break;
|
||||
|
||||
// Update the subexpression node to point to the context edge.
|
||||
|
|
|
@ -340,7 +340,7 @@ int main(int argc_, const char **argv_) {
|
|||
// response files written by clang will tokenize the same way in either mode.
|
||||
bool ClangCLMode = false;
|
||||
if (StringRef(TargetAndMode.DriverMode).equals("--driver-mode=cl") ||
|
||||
std::find_if(argv.begin(), argv.end(), [](const char *F) {
|
||||
llvm::find_if(argv, [](const char *F) {
|
||||
return F && strcmp(F, "--driver-mode=cl") == 0;
|
||||
}) != argv.end()) {
|
||||
ClangCLMode = true;
|
||||
|
|
|
@ -109,16 +109,14 @@ struct FindFileIdRefVisitData {
|
|||
|
||||
private:
|
||||
bool isOverriddingMethod(const Decl *D) const {
|
||||
if (std::find(TopMethods.begin(), TopMethods.end(), D) !=
|
||||
TopMethods.end())
|
||||
if (llvm::find(TopMethods, D) != TopMethods.end())
|
||||
return true;
|
||||
|
||||
TopMethodsTy methods;
|
||||
getTopOverriddenMethods(TU, D, methods);
|
||||
for (TopMethodsTy::iterator
|
||||
I = methods.begin(), E = methods.end(); I != E; ++I) {
|
||||
if (std::find(TopMethods.begin(), TopMethods.end(), *I) !=
|
||||
TopMethods.end())
|
||||
if (llvm::find(TopMethods, *I) != TopMethods.end())
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,8 +109,8 @@ CXCursor cxcursor::MakeCXCursor(const Decl *D, CXTranslationUnit TU,
|
|||
RegionOfInterest.getBegin() == RegionOfInterest.getEnd()) {
|
||||
SmallVector<SourceLocation, 16> SelLocs;
|
||||
cast<ObjCMethodDecl>(D)->getSelectorLocs(SelLocs);
|
||||
SmallVectorImpl<SourceLocation>::iterator
|
||||
I=std::find(SelLocs.begin(), SelLocs.end(),RegionOfInterest.getBegin());
|
||||
SmallVectorImpl<SourceLocation>::iterator I =
|
||||
llvm::find(SelLocs, RegionOfInterest.getBegin());
|
||||
if (I != SelLocs.end())
|
||||
SelectorIdIndex = I - SelLocs.begin();
|
||||
}
|
||||
|
@ -562,8 +562,8 @@ CXCursor cxcursor::MakeCXCursor(const Stmt *S, const Decl *Parent,
|
|||
RegionOfInterest.getBegin() == RegionOfInterest.getEnd()) {
|
||||
SmallVector<SourceLocation, 16> SelLocs;
|
||||
cast<ObjCMessageExpr>(S)->getSelectorLocs(SelLocs);
|
||||
SmallVectorImpl<SourceLocation>::iterator
|
||||
I=std::find(SelLocs.begin(), SelLocs.end(),RegionOfInterest.getBegin());
|
||||
SmallVectorImpl<SourceLocation>::iterator I =
|
||||
llvm::find(SelLocs, RegionOfInterest.getBegin());
|
||||
if (I != SelLocs.end())
|
||||
SelectorIdIndex = I - SelLocs.begin();
|
||||
}
|
||||
|
|
|
@ -381,7 +381,7 @@ class ASTImporterTestBase : public CompilerOptionSpecificTest {
|
|||
// Create a virtual file in the To Ctx which corresponds to the file from
|
||||
// which we want to import the `From` Decl. Without this source locations
|
||||
// will be invalid in the ToCtx.
|
||||
auto It = std::find_if(FromTUs.begin(), FromTUs.end(), [From](const TU &E) {
|
||||
auto It = llvm::find_if(FromTUs, [From](const TU &E) {
|
||||
return E.TUDecl == From->getTranslationUnitDecl();
|
||||
});
|
||||
assert(It != FromTUs.end());
|
||||
|
@ -435,10 +435,9 @@ public:
|
|||
// name).
|
||||
TranslationUnitDecl *getTuDecl(StringRef SrcCode, Language Lang,
|
||||
StringRef FileName = "input.cc") {
|
||||
assert(
|
||||
std::find_if(FromTUs.begin(), FromTUs.end(), [FileName](const TU &E) {
|
||||
return E.FileName == FileName;
|
||||
}) == FromTUs.end());
|
||||
assert(llvm::find_if(FromTUs, [FileName](const TU &E) {
|
||||
return E.FileName == FileName;
|
||||
}) == FromTUs.end());
|
||||
|
||||
ArgVector Args = getArgVectorForLanguage(Lang);
|
||||
FromTUs.emplace_back(SrcCode, FileName, Args);
|
||||
|
|
|
@ -440,8 +440,7 @@ TEST(ClangToolTest, StripDependencyFileAdjuster) {
|
|||
Tool.run(Action.get());
|
||||
|
||||
auto HasFlag = [&FinalArgs](const std::string &Flag) {
|
||||
return std::find(FinalArgs.begin(), FinalArgs.end(), Flag) !=
|
||||
FinalArgs.end();
|
||||
return llvm::find(FinalArgs, Flag) != FinalArgs.end();
|
||||
};
|
||||
EXPECT_FALSE(HasFlag("-MD"));
|
||||
EXPECT_FALSE(HasFlag("-MMD"));
|
||||
|
@ -472,8 +471,7 @@ TEST(ClangToolTest, StripPluginsAdjuster) {
|
|||
Tool.run(Action.get());
|
||||
|
||||
auto HasFlag = [&FinalArgs](const std::string &Flag) {
|
||||
return std::find(FinalArgs.begin(), FinalArgs.end(), Flag) !=
|
||||
FinalArgs.end();
|
||||
return llvm::find(FinalArgs, Flag) != FinalArgs.end();
|
||||
};
|
||||
EXPECT_FALSE(HasFlag("-Xclang"));
|
||||
EXPECT_FALSE(HasFlag("-add-plugin"));
|
||||
|
|
Loading…
Reference in New Issue