diff options
author | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-03-24 15:47:29 +0000 |
---|---|---|
committer | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-03-24 15:47:29 +0000 |
commit | d7f038f87955f9782e74b6793c0abffc7475d984 (patch) | |
tree | 6379f07851f0c1e536864e3be9ce87acbb15486d /gcc/config/m32r | |
parent | 05d12ea6e0ead58ea366b27b01c0f01337edf7e2 (diff) | |
download | gcc-d7f038f87955f9782e74b6793c0abffc7475d984.tar.gz |
Accept both 'model' and '__model__' as attribute names.
Ref: CR 100400-990301-CR-1
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25948 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/m32r')
-rw-r--r-- | gcc/config/m32r/m32r.c | 75 |
1 files changed, 47 insertions, 28 deletions
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index 4adf8eac922..ddc052b365b 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -190,25 +190,6 @@ init_reg_tables () } } -static tree interrupt_ident; -static tree model_ident; -static tree small_ident; -static tree medium_ident; -static tree large_ident; - -static void -init_idents () -{ - if (interrupt_ident == 0) - { - interrupt_ident = get_identifier ("interrupt"); - model_ident = get_identifier ("model"); - small_ident = get_identifier ("small"); - medium_ident = get_identifier ("medium"); - large_ident = get_identifier ("large"); - } -} - /* M32R specific attribute support. interrupt - for interrupt functions @@ -222,6 +203,35 @@ init_idents () Grep for MODEL in m32r.h for more info. */ +static tree interrupt_ident1; +static tree interrupt_ident2; +static tree model_ident1; +static tree model_ident2; +static tree small_ident1; +static tree small_ident2; +static tree medium_ident1; +static tree medium_ident2; +static tree large_ident1; +static tree large_ident2; + +static void +init_idents PROTO ((void)) +{ + if (interrupt_ident1 == 0) + { + interrupt_ident1 = get_identifier ("interrupt"); + interrupt_ident2 = get_identifier ("__interrupt__"); + model_ident1 = get_identifier ("model"); + model_ident2 = get_identifier ("__model__"); + small_ident1 = get_identifier ("small"); + small_ident2 = get_identifier ("__small__"); + medium_ident1 = get_identifier ("medium"); + medium_ident2 = get_identifier ("__medium__"); + large_ident1 = get_identifier ("large"); + large_ident2 = get_identifier ("__large__"); + } +} + /* Return nonzero if IDENTIFIER is a valid decl attribute. */ int @@ -233,15 +243,20 @@ m32r_valid_machine_decl_attribute (type, attributes, identifier, args) { init_idents (); - if (identifier == interrupt_ident + if ((identifier == interrupt_ident1 + || identifier == interrupt_ident2) && list_length (args) == 0) return 1; - if (identifier == model_ident + if ((identifier == model_ident1 + || identifier == model_ident2) && list_length (args) == 1 - && (TREE_VALUE (args) == small_ident - || TREE_VALUE (args) == medium_ident - || TREE_VALUE (args) == large_ident)) + && (TREE_VALUE (args) == small_ident1 + || TREE_VALUE (args) == small_ident2 + || TREE_VALUE (args) == medium_ident1 + || TREE_VALUE (args) == medium_ident2 + || TREE_VALUE (args) == large_ident1 + || TREE_VALUE (args) == large_ident2)) return 1; return 0; @@ -380,13 +395,17 @@ m32r_encode_section_info (decl) { if (model) { - init_idents (); + tree id; - if (TREE_VALUE (TREE_VALUE (model)) == small_ident) + init_idents (); + + id = TREE_VALUE (TREE_VALUE (model)); + + if (id == small_ident1 || id == small_ident2) ; /* don't mark the symbol specially */ - else if (TREE_VALUE (TREE_VALUE (model)) == medium_ident) + else if (id == medium_ident1 || id == medium_ident2) prefix = MEDIUM_FLAG_CHAR; - else if (TREE_VALUE (TREE_VALUE (model)) == large_ident) + else if (id == large_ident1 || id == large_ident2) prefix = LARGE_FLAG_CHAR; else abort (); /* shouldn't happen */ |