r217792 - Teach Clang how to use response files when calling other tools

Sean Silva chisophugis at gmail.com
Fri Sep 19 15:54:37 PDT 2014


On Thu, Sep 18, 2014 at 4:32 PM, Reid Kleckner <rnk at google.com> wrote:

> On Thu, Sep 18, 2014 at 4:20 PM, Rafael EspĂ­ndola <
> rafael.espindola at gmail.com> wrote:
>>
>> Now, there are 300_000 options in the response file, but adding a
>> counter to ] llvm::opt::Option::matches shows that it is called about
>> 349_802_000 times :-)
>>
>> Is this a now issue? Is it worth fixing?
>>
>
> It's sort of a known issue, but only by inspection. If you've ever looked
> at the driver, there are all these calls to getLastArg(ID), AddAllArgs(ID1,
> ID2) and things of that nature. They *all* iterate the whole argument list.
>
> We could probably make this much more efficient by mapping the arguments
> into a table indexed by option ID and doing lookup on that. We would still
> need to preserve order information, though.
>
> I think when Daniel Dunbar wrote all this, everyone agreed that command
> line parsing would never be hot, so it was done expediently and without
> consideration for efficiency. Previously strings were not allocated form a
> pool, they were merely malloc'd and leaked. The leaks aren't really that
> bad, considering that the command line has to live for roughly the driver's
> whole life.
>

Unless clang is being used as a library...

-- Sean Silva


>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140919/9ebab5d7/attachment.html>


More information about the cfe-commits mailing list