[llvm-commits] [llvm] r79164 - /llvm/trunk/utils/FileCheck/FileCheck.cpp

Chris Lattner sabre at nondot.org
Sat Aug 15 19:22:31 PDT 2009


Author: lattner
Date: Sat Aug 15 21:22:31 2009
New Revision: 79164

URL: http://llvm.org/viewvc/llvm-project?rev=79164&view=rev
Log:
when emitting errors about CHECK-NEXT directives, show the line that the 
CHECK-NEXT is on.

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=79164&r1=79163&r2=79164&view=diff

==============================================================================
--- llvm/trunk/utils/FileCheck/FileCheck.cpp (original)
+++ llvm/trunk/utils/FileCheck/FileCheck.cpp Sat Aug 15 21:22:31 2009
@@ -325,19 +325,23 @@
 
       unsigned NumNewLines = CountNumNewlinesBetween(LastMatch, Ptr);
       if (NumNewLines == 0) {
-        SM.PrintMessage(SMLoc::getFromPointer(Ptr),
+        SM.PrintMessage(CheckStr.Loc,
                     CheckPrefix+"-NEXT: is on the same line as previous match",
                         "error");
+        SM.PrintMessage(SMLoc::getFromPointer(Ptr),
+                        "'next' match was here", "note");
         SM.PrintMessage(SMLoc::getFromPointer(LastMatch),
                         "previous match was here", "note");
         return 1;
       }
       
       if (NumNewLines != 1) {
-        SM.PrintMessage(SMLoc::getFromPointer(Ptr),
+        SM.PrintMessage(CheckStr.Loc,
                         CheckPrefix+
                         "-NEXT: is not on the line after the previous match",
                         "error");
+        SM.PrintMessage(SMLoc::getFromPointer(Ptr),
+                        "'next' match was here", "note");
         SM.PrintMessage(SMLoc::getFromPointer(LastMatch),
                         "previous match was here", "note");
         return 1;





More information about the llvm-commits mailing list