summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-03-19 18:07:43 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-03-19 18:07:43 +0000
commitc069cc8eaa5900be730d41f0817414f7d412236e (patch)
treeedba3d5d6b8595e55788a159274f44a6a3e6a320 /llvm/utils
parentd5bb8cb348db49ef04a90e973f87d1b578e4e060 (diff)
downloadbcm5719-llvm-c069cc8eaa5900be730d41f0817414f7d412236e.tar.gz
bcm5719-llvm-c069cc8eaa5900be730d41f0817414f7d412236e.zip
FileCheck: Don't print "possibly intended match" line if it would match the
"scanning from here" one. llvm-svn: 98971
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/FileCheck/FileCheck.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 3c4742cc36f..c6a13927589 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -401,11 +401,12 @@ void Pattern::PrintFailureInfo(const SourceMgr &SM, StringRef Buffer,
}
}
- if (Best != StringRef::npos && BestQuality < 50) {
- // Print the "possible intended match here" line if we found something
- // reasonable.
- SM.PrintMessage(SMLoc::getFromPointer(Buffer.data() + Best),
- "possible intended match here", "note");
+ // Print the "possible intended match here" line if we found something
+ // reasonable and not equal to what we showed in the "scanning from here"
+ // line.
+ if (Best && Best != StringRef::npos && BestQuality < 50) {
+ SM.PrintMessage(SMLoc::getFromPointer(Buffer.data() + Best),
+ "possible intended match here", "note");
// FIXME: If we wanted to be really friendly we would show why the match
// failed, as it can be hard to spot simple one character differences.
OpenPOWER on IntegriCloud