[llvm] [FileCheck]: Fix diagnostics for NOT prefixes (PR #78412)

Thomas Preud'homme via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 06:35:58 PST 2024


================
@@ -1957,11 +1960,12 @@ bool FileCheck::readCheckFile(
   }
 
   // Add an EOF pattern for any trailing --implicit-check-not/CHECK-DAG/-NOTs,
-  // and use the first prefix as a filler for the error message.
+  // and use the prefix from the last/trailing CHECK-NOT for the error message
   if (!DagNotMatches.empty()) {
     CheckStrings->emplace_back(
         Pattern(Check::CheckEOF, PatternContext.get(), LineNumber + 1),
-        *Req.CheckPrefixes.begin(), SMLoc::getFromPointer(Buffer.data()));
+        DagNotMatches.back().DagNotPrefix,
+        SMLoc::getFromPointer(Buffer.data()));
----------------
RoboTux wrote:

I think this can remain unchanged now, we won't be using that prefix for the error message once you change printMatch and printNotMatch to handle CheckNot

https://github.com/llvm/llvm-project/pull/78412


More information about the llvm-commits mailing list