[PATCH] Added function to CommonOptionsParser to verify -- was included in the command line.

Manuel Klimek klimek at google.com
Wed Aug 7 16:49:07 PDT 2013


On Wed, Aug 7, 2013 at 3:51 PM, Bernal, Ariel J <ariel.j.bernal at intel.com>wrote:

>  Manuel,****
>
> ** **
>
> I would like to append -std=c++11 to the compilation arguments in case the
> user has specified a source path or -- without  arguments, then if you run
> the migrator more than once it doesn’t fail.****
>
> ** **
>
> In the following cases c++11 support will be added****
>
> ** **
>
> cpp11-migrate –use-nullptr  file.cpp   ****
>
> cpp11-migrate –use-nullptr  file.cpp   -- -I include_dir****
>
> ** **
>
> but not in this case****
>
> ** **
>
> cpp11-migrate –use-nullptr  -p compilation.json   ****
>
> ** **
>
> The problem is that once the arguments are parsed I can’t check if they
> come from a json file, from a source path or a fixcompilationdatabase --**
> **
>
> ** **
>
> Do you think there’s another way to achieve the same without changing
> CommonOptionsParser?
>

Yes. I think if you want that tight control, don't use the
CommonOptionsParser - it's mainly there to make simple tools really simple
to implement.

If you think there will be many other tools which want to do similar stuff
to what you're planning, I'd vote for introducing a different abstraction.

Cheers,
/Manuel


> ****
>
> ** **
>
> Thanks****
>
> ** **
>
> Ariel****
>
> ** **
>
> ** **
>
> *From:* Manuel Klimek [mailto:klimek at google.com]
> *Sent:* Wednesday, August 07, 2013 3:07 PM
> *To:* reviews+D1312+public+c404da01ae6da218 at llvm-reviews.chandlerc.com
> *Cc:* Vane, Edwin; Siraj, Tareq A; Guillaume Papin; Bernal, Ariel J;
> cfe-commits at cs.uiuc.edu
> *Subject:* Re: [PATCH] Added function to CommonOptionsParser to verify --
> was included in the command line.****
>
> ** **
>
> Can I ask which use case in the tool you're addressing? Thanks!****
>
> ** **
>
> On Wed, Aug 7, 2013 at 10:45 AM, Ariel Bernal <ariel.j.bernal at intel.com>
> wrote:****
>
>
>   I also need to verify if Compilations come from SourcePath too.
>
> http://llvm-reviews.chandlerc.com/D1312****
>
> ** **
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130807/72673752/attachment.html>


More information about the cfe-commits mailing list