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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Sep 19 06:18:54 PDT 2014


On 18 September 2014 19:32, 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.

OK, I reported pr20999 to keep track of it.

Cheers,
Rafael




More information about the cfe-commits mailing list