[llvm-commits] [llvm] r94846 - /llvm/trunk/utils/FileCheck/FileCheck.cpp
Dan Gohman
gohman at apple.com
Fri Jan 29 13:53:19 PST 2010
Author: djg
Date: Fri Jan 29 15:53:18 2010
New Revision: 94846
URL: http://llvm.org/viewvc/llvm-project?rev=94846&view=rev
Log:
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
^
Modified:
llvm/trunk/utils/FileCheck/FileCheck.cpp
Modified: llvm/trunk/utils/FileCheck/FileCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileCheck/FileCheck.cpp?rev=94846&r1=94845&r2=94846&view=diff
==============================================================================
--- llvm/trunk/utils/FileCheck/FileCheck.cpp (original)
+++ llvm/trunk/utils/FileCheck/FileCheck.cpp Fri Jan 29 15:53:18 2010
@@ -524,6 +524,9 @@
// 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 @@
// 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);
}
More information about the llvm-commits
mailing list