This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH v2] ARM: Introduce ARM_DEFAULT_SHORT_ENUMS
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Apr 2017 12:38:04 +0200
- Subject: [PATCH v2] ARM: Introduce ARM_DEFAULT_SHORT_ENUMS
- Authentication-results: sourceware.org; auth=none
Allow targets to define the default for the short enums option.
v2: Move ARM_DEFAULT_SHORT_ENUMS to arm.h.
gcc/
* config/arm/arm.h: (ARM_DEFAULT_SHORT_ENUMS): Provide default
definition.
* config/arm/arm.c: (arm_default_short_enums): Use
ARM_DEFAULT_SHORT_ENUMS.
* config/arm/rtems.h (ARM_DEFAULT_SHORT_ENUMS) Define.
---
gcc/config/arm/arm.c | 3 +--
gcc/config/arm/arm.h | 6 ++++++
gcc/config/arm/rtems.h | 2 ++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index bc1e607..8f45bb9 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -26546,12 +26546,11 @@ arm_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
return mode;
}
-/* AAPCS based ABIs use short enums by default. */
static bool
arm_default_short_enums (void)
{
- return TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX;
+ return ARM_DEFAULT_SHORT_ENUMS;
}
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 4dab73d..275004a 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -343,6 +343,12 @@ extern int arm_fpu_attr;
#define ARM_DEFAULT_ABI ARM_ABI_APCS
#endif
+/* AAPCS based ABIs use short enums by default. */
+#ifndef ARM_DEFAULT_SHORT_ENUMS
+#define ARM_DEFAULT_SHORT_ENUMS \
+ (TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX)
+#endif
+
/* Map each of the micro-architecture variants to their corresponding
major architecture revision. */
diff --git a/gcc/config/arm/rtems.h b/gcc/config/arm/rtems.h
index 53cd987..b34bbe8 100644
--- a/gcc/config/arm/rtems.h
+++ b/gcc/config/arm/rtems.h
@@ -27,3 +27,5 @@
builtin_assert ("system=rtems"); \
TARGET_BPABI_CPP_BUILTINS(); \
} while (0)
+
+#define ARM_DEFAULT_SHORT_ENUMS false
--
1.8.4.5