[PATCH] D73982: [yaml2obj] Refactor command line parsing

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 06:36:03 PST 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/yaml2obj/help.test:5
+# RUN: yaml2obj --help | FileCheck %s --check-prefixes=CHECK,CATEG --implicit-check-not=Options:
+# RUN: yaml2obj --help-list | FileCheck %s --check-prefixes=CHECK,LIST --implicit-check-not=Options:
+
----------------
Delete `--check-prefixes=CHECK,LIST`


================
Comment at: llvm/test/tools/yaml2obj/output-file.yaml:12
+
+## Don't check the OS-dependent message "No such file or directory".
+# CHECK: yaml2obj: error: failed to open '{{.*}}/path/does/not/exist': {{.*}}
----------------
Actually, "No such file or directory" is only OS-dependent via the capitalization of the first letter. We have lots of other tests that check the message, using a regex for that first letter.


================
Comment at: llvm/tools/yaml2obj/yaml2obj.cpp:31
 
-static cl::opt<std::string>
-  Input(cl::Positional, cl::desc("<input>"), cl::init("-"));
+namespace {
+cl::OptionCategory Cat("yaml2obj Options");
----------------
I thought using `static` was more in keeping with LLVM-style?


================
Comment at: llvm/tools/yaml2obj/yaml2obj.cpp:51
+  cl::ParseCommandLineOptions(
+      argc, argv, "Create an object file from YAML description", nullptr,
+      nullptr, /*LongOptionsUseDoubleDash=*/true);
----------------
from a YAML


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73982





More information about the llvm-commits mailing list