[PATCH] D63125: FileCheck: Return parse error w/ Error & Expected

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 14:32:12 PDT 2019


thopre marked 3 inline comments as done.
thopre added inline comments.


================
Comment at: llvm/include/llvm/Support/FileCheck.h:351-352
+  void log(raw_ostream &OS) const override {
+    Diagnostic.getSourceMgr()->PrintMessage(
+        OS, Diagnostic.getLoc(), Diagnostic.getKind(), Diagnostic.getMessage());
+  }
----------------
This can be simplified to Diagnostic.print(nullptr, OS);


================
Comment at: llvm/lib/Support/FileCheck.cpp:619-622
     if (MatchedValue.getAsInteger(10, Val)) {
       SM.PrintMessage(SMLoc::getFromPointer(MatchedValue.data()),
                       SourceMgr::DK_Error, "Unable to represent numeric value");
     }
----------------
Perhaps worth making match() return an error via an Expected<size_t> return value.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63125





More information about the llvm-commits mailing list