[PATCH] D157297: [clang] Fixes compile error that double colon operator cannot resolve macro with parentheses.

Yonggang Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 15 20:48:42 PDT 2023


lygstate updated this revision to Diff 550587.
lygstate added a comment.

Revert to version 1


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157297/new/

https://reviews.llvm.org/D157297

Files:
  clang/lib/Headers/bmiintrin.h


Index: clang/lib/Headers/bmiintrin.h
===================================================================
--- clang/lib/Headers/bmiintrin.h
+++ clang/lib/Headers/bmiintrin.h
@@ -19,7 +19,7 @@
    to use it as a potentially faster version of BSF. */
 #define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
 
-#define _tzcnt_u16(a)     (__tzcnt_u16((a)))
+#define _tzcnt_u16 __tzcnt_u16
 
 /// Counts the number of trailing zero bits in the operand.
 ///
@@ -71,7 +71,7 @@
   return (int)__builtin_ia32_tzcnt_u32(__X);
 }
 
-#define _tzcnt_u32(a)     (__tzcnt_u32((a)))
+#define _tzcnt_u32 __tzcnt_u32
 
 #ifdef __x86_64__
 
@@ -109,7 +109,7 @@
   return (long long)__builtin_ia32_tzcnt_u64(__X);
 }
 
-#define _tzcnt_u64(a)     (__tzcnt_u64((a)))
+#define _tzcnt_u64 __tzcnt_u64
 
 #endif /* __x86_64__ */
 
@@ -121,14 +121,14 @@
 /* Define the default attributes for the functions in this file. */
 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi")))
 
-#define _andn_u32(a, b)   (__andn_u32((a), (b)))
+#define _andn_u32 __andn_u32
 
 /* _bextr_u32 != __bextr_u32 */
-#define _blsi_u32(a)      (__blsi_u32((a)))
+#define _blsi_u32 __blsi_u32
 
-#define _blsmsk_u32(a)    (__blsmsk_u32((a)))
+#define _blsmsk_u32 __blsmsk_u32
 
-#define _blsr_u32(a)      (__blsr_u32((a)))
+#define _blsr_u32 __blsr_u32
 
 /// Performs a bitwise AND of the second operand with the one's
 ///    complement of the first operand.
@@ -272,14 +272,14 @@
 
 #ifdef __x86_64__
 
-#define _andn_u64(a, b)   (__andn_u64((a), (b)))
+#define _andn_u64 __andn_u64
 
 /* _bextr_u64 != __bextr_u64 */
-#define _blsi_u64(a)      (__blsi_u64((a)))
+#define _blsi_u64 __blsi_u64
 
-#define _blsmsk_u64(a)    (__blsmsk_u64((a)))
+#define _blsmsk_u64 __blsmsk_u64
 
-#define _blsr_u64(a)      (__blsr_u64((a)))
+#define _blsr_u64 __blsr_u64
 
 /// Performs a bitwise AND of the second operand with the one's
 ///    complement of the first operand.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157297.550587.patch
Type: text/x-patch
Size: 1975 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230816/71344a69/attachment-0001.bin>


More information about the cfe-commits mailing list