+2015-05-11 Christian Bruel <christian.bruel@st.com>
+
+ * config/arm/arm-protos.h (arm_declare_function_name): Declare.
+ (is_called_in_ARM_mode): Remove.
+ * config/arm/arm.c (is_called_in_ARM_mode): Declare static bool.
+ (arm_declare_function_name): Moved from from ARM_DECLARE_FUNCTION_NAME.
+ * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Call
+ arm_declare_function_name.
+
2015-05-11 Christian Bruel <christian.bruel@st.com>
* config/arm/arm.c (arm_option_override): Reoganized and split into :
extern int arm_volatile_func (void);
extern void arm_expand_prologue (void);
extern void arm_expand_epilogue (bool);
+extern void arm_declare_function_name (FILE *, const char *, tree);
extern void thumb2_expand_return (bool);
extern const char *arm_strip_name_encoding (const char *);
extern void arm_asm_output_labelref (FILE *, const char *);
extern void thumb1_expand_prologue (void);
extern void thumb1_expand_epilogue (void);
extern const char *thumb1_output_interwork (void);
-#ifdef TREE_CODE
-extern int is_called_in_ARM_mode (tree);
-#endif
extern int thumb_shiftable_const (unsigned HOST_WIDE_INT);
#ifdef RTX_CODE
extern enum arm_cond_code maybe_get_arm_condition_code (rtx);
static unsigned bit_count (unsigned long);
static int arm_address_register_rtx_p (rtx, int);
static int arm_legitimate_index_p (machine_mode, rtx, RTX_CODE, int);
+static bool is_called_in_ARM_mode (tree);
static int thumb2_legitimate_index_p (machine_mode, rtx, int);
static int thumb1_base_register_rtx_p (rtx, machine_mode, int);
static rtx arm_legitimize_address (rtx, rtx, machine_mode);
}
/* Return nonzero if FUNC must be entered in ARM mode. */
-int
+static bool
is_called_in_ARM_mode (tree func)
{
gcc_assert (TREE_CODE (func) == FUNCTION_DECL);
/* Ignore the problem about functions whose address is taken. */
if (TARGET_CALLEE_INTERWORKING && TREE_PUBLIC (func))
- return TRUE;
+ return true;
#ifdef ARM_PE
return lookup_attribute ("interfacearm", DECL_ATTRIBUTES (func)) != NULL_TREE;
#else
- return FALSE;
+ return false;
#endif
}
&& CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)));
}
+void
+arm_declare_function_name (FILE *stream, const char *name, tree decl)
+{
+ if (TARGET_THUMB)
+ {
+ if (is_called_in_ARM_mode (decl)
+ || (TARGET_THUMB1 && !TARGET_THUMB1_ONLY
+ && cfun->is_thunk))
+ fprintf (stream, "\t.code 32\n");
+ else if (TARGET_THUMB1)
+ fprintf (stream, "\t.code\t16\n\t.thumb_func\n");
+ else
+ fprintf (stream, "\t.thumb\n\t.thumb_func\n");
+ }
+
+ if (TARGET_POKE_FUNCTION_NAME)
+ arm_poke_function_name (stream, (const char *) name);
+}
+
/* If MEM is in the form of [base+offset], extract the two parts
of address and set to BASE and OFFSET, otherwise return false
after clearing BASE and OFFSET. */
? 1 : 0)
#define ARM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
- do \
- { \
- if (TARGET_THUMB) \
- { \
- if (is_called_in_ARM_mode (DECL) \
- || (TARGET_THUMB1 && !TARGET_THUMB1_ONLY \
- && cfun->is_thunk)) \
- fprintf (STREAM, "\t.code 32\n") ; \
- else if (TARGET_THUMB1) \
- fprintf (STREAM, "\t.code\t16\n\t.thumb_func\n") ; \
- else \
- fprintf (STREAM, "\t.thumb\n\t.thumb_func\n") ; \
- } \
- if (TARGET_POKE_FUNCTION_NAME) \
- arm_poke_function_name (STREAM, (const char *) NAME); \
- } \
- while (0)
+ arm_declare_function_name ((STREAM), (NAME), (DECL));
/* For aliases of functions we use .thumb_set instead. */
#define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL1, DECL2) \