diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-08-12 00:18:03 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-08-12 00:18:03 +0000 |
commit | 562e82945eec22679ae20fdb19b84dcd6959bf90 (patch) | |
tree | a4b14e32c56ba3717d80cf0498fd32b0b7ed535d /llvm/lib/Support | |
parent | 067cc24aaf63078ae31e7e0a96cabb9515f2064f (diff) | |
download | bcm5719-llvm-562e82945eec22679ae20fdb19b84dcd6959bf90.tar.gz bcm5719-llvm-562e82945eec22679ae20fdb19b84dcd6959bf90.zip |
Use the range variant of find_if instead of unpacking begin/end
No functionality change is intended.
llvm-svn: 278443
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/SourceMgr.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Support/TargetRegistry.cpp | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp index 6d44a4d51f6..395c29b4279 100644 --- a/llvm/lib/Support/SourceMgr.cpp +++ b/llvm/lib/Support/SourceMgr.cpp @@ -14,6 +14,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/SourceMgr.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/Locale.h" #include "llvm/Support/MemoryBuffer.h" @@ -395,8 +396,7 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &S, bool ShowColors, // map like Clang's TextDiagnostic. For now, we'll just handle tabs by // expanding them later, and bail out rather than show incorrect ranges and // misaligned fixits for any other odd characters. - if (std::find_if(LineContents.begin(), LineContents.end(), isNonASCII) != - LineContents.end()) { + if (find_if(LineContents, isNonASCII) != LineContents.end()) { printSourceLine(S, LineContents); return; } diff --git a/llvm/lib/Support/TargetRegistry.cpp b/llvm/lib/Support/TargetRegistry.cpp index 02a6d334b91..bed9ed64f80 100644 --- a/llvm/lib/Support/TargetRegistry.cpp +++ b/llvm/lib/Support/TargetRegistry.cpp @@ -30,8 +30,7 @@ const Target *TargetRegistry::lookupTarget(const std::string &ArchName, // name, because it might be a backend that has no mapping to a target triple. const Target *TheTarget = nullptr; if (!ArchName.empty()) { - auto I = - std::find_if(targets().begin(), targets().end(), + auto I = find_if(targets(), [&](const Target &T) { return ArchName == T.getName(); }); if (I == targets().end()) { @@ -70,7 +69,7 @@ const Target *TargetRegistry::lookupTarget(const std::string &TT, } Triple::ArchType Arch = Triple(TT).getArch(); auto ArchMatch = [&](const Target &T) { return T.ArchMatchFn(Arch); }; - auto I = std::find_if(targets().begin(), targets().end(), ArchMatch); + auto I = find_if(targets(), ArchMatch); if (I == targets().end()) { Error = "No available targets are compatible with this triple."; |