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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 00:47:32 PST 2020


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM, once @grimar is happy.



================
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");
----------------
MaskRay wrote:
> jhenderson wrote:
> > I thought using `static` was more in keeping with LLVM-style?
> LLVM style prefers `static`.
> 
> However, namespaces are used in other places, e.g. llvm-nm. llvm-readobj interestingly uses a named namespace.
> 
> `static` makes the code a bit more verbose but I can change you are strong about this.
Frankly, I prefer namespaces. I don't know why LLVM style is for `static`.


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