[compiler-rt] d92a484 - [compiler-rt][AArch64][NFCI] Use CONSTRUCTOR_ATTRIBUTE in sme-abi-vg.c (#101159)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 06:48:42 PDT 2024


Author: Alex Bradbury
Date: 2024-07-30T14:48:39+01:00
New Revision: d92a484e6f5c9063d82ca79405bb3557d88ad575

URL: https://github.com/llvm/llvm-project/commit/d92a484e6f5c9063d82ca79405bb3557d88ad575
DIFF: https://github.com/llvm/llvm-project/commit/d92a484e6f5c9063d82ca79405bb3557d88ad575.diff

LOG: [compiler-rt][AArch64][NFCI] Use CONSTRUCTOR_ATTRIBUTE in sme-abi-vg.c (#101159)

sme-abi-vg.c includes cpu_model/aarch64.h which includes cpu_model.h
which has an equivalent define for `CONSTRUCTOR_ATTRIBUTE` that has the
same checks for the GCC version that we repeat here. Just use that,
rather than repeating the same logic.

Added: 
    

Modified: 
    compiler-rt/lib/builtins/aarch64/sme-abi-vg.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/aarch64/sme-abi-vg.c b/compiler-rt/lib/builtins/aarch64/sme-abi-vg.c
index 20061012e16c6..4b9ee8c1d382d 100644
--- a/compiler-rt/lib/builtins/aarch64/sme-abi-vg.c
+++ b/compiler-rt/lib/builtins/aarch64/sme-abi-vg.c
@@ -10,10 +10,7 @@ struct FEATURES {
 
 extern struct FEATURES __aarch64_cpu_features;
 
-#if __GNUC__ >= 9
-#pragma GCC diagnostic ignored "-Wprio-ctor-dtor"
-#endif
-__attribute__((constructor(90))) static void get_aarch64_cpu_features(void) {
+CONSTRUCTOR_ATTRIBUTE static void get_aarch64_cpu_features(void) {
   if (__atomic_load_n(&__aarch64_cpu_features.features, __ATOMIC_RELAXED))
     return;
 


        


More information about the llvm-commits mailing list