aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-01-29 21:53:18 +0000
committerDan Gohman <gohman@apple.com>2010-01-29 21:53:18 +0000
commite546343799d1b7914024b62f6c188f5c0d66f7b3 (patch)
treea76a94edf5af7b5de1ad6a1e462fdb650cf96989
parentfcb0ee8ffeae12aa866f4e7da12a4dd2a1d0dc35 (diff)
downloadexternal_llvm-e546343799d1b7914024b62f6c188f5c0d66f7b3.zip
external_llvm-e546343799d1b7914024b62f6c188f5c0d66f7b3.tar.gz
external_llvm-e546343799d1b7914024b62f6c188f5c0d66f7b3.tar.bz2
Fix the position of the caret in the FileCheck error message.
Before: test/CodeGen/X86/lsr-reuse.ll:52:34: error: expected string not found in input ; CHECK: movsd -2048(%rsi), %xmm0 ^ After: test/CodeGen/X86/lsr-reuse.ll:52:10: error: expected string not found in input ; CHECK: movsd -2048(%rsi), %xmm0 ^ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94846 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/FileCheck/FileCheck.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp
index 440d7d7..5b158fe 100644
--- a/utils/FileCheck/FileCheck.cpp
+++ b/utils/FileCheck/FileCheck.cpp
@@ -524,6 +524,9 @@ static bool ReadCheckFile(SourceMgr &SM,
// Scan ahead to the end of line.
size_t EOL = Buffer.find_first_of("\n\r");
+ // Remember the location of the start of the pattern, for diagnostics.
+ SMLoc PatternLoc = SMLoc::getFromPointer(Buffer.data());
+
// Parse the pattern.
Pattern P;
if (P.ParsePattern(Buffer.substr(0, EOL), SM))
@@ -550,7 +553,7 @@ static bool ReadCheckFile(SourceMgr &SM,
// Okay, add the string we captured to the output vector and move on.
CheckStrings.push_back(CheckString(P,
- SMLoc::getFromPointer(Buffer.data()),
+ PatternLoc,
IsCheckNext));
std::swap(NotMatches, CheckStrings.back().NotStrings);
}