summaryrefslogtreecommitdiffstats
path: root/llvm/utils/FileCheck/FileCheck.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-01-29 21:55:16 +0000
committerDan Gohman <gohman@apple.com>2010-01-29 21:55:16 +0000
commitdf22bbf76c5a5bf1945a49dcab5a18895a28a888 (patch)
tree5ef56324325a70e03009f28e9576a54416154607 /llvm/utils/FileCheck/FileCheck.cpp
parent838fb09a75f6aefe841a3d27cc27ada305485edb (diff)
downloadbcm5719-llvm-df22bbf76c5a5bf1945a49dcab5a18895a28a888.tar.gz
bcm5719-llvm-df22bbf76c5a5bf1945a49dcab5a18895a28a888.zip
Skip whitespace when looking for a potential intended match.
Before: <stdin>:94:1: note: possible intended match here movsd 4096(%rsi), %xmm0 ^ After: <stdin>:94:2: note: possible intended match here movsd 4096(%rsi), %xmm0 ^ llvm-svn: 94847
Diffstat (limited to 'llvm/utils/FileCheck/FileCheck.cpp')
-rw-r--r--llvm/utils/FileCheck/FileCheck.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 5b158fed8d3..ddc8dc2661c 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -382,6 +382,11 @@ void Pattern::PrintFailureInfo(const SourceMgr &SM, StringRef Buffer,
if (Buffer[i] == '\n')
++NumLinesForward;
+ // Patterns have leading whitespace stripped, so skip whitespace when
+ // looking for something which looks like a pattern.
+ if (Buffer[i] == ' ' || Buffer[i] == '\t')
+ continue;
+
// Compute the "quality" of this match as an arbitrary combination of the
// match distance and the number of lines skipped to get to this match.
unsigned Distance = ComputeMatchDistance(Buffer.substr(i), VariableTable);
OpenPOWER on IntegriCloud