[cfe-dev] New warning for mismatched include case

Jason Haslam jason.haslam at gmail.com
Tue Jul 24 20:30:43 PDT 2012


On Jul 24, 2012, at 3:56 PM, Chris Lattner wrote:

> 
> On Jul 24, 2012, at 12:40 PM, Jason Haslam wrote:
> 
>> On Jul 23, 2012, at 7:00 PM, Chris Lattner wrote:
>> 
>>> 
>>> On Jul 23, 2012, at 9:16 AM, Jason Haslam wrote:
>>> 
>>>> This updated patch adds a fixit and a test. The test fails on case-sensitive systems. Is it possible to test for an error on some platforms and a warning on others?
>>> 
>>> Very cool, it would be really great to get this warning.  However, there is high risks of slowing down compile times here, have you done any analysis of the compile-time cost of this?
>> 
>> I have done some performance testing. I see less than 1% slowdown over parts of LLVM. For example, I build the LLVMSupport library repeatedly until the build time becomes more-or-less consistent. Then do the same thing with the warning enabled. I don't know if there's a better way to test this.
> 
> This is with the warning enabled, right?

Yes, I'm testing both with the warning enabled and without and comparing the difference. Maybe I should create a sort of worst-case-scenario test case instead?

> I haven't looked closely at the implementation yet, but you're doing entire directory scans to resolve the original case.  I'm not aware of a better way to find the original case, but this is very delicate.  It is not uncommon to include hundreds of headers in dozens of different directories.

Correct, the implementation uses the directory iterator from PathV2 which uses readdir on unix. The real case name is cached, which helps some, but I suspect that it may be better to cache the actual directory listing into a sorted list instead. Then the directory is read just once and subsequent lookups are really fast. I can try this.

Jason 





More information about the cfe-dev mailing list