[PATCH] D77829: [libunwind] Clean up __arm64__

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 14:25:00 PDT 2020


MaskRay created this revision.
MaskRay added reviewers: libunwind, ldionne, scw.
Herald added subscribers: libcxx-commits, llvm-commits, danielkiss, dexonsmith, kristof.beyls.
Herald added projects: LLVM, libunwind.
Herald added 1 blocking reviewer(s): libunwind.
MaskRay edited the summary of this revision.

`__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`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77829

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


Index: libunwind/src/config.h
===================================================================
--- libunwind/src/config.h
+++ 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)
Index: libunwind/src/assembly.h
===================================================================
--- libunwind/src/assembly.h
+++ 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 ;
Index: libunwind/src/Unwind_AppleExtras.cpp
===================================================================
--- libunwind/src/Unwind_AppleExtras.cpp
+++ libunwind/src/Unwind_AppleExtras.cpp
@@ -56,7 +56,7 @@
           __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
Index: libunwind/src/UnwindRegistersSave.S
===================================================================
--- libunwind/src/UnwindRegistersSave.S
+++ libunwind/src/UnwindRegistersSave.S
@@ -697,7 +697,7 @@
   blr
 
 
-#elif defined(__arm64__) || defined(__aarch64__)
+#elif defined(__aarch64__)
 
 //
 // extern int __unw_getcontext(unw_context_t* thread_state)
Index: libunwind/src/UnwindRegistersRestore.S
===================================================================
--- libunwind/src/UnwindRegistersRestore.S
+++ libunwind/src/UnwindRegistersRestore.S
@@ -557,7 +557,7 @@
   lwz     %r3,  20(%r3)   // do r3 last
   bctr
 
-#elif defined(__arm64__) || defined(__aarch64__)
+#elif defined(__aarch64__)
 
 //
 // void libunwind::Registers_arm64::jumpto()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77829.256409.patch
Type: text/x-patch
Size: 2416 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200409/cfbec41c/attachment.bin>


More information about the llvm-commits mailing list