<p dir="ltr">This seems more like failure to prefer Clang's immintrin.h over MSVC's. Getting that to work in right Clang tools is annoying.</p>
<p dir="ltr">Sent from phone</p>
<div class="gmail_quote">On Oct 21, 2015 7:27 PM, "Nico Weber via cfe-dev" <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You probably need to pass some combination of -fms-compatibility -fms-extensions -fdelayed-template-parsing and a MS abi triple to -target to be able to parse SDK headers. You can try running `clang-cl -c some_file.cc -###` to see which cc1 parameters clang-cl passes by default.<div><br></div><div>Actually, looking at lib/Driver/Tools.cpp, it looks like the driver will use good defaults as long as the triple thinks that isWindowsMSVCEnvironment() is true. Try adding something like "-target x86_64-pc-windows-msvc18.0.0" to your flag, that's probably enough. Alternatively, you could also try passing "--driver-mode=cl " as first parameter, then the tool will behave like clang-cl in general (but it'll expect clang-cl flags, see bin/clang-cl /? for a list. -I and -D should work).</div><div><br></div><div>Nico<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 21, 2015 at 6:11 PM, Daniel Dilts 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 dir="ltr"><div>I have a custom tool that uses libTooling. I am running the tool on Windows. When I attempt to run the tool over my code I get many errors of the following form:</div><div><br></div><div>2> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector:6:<br>2> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory:6:<br>2> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0:1015:<br>2> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\intrin.h:24:<br>2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h:764:28: error: invalid token in macro parameter list<br>2> #define _mm256_loadu2_m128(/* float const* */ hiaddr, \<br>2> ^<br>2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h:768:29: error: invalid token in macro parameter list<br>2> #define _mm256_loadu2_m128d(/* double const* */ hiaddr, \<br>2> ^<br>2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h:772:29: error: invalid token in macro parameter list<br>2> #define _mm256_loadu2_m128i(/* __m128i const* */ hiaddr, \<br>2> ^<br>2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h:782:29: error: invalid token in macro parameter list<br>2> #define _mm256_storeu2_m128(/* float* */ hiaddr, /* float* */ loaddr, \<br>2> ^<br>2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h:790:30: error: invalid token in macro parameter list<br>2> #define _mm256_storeu2_m128d(/* double* */ hiaddr, /* double* */ loaddr, \<br>2> ^<br>2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h:798:30: error: invalid token in macro parameter list<br>2> #define _mm256_storeu2_m128i(/* __m128i* */ hiaddr, /* __m128i* */ loaddr, \<br>2> ^<br>2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h:1117:25: error: invalid token in macro parameter list<br>2> #define _mm256_set_m128(/* __m128 */ hi, /* __m128 */ lo) \<br>2> ^<br>2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h:1120:26: error: invalid token in macro parameter list<br>2> #define _mm256_set_m128d(/* __m128d */ hi, /* __m128d */ lo) \<br>2> ^<br>2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h:1123:26: error: invalid token in macro parameter list<br>2> #define _mm256_set_m128i(/* __m128i */ hi, /* __m128i */ lo) \<br>2> ^<br>2> 9 errors generated.</div><div><br></div><div>Is there some way to get my tool to handle this gracefully? My command-line for my tool looks like:</div><div>MyTool.exe -- -IC:/Path/To/Includes -DSOME_MACRO</div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">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>
<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>