[libc-commits] [libc] a3f21a3 - [libc] Remove LIBC_HAS_ATTRIBUTE macro (#86656)
via libc-commits
libc-commits at lists.llvm.org
Tue Mar 26 13:22:18 PDT 2024
Author: Vinayak Dev
Date: 2024-03-26T13:22:14-07:00
New Revision: a3f21a32495abeaddfa64a9789cd8c1b3fdad87c
URL: https://github.com/llvm/llvm-project/commit/a3f21a32495abeaddfa64a9789cd8c1b3fdad87c
DIFF: https://github.com/llvm/llvm-project/commit/a3f21a32495abeaddfa64a9789cd8c1b3fdad87c.diff
LOG: [libc] Remove LIBC_HAS_ATTRIBUTE macro (#86656)
Resolves #86547
Replace occurrences of the macro `LIBC_HAS_ATTRIBUTE` with `__has_attribute`.
Added:
Modified:
libc/src/__support/macros/config.h
libc/test/src/__support/arg_list_test.cpp
Removed:
################################################################################
diff --git a/libc/src/__support/macros/config.h b/libc/src/__support/macros/config.h
index fcc8f551a783fe..6666c136669610 100644
--- a/libc/src/__support/macros/config.h
+++ b/libc/src/__support/macros/config.h
@@ -39,12 +39,4 @@
#define LIBC_HAS_FEATURE(f) 0
#endif
-// Compiler attribute-detection.
-// https://clang.llvm.org/docs/LanguageExtensions.html#has-attribute
-#ifdef __has_attribute
-#define LIBC_HAS_ATTRIBUTE(f) __has_attribute(f)
-#else
-#define LIBC_HAS_ATTRIBUTE(f) 0
-#endif
-
#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_CONFIG_H
diff --git a/libc/test/src/__support/arg_list_test.cpp b/libc/test/src/__support/arg_list_test.cpp
index 1876cf7f70b4b8..4f229e2bfe6940 100644
--- a/libc/test/src/__support/arg_list_test.cpp
+++ b/libc/test/src/__support/arg_list_test.cpp
@@ -120,7 +120,7 @@ TEST(LlvmLibcArgListTest, TestStructTypes) {
}
// Test vector extensions from clang.
-#if LIBC_HAS_ATTRIBUTE(ext_vector_type)
+#if __has_attribute(ext_vector_type)
using int1 = int __attribute__((ext_vector_type(1)));
using int2 = int __attribute__((ext_vector_type(2)));
More information about the libc-commits
mailing list