This revision was automatically updated to reflect the committed changes. Closed by commit rG16af23fae8ad: [clang][Headers] Use __has_builtin instead of _MSC_VER. (authored by Bigcheese).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75719/new/ https://reviews.llvm.org/D75719 Files: clang/lib/Headers/arm_acle.h clang/test/Headers/arm-acle-header.c Index: clang/test/Headers/arm-acle-header.c =================================================================== --- clang/test/Headers/arm-acle-header.c +++ clang/test/Headers/arm-acle-header.c @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -x c++ -triple thumbv7-windows -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s // RUN: %clang_cc1 -x c++ -triple thumbv7-windows -target-cpu cortex-a15 -fsyntax-only -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=19.11 %s // RUN: %clang_cc1 -x c++ -triple aarch64-windows -target-cpu cortex-a53 -fsyntax-only -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=19.11 %s +// RUN: %clang_cc1 -x c++ -triple arm64-apple-ios -target-cpu apple-a7 -fsyntax-only -ffreestanding -fms-extensions %s // expected-no-diagnostics #include <arm_acle.h> Index: clang/lib/Headers/arm_acle.h =================================================================== --- clang/lib/Headers/arm_acle.h +++ clang/lib/Headers/arm_acle.h @@ -22,31 +22,43 @@ /* 8 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */ /* 8.3 Memory barriers */ -#if !defined(_MSC_VER) +#if !__has_builtin(__dmb) #define __dmb(i) __builtin_arm_dmb(i) +#endif +#if !__has_builtin(__dsb) #define __dsb(i) __builtin_arm_dsb(i) +#endif +#if !__has_builtin(__isb) #define __isb(i) __builtin_arm_isb(i) #endif /* 8.4 Hints */ -#if !defined(_MSC_VER) +#if !__has_builtin(__wfi) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __wfi(void) { __builtin_arm_wfi(); } +#endif +#if !__has_builtin(__wfe) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __wfe(void) { __builtin_arm_wfe(); } +#endif +#if !__has_builtin(__sev) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __sev(void) { __builtin_arm_sev(); } +#endif +#if !__has_builtin(__sevl) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __sevl(void) { __builtin_arm_sevl(); } +#endif +#if !__has_builtin(__yield) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __yield(void) { __builtin_arm_yield(); }
Index: clang/test/Headers/arm-acle-header.c =================================================================== --- clang/test/Headers/arm-acle-header.c +++ clang/test/Headers/arm-acle-header.c @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -x c++ -triple thumbv7-windows -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s // RUN: %clang_cc1 -x c++ -triple thumbv7-windows -target-cpu cortex-a15 -fsyntax-only -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=19.11 %s // RUN: %clang_cc1 -x c++ -triple aarch64-windows -target-cpu cortex-a53 -fsyntax-only -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=19.11 %s +// RUN: %clang_cc1 -x c++ -triple arm64-apple-ios -target-cpu apple-a7 -fsyntax-only -ffreestanding -fms-extensions %s // expected-no-diagnostics #include <arm_acle.h> Index: clang/lib/Headers/arm_acle.h =================================================================== --- clang/lib/Headers/arm_acle.h +++ clang/lib/Headers/arm_acle.h @@ -22,31 +22,43 @@ /* 8 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */ /* 8.3 Memory barriers */ -#if !defined(_MSC_VER) +#if !__has_builtin(__dmb) #define __dmb(i) __builtin_arm_dmb(i) +#endif +#if !__has_builtin(__dsb) #define __dsb(i) __builtin_arm_dsb(i) +#endif +#if !__has_builtin(__isb) #define __isb(i) __builtin_arm_isb(i) #endif /* 8.4 Hints */ -#if !defined(_MSC_VER) +#if !__has_builtin(__wfi) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __wfi(void) { __builtin_arm_wfi(); } +#endif +#if !__has_builtin(__wfe) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __wfe(void) { __builtin_arm_wfe(); } +#endif +#if !__has_builtin(__sev) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __sev(void) { __builtin_arm_sev(); } +#endif +#if !__has_builtin(__sevl) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __sevl(void) { __builtin_arm_sevl(); } +#endif +#if !__has_builtin(__yield) static __inline__ void __attribute__((__always_inline__, __nodebug__)) __yield(void) { __builtin_arm_yield(); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits