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

Rafael Espindola espindola at google.com
Wed Jun 23 22:17:34 PDT 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: at.patch
Type: text/x-patch
Size: 6841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100624/8f7d4c66/attachment.bin>


More information about the cfe-commits mailing list