summaryrefslogtreecommitdiff
path: root/utils/FileCheck
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-04-29 21:45:24 +0000
committerChris Bieneman <beanz@apple.com>2015-04-29 21:45:24 +0000
commit65d5d2d117c119372bc1711c3dfe353d82ba0308 (patch)
tree07e2fc72edd3e9feb8c687db0d28d471228c44ff /utils/FileCheck
parent054c79645c62cb00238cd4fe984d8434c8a2b54e (diff)
[NFC] Updating FileCheck to reduce the std::vector interface used via cl::list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileCheck')
-rw-r--r--utils/FileCheck/FileCheck.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp
index f7c0524a221..8fe2f88a3e7 100644
--- a/utils/FileCheck/FileCheck.cpp
+++ b/utils/FileCheck/FileCheck.cpp
@@ -958,7 +958,7 @@ static bool ReadCheckFile(SourceMgr &SM,
// prefix as a filler for the error message.
if (!DagNotMatches.empty()) {
CheckStrings.push_back(CheckString(Pattern(Check::CheckEOF),
- CheckPrefixes[0],
+ *CheckPrefixes.begin(),
SMLoc::getFromPointer(Buffer.data()),
Check::CheckEOF));
std::swap(DagNotMatches, CheckStrings.back().DagNotStrings);
@@ -967,12 +967,14 @@ static bool ReadCheckFile(SourceMgr &SM,
if (CheckStrings.empty()) {
errs() << "error: no check strings found with prefix"
<< (CheckPrefixes.size() > 1 ? "es " : " ");
- for (size_t I = 0, N = CheckPrefixes.size(); I != N; ++I) {
- StringRef Prefix(CheckPrefixes[I]);
- errs() << '\'' << Prefix << ":'";
- if (I != N - 1)
- errs() << ", ";
+ prefix_iterator I = CheckPrefixes.begin();
+ prefix_iterator E = CheckPrefixes.end();
+ if (I != E) {
+ errs() << "\'" << *I << ":'";
+ ++I;
}
+ for (; I != E; ++I)
+ errs() << ", \'" << *I << ":'";
errs() << '\n';
return true;