On windows, at least, there is an API that could help with this: just get a (windows) handle to the file via OpenFile / CreateFile, then query the handle's filename.  See <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa366789(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/aa366789(v=vs.85).aspx</a>.<div>
<br></div><div>I suspect there are similar ways to do it for mac and linux.</div><div><br></div><div>-Joshua<br><br><div class="gmail_quote">On 27 July 2012 12:02, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Jul 27, 2012, at 10:13 AM, Jason Haslam wrote:<br>
>> I wrote a little script to generate a torture test for this warning like I proposed before.  It consists of a source file with 4096 different #includes in 64 directories where each directory contains an additional 4096 files. As expected, it is many times slower with the warning enabled than without on the existing implementation. It goes from .08 seconds without the warning up to 5 seconds with the warning.<br>

>><br>
>> I also tried the readdir caching optimization that I mentioned before. It brings the time with the warning down to .35 seconds. On real code it's still well below 1% difference. So what do you think? Is this just too risky to add? Updated patch is attached.<br>

><br>
> Ugh! Ignore the previous patch. This one actually works correctly.<br>
<br>
</div>Ok, the best person to review this is Argyrios, and unfortunately he's out on vacation until August 20th...<br>
<div class="HOEnZb"><div class="h5"><br>
-Chris<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>