[Lldb-commits] [PATCH] D54682: [Driver] Extract option parsing and option processing.

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 19 01:54:09 PST 2018


JDevlieghere added a comment.

In https://reviews.llvm.org/D54682#1302448, @zturner wrote:

> Lib option definitely does, as its entire purpose is to be powerful and
>  flexible enough to mimic arbitrary command line tools.


I created https://reviews.llvm.org/D54692 to show what the driver would look like using libOption. Personally I think the code looks better but the help is more messy, especially with the aliases. It's more consistent with LLVM though, which has to count for something.

The only thing that I found missing was support for the "end of options" marker (`--`). I ended up implementing a simple work-around, but it seems like the lib could benefit from supporting that. I'll have a look when I have some spare time.

> cl::opt is a little less powerful but it still preserves order among
>  multiple options with the same flag, just not multiple options with
>  different flags.
> 
> I don’t have a strong opinion that this particular change should be gated
>  on that, it’s just nice when we can reuse llvm logic. Sometimes it fixes
>  latent bugs, sometimes it enables new functionality that wasn’t possible
>  before, etc. up to you if you wanna give it a shot

I'm always a strong proponent of reusing llvm logic.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D54682





More information about the lldb-commits mailing list