[libunwind] f3d460c - [libunwind] Clean up __arm64__

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 9 15:47:00 PDT 2020


Author: Fangrui Song
Date: 2020-04-09T15:46:48-07:00
New Revision: f3d460ce5874e4dd12b8cf8b227de4cec43a685c

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

LOG: [libunwind] Clean up __arm64__

`__aarch64__` is defined for the target (since the beginning of arm64 support: clang 3.5).
`__arm64__` is only defined for the Darwin OS on AArch64.

`defined(__aarch64__) || defined(__arm64__)` can be simplied as `defined(__aarch64__)`

Darwin AArch64 uses %% as the assembly separator (see AArch64MCAsmInfo.cpp).
Make the intention explicit in src/assembly.h

With this change, the libunwind code base has no reference of `__arm64__`/`__arm64`.

Reviewed By: #libunwind, ldionne, mstorsjo

Differential Revision: https://reviews.llvm.org/D77829

Added: 
    

Modified: 
    libunwind/src/UnwindRegistersRestore.S
    libunwind/src/UnwindRegistersSave.S
    libunwind/src/Unwind_AppleExtras.cpp
    libunwind/src/assembly.h
    libunwind/src/config.h

Removed: 
    


################################################################################
diff  --git a/libunwind/src/UnwindRegistersRestore.S b/libunwind/src/UnwindRegistersRestore.S
index cbb2fd447005..266da5e82229 100644
--- a/libunwind/src/UnwindRegistersRestore.S
+++ b/libunwind/src/UnwindRegistersRestore.S
@@ -557,7 +557,7 @@ Lnovec:
   lwz     %r3,  20(%r3)   // do r3 last
   bctr
 
-#elif defined(__arm64__) || defined(__aarch64__)
+#elif defined(__aarch64__)
 
 //
 // void libunwind::Registers_arm64::jumpto()

diff  --git a/libunwind/src/UnwindRegistersSave.S b/libunwind/src/UnwindRegistersSave.S
index da91abc233de..5a89d1965d62 100644
--- a/libunwind/src/UnwindRegistersSave.S
+++ b/libunwind/src/UnwindRegistersSave.S
@@ -697,7 +697,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
   blr
 
 
-#elif defined(__arm64__) || defined(__aarch64__)
+#elif defined(__aarch64__)
 
 //
 // extern int __unw_getcontext(unw_context_t* thread_state)

diff  --git a/libunwind/src/Unwind_AppleExtras.cpp b/libunwind/src/Unwind_AppleExtras.cpp
index 248d99570e94..536303993eff 100644
--- a/libunwind/src/Unwind_AppleExtras.cpp
+++ b/libunwind/src/Unwind_AppleExtras.cpp
@@ -56,7 +56,7 @@ struct libgcc_object_info {
           __attribute__((visibility("default"))) const char sym##_tmp42 = 0; \
        extern const char sym##_tmp43 __asm("$ld$hide$os4.3$_" #sym ); \
           __attribute__((visibility("default"))) const char sym##_tmp43 = 0;
-#elif defined(__arm64__)
+#elif defined(__aarch64__)
   #define NOT_HERE_BEFORE_10_6(sym)
   #define NEVER_HERE(sym)
 #else

diff  --git a/libunwind/src/assembly.h b/libunwind/src/assembly.h
index 7132b6c561b0..2c1337bd53b1 100644
--- a/libunwind/src/assembly.h
+++ b/libunwind/src/assembly.h
@@ -28,7 +28,7 @@
 #ifdef _ARCH_PWR8
 #define PPC64_HAS_VMX
 #endif
-#elif defined(__arm64__)
+#elif defined(__APPLE__) && defined(__aarch64__)
 #define SEPARATOR %%
 #else
 #define SEPARATOR ;

diff  --git a/libunwind/src/config.h b/libunwind/src/config.h
index 5658b3210cf3..bce53c2f65b2 100644
--- a/libunwind/src/config.h
+++ b/libunwind/src/config.h
@@ -102,7 +102,7 @@
 #if defined(__i386__) || defined(__x86_64__) ||                                \
     defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
     (!defined(__APPLE__) && defined(__arm__)) ||                               \
-    (defined(__arm64__) || defined(__aarch64__)) ||                            \
+    defined(__aarch64__) ||                                                    \
     defined(__mips__) ||                                                       \
     defined(__riscv)
 #if !defined(_LIBUNWIND_BUILD_SJLJ_APIS)


        


More information about the cfe-commits mailing list