[PATCH] D86222: Fix PR46880: Fail CHECK-NOT with undefined variable

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 25 17:51:24 PDT 2021


jdenny added a comment.

I haven't looked through the tests yet, but the implementation logic looks right to me.  Thanks!



================
Comment at: llvm/lib/FileCheck/FileCheck.cpp:2130
   handleAllErrors(
-      std::move(MatchError),
+      std::move(MatchError), [](const NotFoundError &E) {},
       [&](const ErrorDiagnostic &E) {
----------------
Is this change intentional?  There's already a `NotFoundError` handler below (I'd prefer to keep its comment).


================
Comment at: llvm/lib/FileCheck/FileCheckImpl.h:232
   void log(raw_ostream &OS) const override {
-    OS << "\"";
-    OS.write_escaped(VarName) << "\"";
+    OS << "undefined variable: " << VarName;
   }
----------------
When is this function called now?


================
Comment at: llvm/lib/FileCheck/FileCheckImpl.h:759
   /// Prints the value of successful substitutions or the name of the undefined
   /// string or numeric variables preventing a successful substitution.
   void printSubstitutions(const SourceMgr &SM, StringRef Buffer,
----------------
It looks like everything after the "or" is no longer true.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86222/new/

https://reviews.llvm.org/D86222



More information about the llvm-commits mailing list