[PATCH] D79375: [FileCheck] Make invalid prefix diagnostics more precise

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 01:02:24 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/lib/Support/FileCheck.cpp:1884
+static bool ValidatePrefixes(StringSet<> &PrefixSet,
+                             const std::vector<StringRef> &Prefixes) {
+  for (StringRef Prefix : Prefixes) {
----------------
`ArrayRef`


================
Comment at: llvm/lib/Support/FileCheck.cpp:1887
+    if (Prefix.empty()) {
+      errs() << "error: supplied check prefix must not be the empty string\n";
       return false;
----------------
How about `WithColor::error()` instead?


================
Comment at: llvm/lib/Support/FileCheck.cpp:1905
+
+static const char *DefaultCheckPrefixes[] = {"CHECK"};
 
----------------
This is only used in one place. Why not just explicitly provide it there? Alternatively, should this be defined in the top-level bit of FileCheck, so that client libraries can have different default check prefixes?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79375





More information about the llvm-commits mailing list