diff options
author | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-25 09:21:59 +0000 |
---|---|---|
committer | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-25 09:21:59 +0000 |
commit | d88fa80dc9391e6a7c235f97739424437cdd6919 (patch) | |
tree | dcb67ae11c5c515c729f01554c35f9e907b4014d | |
parent | 9580cb79b8554e257e618ffa16ebc20c61b9c21f (diff) | |
download | gcc-d88fa80dc9391e6a7c235f97739424437cdd6919.tar.gz |
* config/v850/v850.c (GHS_default_section_names): Change to const
char * type.
(GHS_current_section_names): Likewise.
(v850_insert_attributes): Do not build strings, just assign the
names directly. Change the type of 'chosen_section' to const
char*.
* config/v850/v850-c.c (ghs_pragma_section): Assign the alias
directly to the array entry.
* config/v850/v850.h (GHS_default_section_names): Change to const
char * type.
(GHS_current_section_names): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211972 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/config/v850/v850-c.c | 3 | ||||
-rw-r--r-- | gcc/config/v850/v850.c | 16 | ||||
-rw-r--r-- | gcc/config/v850/v850.h | 6 |
4 files changed, 26 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dcbb23bd4b2..79847e3f7ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2014-06-25 Nick Clifton <nickc@redhat.com> + + * config/v850/v850.c (GHS_default_section_names): Change to const + char * type. + (GHS_current_section_names): Likewise. + (v850_insert_attributes): Do not build strings, just assign the + names directly. Change the type of 'chosen_section' to const + char*. + * config/v850/v850-c.c (ghs_pragma_section): Assign the alias + directly to the array entry. + * config/v850/v850.h (GHS_default_section_names): Change to const + char * type. + (GHS_current_section_names): Likewise. + 2014-06-25 Jakub Jelinek <jakub@redhat.com> * langhooks-def.h (LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR): Define. diff --git a/gcc/config/v850/v850-c.c b/gcc/config/v850/v850-c.c index 4c2e052cf37..ffd55e48730 100644 --- a/gcc/config/v850/v850-c.c +++ b/gcc/config/v850/v850-c.c @@ -175,8 +175,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED) if (streq (alias, "default")) GHS_current_section_names [kind] = NULL; else - GHS_current_section_names [kind] = - build_string (strlen (alias) + 1, alias); + GHS_current_section_names [kind] = alias; } while (repeat); diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index f736c44bae8..02b842780b3 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -54,8 +54,8 @@ static void v850_print_operand_address (FILE *, rtx); /* Names of the various data areas used on the v850. */ -tree GHS_default_section_names [(int) COUNT_OF_GHS_SECTION_KINDS]; -tree GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_KINDS]; +const char * GHS_default_section_names [(int) COUNT_OF_GHS_SECTION_KINDS]; +const char * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_KINDS]; /* Track the current data area set by the data area pragma (which can be nested). Tested by check_default_data_area. */ @@ -2569,19 +2569,19 @@ v850_insert_attributes (tree decl, tree * attr_ptr ATTRIBUTE_UNUSED ) if (GHS_default_section_names [(int) GHS_SECTION_KIND_SDATA] == NULL) { GHS_default_section_names [(int) GHS_SECTION_KIND_SDATA] - = build_string (sizeof (".sdata")-1, ".sdata"); + = ".sdata"; GHS_default_section_names [(int) GHS_SECTION_KIND_ROSDATA] - = build_string (sizeof (".rosdata")-1, ".rosdata"); + = ".rosdata"; GHS_default_section_names [(int) GHS_SECTION_KIND_TDATA] - = build_string (sizeof (".tdata")-1, ".tdata"); + = ".tdata"; GHS_default_section_names [(int) GHS_SECTION_KIND_ZDATA] - = build_string (sizeof (".zdata")-1, ".zdata"); + = ".zdata"; GHS_default_section_names [(int) GHS_SECTION_KIND_ROZDATA] - = build_string (sizeof (".rozdata")-1, ".rozdata"); + = ".rozdata"; } if (current_function_decl == NULL_TREE @@ -2592,7 +2592,7 @@ v850_insert_attributes (tree decl, tree * attr_ptr ATTRIBUTE_UNUSED ) && !DECL_SECTION_NAME (decl)) { enum GHS_section_kind kind = GHS_SECTION_KIND_DEFAULT; - tree chosen_section; + const char * chosen_section; if (TREE_CODE (decl) == FUNCTION_DECL) kind = GHS_SECTION_KIND_TEXT; diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index 6ccdc5d6514..5df3c1ca5db 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -916,7 +916,7 @@ typedef enum For the *normal* section kinds (like .data, .text, etc.) we do not want to explicitly force the name of these sections, but would rather let the linker (or at least the back end) choose the name of the - section, UNLESS the user has force a specific name for these section + section, UNLESS the user has forced a specific name for these section kinds. To accomplish this set the name in ghs_default_section_names to null. */ @@ -952,8 +952,8 @@ typedef struct data_area_stack_element extern data_area_stack_element * data_area_stack; /* Names of the various data areas used on the v850. */ -extern tree GHS_default_section_names [(int) COUNT_OF_GHS_SECTION_KINDS]; -extern tree GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_KINDS]; +extern const char * GHS_default_section_names [(int) COUNT_OF_GHS_SECTION_KINDS]; +extern const char * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_KINDS]; /* The assembler op to start the file. */ |