From 1ca92bdca07e3a3cac4885e6b0e1b30e50acae39 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 7 Apr 2017 07:02:07 +0000 Subject: [PATCH] ARM: Introduce ARM_DEFAULT_SHORT_ENUMS Allow targets to define the default for the short enums option. 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. From-SVN: r246753 --- gcc/ChangeLog | 8 ++++++++ gcc/config/arm/arm.c | 3 +-- gcc/config/arm/arm.h | 6 ++++++ gcc/config/arm/rtems.h | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc518ee559f..4334fcfffff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-04-07 Sebastian Huber + + * 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. + 2017-04-06 Jakub Jelinek PR debug/80234 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 931c72d46f5..a9b61a33942 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -26549,12 +26549,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 4dab73d37be..275004af938 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 53cd9879552..b34bbe8a063 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 -- 2.30.2