[PATCH] D24330: Add some MS aliases for existing intrinsics

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 11:51:45 PDT 2016


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm after merging the test back.


================
Comment at: test/Sema/implicit-intel-builtin-decl.c:4
@@ +3,3 @@
+void f() {
+  (void)_mm_getcsr(); // expected-warning{{implicitly declaring library function '_mm_getcsr'}} \
+  // expected-note{{include the header <xmmintrin.h> or explicitly provide a declaration for '_mm_getcsr'}}
----------------
agutowski wrote:
> rnk wrote:
> > Can you add a C++ test? I think you'll get "undeclared identifier '_mm_getcsr'" instead of this helpful diagnostic.
> This diagnostic works also in C++, although that's not the case with _byteswap functions - if they are LIBBUILTINs, the C++ diagnostic doesn't work, and LANGBUILTINs doesn't have header dependencies. I can create another thing like TARGET_HEADER_BUILTIN, but I don't know if that's a good idea.
OK, it seems fine as is.

Given that there are no diagnostic differences, I would suggest copy-pasting the RUN line at the top of this file and adding `-x c++` to avoid duplicating the whole test.


https://reviews.llvm.org/D24330





More information about the cfe-commits mailing list