[PATCH] Implement MSVC header search algorithm in MicrosoftMode

Will Wilson will at indefiant.com
Sat Dec 14 05:44:44 PST 2013


Hi All,

Here's a patch to implement the MSVC header search algorithm for quoted
#includes. MSVC doesn't just search the #includer's directory (the existing
clang/GCC behaviour) but also searches the directories of all parent
includers before falling back on the standard search paths. I implemented
this after being bitten a few times by clang including different files to
MSVC within existing MSVC targeted codebases.

This MSVC algoritihm is outlined here:
http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx

The patch has been clang-formatted and I've also included a test case for
validation of the algorithm. I've attempted to minimize the size of the
change and tried to ensure that only MicrosoftMode will pay any performance
penalty (and even then only a small one).

Review away!

Cheers,
Will.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131214/1082ff6b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msvc_header_search_formatted.patch
Type: application/octet-stream
Size: 14316 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131214/1082ff6b/attachment.obj>


More information about the cfe-commits mailing list