[PATCH] D21814: clang-rename: split existing options into two new subcommands

Miklos Vajna via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 29 03:59:32 PDT 2016


vmiklos added a comment.

Rebased on top of r277131 and resolved conflicts.

> As for help message, look at clang-tidy. Is there a need in helpMain?


I think so; we have this chicken-and-egg problem (see earlier comments of this
review), that the options parser wants to know the option category, but we only
know the option category after parsing options due to subcommands. This is not
a problem for clang-tidy that doesn't have subcommands (as far as I see).

So one way is the own code for handling the subcommands (that's what I did
here, and that's what e.g. llvm-cov does), an other way would be to extend
`tooling::CommonOptionsParser`, so it doesn't want a category in the ctor. That
requirement is a problem for us, since we have two categories, so we can't give
the correct one without parsing the options.

So all in all, the best seems to me is to go with a simple helpMain().

> besides, let me push one thing; it's about passing a vector of USRs to the USRLocFinder instead of passing them 1 by 1; removes a need to write that FIXME of yours :)


Great, I've removed it then.


https://reviews.llvm.org/D21814





More information about the cfe-commits mailing list