[cfe-commits] [patch] Implement support for @file

Daniel Dunbar daniel at zuster.org
Thu Jun 24 01:17:23 PDT 2010


Hi Rafael,

I would like to support @filename syntax, but I think it would be
better to implement as a built in feature of the OptTable class. My
recent work to have arguments embed their values should make this
easier. I think it should be possible to implement this primarily
inside OptTable::ParseArgs (which has a FIXME about it, btw).

 - Daniel

On Wed, Jun 23, 2010 at 10:17 PM, Rafael Espindola <espindola at google.com> wrote:
> Most gnu tools (gcc included) have support for reading more argument
> from a file if given @filename in the command line. In the case of gcc
> this is useful when handling very long link lines.
>
> The attached patch implements that feature in the clang driver.
>
> The traditional implementation is to modify argc and argv. Instead of
> doing that, I decided to add the processed arguments to a vector.
> Other parts of main do that, and maybe we can now combine these
> vectors.
>
> I am not sure if this is the correct place to implement this. The nice
> thing about doing it early is that having -cc1 in the args file will
> produce the expected result for example.
>
> Last but not least, how much do we care about small memory leaks in
> error conditions like not being able to read the file? And about
> freeing up the memory used for the arguments?
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>




More information about the cfe-commits mailing list