[cfe-dev] why does clang re-evaluate the target info for each input file?

Sam Bishop sam at bishop.dhs.org
Sat Mar 1 12:31:36 PST 2008

Hi, Ted.

Ted Kremenek wrote:
> Originally the Target was computed only once, prior to adding  
> serialization support.  Because the changes I made to the driver when I 
> added serialization support were fairly invasive, small inefficiencies 
> like this were (deliberately) introduced.  The desired tradeoff at the 
> time was to have my changes be more readable and understandable at the 
> cost of a few things in the driver being slightly less efficient.  The 
> hope was that this would help shake out bugs introduced by my changes 
> (of which there were several that we encountered).

That makes sense.  Thanks.

> Certainly some of these inefficiencies can (and should) be fixed.  I am
 > fine with introducing optimizations like the one you suggest as long as
 > we also aim to keep the driver readable and maintainable.

What got me looking at this was valgrind complaining about target 
information being leaked.  I've looked at this a little closer, and it 
appears that the leak is in the library code.  I should be able to fix 

It also looks like there are some other things being recalculated 
unnecessarily, like header-include information.  Would you mind if I 
try to lift those things out of the loop?


More information about the cfe-dev mailing list