diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2003-09-29 22:28:58 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2003-09-29 22:28:58 +0000 |
commit | 563556ca7a4998396cb1caf1daaf2eb2e0af39c9 (patch) | |
tree | 1892a62a80adce92264197d13022ce8b65e53e62 /gcc | |
parent | 21e6f0257f9539fbdfb406bb99b08af80d12fb97 (diff) | |
download | gcc-563556ca7a4998396cb1caf1daaf2eb2e0af39c9.zip gcc-563556ca7a4998396cb1caf1daaf2eb2e0af39c9.tar.gz gcc-563556ca7a4998396cb1caf1daaf2eb2e0af39c9.tar.bz2 |
objc-act.c (encode_type): Encode INTEGER_TYPEs and REAL_TYPEs based on the bitsize of the type's mode...
* objc/objc-act.c (encode_type): Encode INTEGER_TYPEs and
REAL_TYPEs based on the bitsize of the type's mode, not the
mode directly.
From-SVN: r71923
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 64 |
2 files changed, 29 insertions, 43 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2b6facf..a9fdc0e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,8 +1,14 @@ +2003-09-29 Zack Weinberg <zack@codesourcery.com> + + * objc/objc-act.c (encode_type): Encode INTEGER_TYPEs and + REAL_TYPEs based on the bitsize of the type's mode, not the + mode directly. + 2003-09-29 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> * dwarf2out.c (default_eh_frame_section): Split into ... (named_section_eh_frame_section, collect2_eh_frame_section): ... new - functions. + functions. * output.h (named_section_eh_frame_section): Declare. (collect2_eh_frame_section): Likewise. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index e9379a7..24fcffe 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -7325,62 +7325,42 @@ encode_next_bitfield (int width) } /* FORMAT will be OBJC_ENCODE_INLINE_DEFS or OBJC_ENCODE_DONT_INLINE_DEFS. */ - static void encode_type (tree type, int curtype, int format) { enum tree_code code = TREE_CODE (type); + char c; if (code == INTEGER_TYPE) { - if (integer_zerop (TYPE_MIN_VALUE (type))) + switch (GET_MODE_BITSIZE (TYPE_MODE (type))) { - /* Unsigned integer types. */ - - if (TYPE_MODE (type) == QImode) - obstack_1grow (&util_obstack, 'C'); - else if (TYPE_MODE (type) == HImode) - obstack_1grow (&util_obstack, 'S'); - else if (TYPE_MODE (type) == SImode) - { - if (type == long_unsigned_type_node) - obstack_1grow (&util_obstack, 'L'); - else - obstack_1grow (&util_obstack, 'I'); - } - else if (TYPE_MODE (type) == DImode) - obstack_1grow (&util_obstack, 'Q'); - } - - else - /* Signed integer types. */ - { - if (TYPE_MODE (type) == QImode) - obstack_1grow (&util_obstack, 'c'); - else if (TYPE_MODE (type) == HImode) - obstack_1grow (&util_obstack, 's'); - else if (TYPE_MODE (type) == SImode) - { - if (type == long_integer_type_node) - obstack_1grow (&util_obstack, 'l'); - else - obstack_1grow (&util_obstack, 'i'); - } - - else if (TYPE_MODE (type) == DImode) - obstack_1grow (&util_obstack, 'q'); + case 8: c = TREE_UNSIGNED (type) ? 'C' : 'c'; break; + case 16: c = TREE_UNSIGNED (type) ? 'S' : 's'; break; + case 32: + if (type == long_unsigned_type_node + || type == long_integer_type_node) + c = TREE_UNSIGNED (type) ? 'L' : 'l'; + else + c = TREE_UNSIGNED (type) ? 'I' : 'i'; + break; + case 64: c = TREE_UNSIGNED (type) ? 'Q' : 'q'; break; + default: abort (); } + obstack_1grow (&util_obstack, c); } else if (code == REAL_TYPE) { /* Floating point types. */ - - if (TYPE_MODE (type) == SFmode) - obstack_1grow (&util_obstack, 'f'); - else if (TYPE_MODE (type) == DFmode - || TYPE_MODE (type) == TFmode) - obstack_1grow (&util_obstack, 'd'); + switch (GET_MODE_BITSIZE (TYPE_MODE (type))) + { + case 32: c = 'f'; break; + case 64: + case 128: c = 'd'; break; + default: abort (); + } + obstack_1grow (&util_obstack, c); } else if (code == VOID_TYPE) |