<div dir="ltr">Thanks for the patch, this is definitely interesting! It looks pretty reasonable too. I'll check it out on phabricator when it's up.<div><br></div><div>When you say the pre-processor is 2-3% slower, do you mean that the overall compile time of spirit etc got 2% longer, or just that the pre-processing step in a system like distcc got slower?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 1:27 PM, Eric Niebler via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 4/14/16, 1:14 PM, "Eric Niebler" <<a href="mailto:eniebler@fb.com">eniebler@fb.com</a>> wrote:<br>
<br>
>On 4/7/16, 4:44 PM, "Eric Niebler" <<a href="mailto:eniebler@fb.com">eniebler@fb.com</a>> wrote:<br>
><br>
>>On 4/7/16, 11:37 AM, "<a href="mailto:clattner@apple.com">clattner@apple.com</a> on behalf of Chris Lattner" <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:<br>
>><br>
>>>On Apr 5, 2016, at 4:03 PM, Eric Niebler via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br>
>>><br>
>>>> Hi all,<br>
>>><br>
>>>> I have an initial cut at patch that issues a warning when a file is #included<br>
>>>> on a case-insensitive file system that would not be found on a case-sensitive<br>
>>>> system. Is there interest?<br>
>>><br>
>>>> Since this is a hard problem to solve perfectly, I have opted for a strategy<br>
>>>> that is efficient and conservative about issuing diagnostics. That is, it<br>
>>>> shouldn't give false positives, but it will fail to diagnose some non-portable<br>
>>>> paths. On *nix systems, the low-level APIs that stat and open files get an<br>
>>>> extra call to ::realpath, and the result is cached along with the rest of the<br>
>>>> file metadata. On Windows, I use a combination of GetFullPathName and<br>
>>>> GetLongPathName to get the same effect. (I don't believe that's guaranteed to<br>
>>>> get the physical name including case, but it seems to mostly work in my<br>
>>>> testing.)<br>
>>>><br>
>>>> Due to how I compare path components, a relative path like<br>
>>>> "NoTtHeRiGhTcAsE/../correctly-cased.h" will not be diagnosed, but<br>
>>>> "../NoTtHeRiGhTcAsE/correctly-cased.h" will be. Catching more cases requires<br>
>>>> many more round trips to the disk, which I wanted to avoid.<br>
>>><br>
>>>Hi Eric,<br>
>>><br>
>>>This would be a hugely welcomed feature, but have you done any performance analysis of this? The preprocessor and the data structures you are touching are very sensitive.<br>
>>><br>
>>>You can stress test the preprocessor by using the "clang -cc1 -Eonly” mode. If you’re on a mac, I’d recommend timing <Cocoa/Cocoa.h><br>
>><br>
>>Thanks for the suggestion, Chris. Looks like I've regressed the speed of the preprocessor by 25%. Yikes. I'll see what I can do.<br>
>><br>
>>Eric<br>
><br>
><br>
>I have reimplemented this feature with an eye to performance. I now have it down to 2-3% perf regression in the preprocessor, which I hope is acceptable. I have benchmarked perf on MacOS (with Cocoa.h), Linux (with all of Boost.Spirit), and Windows (with Windows.h). For the record, Windows.h is terrible about properly casing its #includes. :-)<br>
><br>
>Incorrectly cased #includes are diagnosed on MacOS, Windows, and on Linux (for case-insensitive file systems). They are even diagnosed in Cygwin. They will not be diagnosed on *nix-like systems that don't have either F_GETPATH (like MacOS) or a mounted /proc filesystem.<br>
><br>
>Comments welcome.<br>
><br>
>Eric<br>
><br>
<br>
<br>
</div></div>Any thoughts about this patch? Are folks here still interested? (Sending updated patch with --ignore-space-change.)<br>
<span class="HOEnZb"><font color="#888888"><br>
\e<br>
<br>
</font></span><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>