[cfe-dev] Duplicated header between Clang and MSVC - why?

Reid Kleckner via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 3 14:27:03 PDT 2019


>
> On Tue, Oct 1, 2019 at 11:58 PM Gaier, Bjoern via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> Hello Clang-Experts,
>>
>>
>>
>> I’m using Clang-CL in Visual Studio – everything is working fine! Hooray!
>>
>
Glad to hear it! :)


> Now I wonder… If I run Clang-CL, should I use the most up to date MSVC
>> header or the Clang one?
>>
>
If you use clang-cl, it should automatically use some combination of both
sets of headers. You can see in vadefs.h, for example, `#include_next` is
used like so:
#include_next <vadefs.h>
So both clang and MSVC's vadefs.h header is used.


> Why are these files duplicated anyway?
>>
>
What David said is correct. The headers that clang ships tend to define
things that are tightly coupled to the compiler. See the way clang
implements the intel intrinsics, for example, by looking at the mmintrin.h
header.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191003/bc52e088/attachment.html>


More information about the cfe-dev mailing list