avr.c (STR_PREFIX_P): New Define.

* config/avr/avr.c (STR_PREFIX_P): New Define.
	(avr_asm_declare_function_name): Use it.
	(avr_asm_named_section): Use it.
	(avr_section_type_flags): Use it.

From-SVN: r178062
This commit is contained in:
Georg-Johann Lay 2011-08-25 13:46:35 +00:00 committed by Georg-Johann Lay
parent cbba4777cd
commit f2814222f9
2 changed files with 18 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2011-08-25 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.c (STR_PREFIX_P): New Define.
(avr_asm_declare_function_name): Use it.
(avr_asm_named_section): Use it.
(avr_section_type_flags): Use it.
2011-08-25 Bernd Schmidt <bernds@codesourcery.com>
* doc/md.texi (automata_option): Document collapse-ndfa.

View File

@ -51,6 +51,9 @@
/* Maximal allowed offset for an address in the LD command */
#define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE))
/* Return true if STR starts with PREFIX and false, otherwise. */
#define STR_PREFIX_P(STR,PREFIX) (0 == strncmp (STR, PREFIX, strlen (PREFIX)))
static void avr_option_override (void);
static int avr_naked_function_p (tree);
static int interrupt_function_p (tree);
@ -4852,7 +4855,7 @@ avr_asm_declare_function_name (FILE *file, const char *name, tree decl)
if (cfun->machine->is_interrupt)
{
if (strncmp (name, "__vector", strlen ("__vector")) != 0)
if (!STR_PREFIX_P (name, "__vector"))
{
warning_at (DECL_SOURCE_LOCATION (decl), 0,
"%qs appears to be a misspelled interrupt handler",
@ -4861,7 +4864,7 @@ avr_asm_declare_function_name (FILE *file, const char *name, tree decl)
}
else if (cfun->machine->is_signal)
{
if (strncmp (name, "__vector", strlen ("__vector")) != 0)
if (!STR_PREFIX_P (name, "__vector"))
{
warning_at (DECL_SOURCE_LOCATION (decl), 0,
"%qs appears to be a misspelled signal handler",
@ -5116,12 +5119,12 @@ static void
avr_asm_named_section (const char *name, unsigned int flags, tree decl)
{
if (!avr_need_copy_data_p)
avr_need_copy_data_p = (0 == strncmp (name, ".data", 5)
|| 0 == strncmp (name, ".rodata", 7)
|| 0 == strncmp (name, ".gnu.linkonce.d", 15));
avr_need_copy_data_p = (STR_PREFIX_P (name, ".data")
|| STR_PREFIX_P (name, ".rodata")
|| STR_PREFIX_P (name, ".gnu.linkonce.d"));
if (!avr_need_clear_bss_p)
avr_need_clear_bss_p = (0 == strncmp (name, ".bss", 4));
avr_need_clear_bss_p = STR_PREFIX_P (name, ".bss");
default_elf_asm_named_section (name, flags, decl);
}
@ -5131,7 +5134,7 @@ avr_section_type_flags (tree decl, const char *name, int reloc)
{
unsigned int flags = default_section_type_flags (decl, name, reloc);
if (strncmp (name, ".noinit", 7) == 0)
if (STR_PREFIX_P (name, ".noinit"))
{
if (decl && TREE_CODE (decl) == VAR_DECL
&& DECL_INITIAL (decl) == NULL_TREE)
@ -5141,7 +5144,7 @@ avr_section_type_flags (tree decl, const char *name, int reloc)
".noinit section");
}
if (0 == strncmp (name, ".progmem.data", strlen (".progmem.data")))
if (STR_PREFIX_P (name, ".progmem.data"))
flags &= ~SECTION_WRITE;
return flags;