[libcxxabi] r228663 - unwind: clean up -Wundef warnings

Saleem Abdulrasool compnerd at compnerd.org
Mon Feb 9 19:43:28 PST 2015


Author: compnerd
Date: Mon Feb  9 21:43:28 2015
New Revision: 228663

URL: http://llvm.org/viewvc/llvm-project?rev=228663&view=rev
Log:
unwind: clean up -Wundef warnings

The unified register management interfaces had multiple naked macros for
conditional logic.  This cleans them up to use the defined() form, avoiding
-Wundef warnings.  NFC.

Modified:
    libcxxabi/trunk/src/Unwind/UnwindRegistersRestore.S
    libcxxabi/trunk/src/Unwind/UnwindRegistersSave.S

Modified: libcxxabi/trunk/src/Unwind/UnwindRegistersRestore.S
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindRegistersRestore.S?rev=228663&r1=228662&r2=228663&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/UnwindRegistersRestore.S (original)
+++ libcxxabi/trunk/src/Unwind/UnwindRegistersRestore.S Mon Feb  9 21:43:28 2015
@@ -52,7 +52,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li
   # skip fs
   # skip gs
 
-#elif __x86_64__
+#elif defined(__x86_64__)
 
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind16Registers_x86_646jumptoEv)
 #
@@ -93,7 +93,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li
   ret            # rip was saved here
 
 
-#elif __ppc__
+#elif defined(__ppc__)
 
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
 ;
@@ -258,7 +258,7 @@ Lnovec:
   lwz    r3,20(r3)  ; do r3 last
   bctr
 
-#elif __arm64__
+#elif defined(__arm64__)
 
 ;
 ; void libunwind::Registers_arm64::jumpto()
@@ -308,7 +308,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li
   ldp    x0, x1,  [x0, #0x000]  ; restore x0,x1
   ret    lr            ; jump to pc
 
-#elif __arm__ && !__APPLE__
+#elif defined(__arm__) && !defined(__APPLE__)
 
 #if !defined(__ARM_ARCH_ISA_ARM)
   .thumb
@@ -390,7 +390,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li
   .p2align 2
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm12restoreVFPv3EPy)
 #if defined(__ARM_FP)
-#ifndef __ARM_NEON
+#if !defined(__ARM_NEON)
   ldcl p11, cr0, [r0], {0x20}  @ vldm r0, {d16-d31}
 #else
   vldmia r0, {d16-d31}
@@ -406,7 +406,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li
 @
   .p2align 2
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm12restoreiWMMXEPy)
-#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || __ARM_WMMX
+#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || defined(__ARM_WMMX)
   ldcl p1, cr0, [r0], #8  @ wldrd wR0, [r0], #8
   ldcl p1, cr1, [r0], #8  @ wldrd wR1, [r0], #8
   ldcl p1, cr2, [r0], #8  @ wldrd wR2, [r0], #8
@@ -434,7 +434,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li
 @
   .p2align 2
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj)
-#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || __ARM_WMMX
+#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || defined(__ARM_WMMX)
   ldc2 p1, cr8, [r0], #4  @ wldrw wCGR0, [r0], #4
   ldc2 p1, cr9, [r0], #4  @ wldrw wCGR1, [r0], #4
   ldc2 p1, cr10, [r0], #4  @ wldrw wCGR2, [r0], #4

Modified: libcxxabi/trunk/src/Unwind/UnwindRegistersSave.S
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindRegistersSave.S?rev=228663&r1=228662&r2=228663&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/UnwindRegistersSave.S (original)
+++ libcxxabi/trunk/src/Unwind/UnwindRegistersSave.S Mon Feb  9 21:43:28 2015
@@ -52,7 +52,7 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext
   xorl  %eax, %eax    # return UNW_ESUCCESS
   ret
 
-#elif __x86_64__
+#elif defined(__x86_64__)
 
 #
 # extern int unw_getcontext(unw_context_t* thread_state)
@@ -87,7 +87,7 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext
   xorl  %eax, %eax    # return UNW_ESUCCESS
   ret
 
-#elif __ppc__
+#elif defined(__ppc__)
 
 ;
 ; extern int unw_getcontext(unw_context_t* thread_state)
@@ -230,7 +230,7 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext
   blr
 
 
-#elif __arm64__
+#elif defined(__arm64__)
 
 ;
 ; extern int unw_getcontext(unw_context_t* thread_state)
@@ -280,7 +280,7 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext
   ldr    x0, #0      ; return UNW_ESUCCESS
   ret
 
-#elif __arm__ && !__APPLE__
+#elif defined(__arm__) && !defined(__APPLE__)
 
 #if !defined(__ARM_ARCH_ISA_ARM)
   .thumb
@@ -369,7 +369,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li
   @ these registers implies they are, actually, available on the target, so
   @ it's ok to execute.
   @ So, generate the instructions using the corresponding coprocessor mnemonic.
-#ifndef __ARM_NEON
+#if !defined(__ARM_NEON)
   stcl p11, cr0, [r0], {0x20}  @ vstm r0, {d16-d31}
 #else
   vstmia r0, {d16-d31}
@@ -385,7 +385,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li
 @
   .p2align 2
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm9saveiWMMXEPy)
-#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || __ARM_WMMX
+#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || defined(__ARM_WMMX)
   stcl p1, cr0, [r0], #8  @ wstrd wR0, [r0], #8
   stcl p1, cr1, [r0], #8  @ wstrd wR1, [r0], #8
   stcl p1, cr2, [r0], #8  @ wstrd wR2, [r0], #8
@@ -413,7 +413,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li
 @
   .p2align 2
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveiWMMXControlEPj)
-#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || __ARM_WMMX
+#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || defined(__ARM_WMMX)
   stc2 p1, cr8, [r0], #4  @ wstrw wCGR0, [r0], #4
   stc2 p1, cr9, [r0], #4  @ wstrw wCGR1, [r0], #4
   stc2 p1, cr10, [r0], #4  @ wstrw wCGR2, [r0], #4





More information about the cfe-commits mailing list