diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-19 18:07:43 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-19 18:07:43 +0000 |
commit | 7a68e0df0d2eb46f509ef086729e46a0e79e4750 (patch) | |
tree | 1676008600c63946f33f75cf6407b95b5259522e /utils/FileCheck | |
parent | 2f36fe438062801ca69785ffc8e476aa1bfa49e6 (diff) | |
download | external_llvm-7a68e0df0d2eb46f509ef086729e46a0e79e4750.zip external_llvm-7a68e0df0d2eb46f509ef086729e46a0e79e4750.tar.gz external_llvm-7a68e0df0d2eb46f509ef086729e46a0e79e4750.tar.bz2 |
FileCheck: Don't print "possibly intended match" line if it would match the
"scanning from here" one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98971 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileCheck')
-rw-r--r-- | utils/FileCheck/FileCheck.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp index 3c4742c..c6a1392 100644 --- a/utils/FileCheck/FileCheck.cpp +++ b/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. |