[PATCH] D139749: Headers: make a couple of builtins non-static

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 9 16:38:04 PST 2022


compnerd created this revision.
compnerd added a reviewer: aaron.ballman.
Herald added a project: All.
compnerd requested review of this revision.
Herald added a project: clang.

When building with the 17.5.0 preview toolset for MSVC and building with modules, the definition of `_addcarry_u64` and `_subborrow_u64` seem to cause issues due to the `static` definition following the non-static declaration in the MSVC headers.  Elide the `static` storage class on the declaration in MSVC mode.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139749

Files:
  clang/lib/Headers/adxintrin.h


Index: clang/lib/Headers/adxintrin.h
===================================================================
--- clang/lib/Headers/adxintrin.h
+++ clang/lib/Headers/adxintrin.h
@@ -43,7 +43,10 @@
 }
 
 #ifdef __x86_64__
-static __inline unsigned char __DEFAULT_FN_ATTRS
+#if !defined(_MSC_VER)
+static
+#endif
+__inline unsigned char __DEFAULT_FN_ATTRS
 _addcarry_u64(unsigned char __cf, unsigned long long __x,
               unsigned long long __y, unsigned long long  *__p)
 {
@@ -59,7 +62,10 @@
 }
 
 #ifdef __x86_64__
-static __inline unsigned char __DEFAULT_FN_ATTRS
+#if !defined(_MSC_VER)
+static
+#endif
+__inline unsigned char __DEFAULT_FN_ATTRS
 _subborrow_u64(unsigned char __cf, unsigned long long __x,
                unsigned long long __y, unsigned long long  *__p)
 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139749.481784.patch
Type: text/x-patch
Size: 781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221210/262759dc/attachment.bin>


More information about the cfe-commits mailing list