From 6942d5d5c0b3ee6c5c4fdc78ffb2797f59fa6c30 Mon Sep 17 00:00:00 2001 From: "Timothy B. Terriberry" Date: Thu, 14 Apr 2011 18:14:19 -0700 Subject: [PATCH] Bug 650162 - #ifdef out unused functions; r=dholbert --- xpcom/glue/arm.cpp | 59 ++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/xpcom/glue/arm.cpp b/xpcom/glue/arm.cpp index f8cf8a64cbf..1f44f09aa94 100644 --- a/xpcom/glue/arm.cpp +++ b/xpcom/glue/arm.cpp @@ -38,6 +38,7 @@ #include "arm.h" +#if defined(MOZILLA_ARM_HAVE_CPUID_DETECTION) namespace { // arm.h has parallel #ifs which declare MOZILLA_ARM_HAVE_CPUID_DETECTION. @@ -45,16 +46,17 @@ namespace { // we don't compile one of these detection methods. The detection code here is // based on the CPU detection in libtheora. -#if defined(_MSC_VER) +# if defined(_MSC_VER) //For GetExceptionCode() and EXCEPTION_ILLEGAL_INSTRUCTION. -# define WIN32_LEAN_AND_MEAN -# define WIN32_EXTRA_LEAN -# include +# define WIN32_LEAN_AND_MEAN +# define WIN32_EXTRA_LEAN +# include +# if !defined(MOZILLA_PRESUME_EDSP) static bool check_edsp(void) { -# if defined(MOZILLA_MAY_SUPPORT_EDSP) +# if defined(MOZILLA_MAY_SUPPORT_EDSP) __try { //PLD [r13] @@ -65,14 +67,16 @@ check_edsp(void) { //Ignore exception. } -# endif +# endif return false; } +# endif // !MOZILLA_PRESUME_EDSP +# if !defined(MOZILLA_PRESUME_ARMV6) static bool check_armv6(void) { -# if defined(MOZILLA_MAY_SUPPORT_ARMV6) +# if defined(MOZILLA_MAY_SUPPORT_ARMV6) __try { //SHADD8 r3,r3,r3 @@ -83,14 +87,16 @@ check_armv6(void) { //Ignore exception. } -# endif +# endif return false; } +# endif // !MOZILLA_PRESUME_ARMV6 +# if !defined(MOZILLA_PRESUME_NEON) static bool check_neon(void) { -# if defined(MOZILLA_MAY_SUPPORT_NEON) +# if defined(MOZILLA_MAY_SUPPORT_NEON) __try { //VORR q0,q0,q0 @@ -101,14 +107,15 @@ check_neon(void) { //Ignore exception. } -# endif +# endif return false; } +# endif // !MOZILLA_PRESUME_NEON -#elif defined(__linux__) || defined(ANDROID) -# include -# include -# include +# elif defined(__linux__) || defined(ANDROID) +# include +# include +# include enum{ MOZILLA_HAS_EDSP_FLAG=1, @@ -161,40 +168,46 @@ get_arm_cpu_flags(void) // Cache a local copy so we only have to read /proc/cpuinfo once. static unsigned arm_cpu_flags = get_arm_cpu_flags(); +# if !defined(MOZILLA_PRESUME_EDSP) static bool check_edsp(void) { return (arm_cpu_flags & MOZILLA_HAS_EDSP_FLAG) != 0; } +# endif +# if !defined(MOZILLA_PRESUME_ARMV6) static bool check_armv6(void) { return (arm_cpu_flags & MOZILLA_HAS_ARMV6_FLAG) != 0; } +# endif +# if !defined(MOZILLA_PRESUME_NEON) static bool check_neon(void) { return (arm_cpu_flags & MOZILLA_HAS_NEON_FLAG) != 0; +# endif } -#endif +# endif // defined(__linux__) || defined(ANDROID) } namespace mozilla { namespace arm_private { -#if defined(MOZILLA_ARM_HAVE_CPUID_DETECTION) -#if !defined(MOZILLA_PRESUME_EDSP) +# if !defined(MOZILLA_PRESUME_EDSP) bool edsp_enabled = check_edsp(); -#endif -#if !defined(MOZILLA_PRESUME_ARMV6) +# endif +# if !defined(MOZILLA_PRESUME_ARMV6) bool armv6_enabled = check_armv6(); -#endif -#if !defined(MOZILLA_PRESUME_NEON) +# endif +# if !defined(MOZILLA_PRESUME_NEON) bool neon_enabled = check_neon(); -#endif -#endif +# endif } // namespace arm_private } // namespace mozilla + +#endif // MOZILLA_ARM_HAVE_CPUID_DETECTION