diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2004-01-27 02:33:22 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2004-01-27 02:33:22 +0000 |
commit | 1c62e7b282ae85cf578a3af015941e717422f116 (patch) | |
tree | b72bec59563c306cade59d3562d4d103bc29ffb3 /gcc | |
parent | ba9119ec894e7151e50cc5889fe3b6381d096e8c (diff) | |
download | gcc-1c62e7b282ae85cf578a3af015941e717422f116.zip gcc-1c62e7b282ae85cf578a3af015941e717422f116.tar.gz gcc-1c62e7b282ae85cf578a3af015941e717422f116.tar.bz2 |
system.h (CHAR_BITFIELD): Delete.
* system.h (CHAR_BITFIELD): Delete.
(BOOL_BITFIELD): New.
* c-decl.c (c_scope): Use BOOL_BITFIELD.
* gengtype-lex.l: Recognize BOOL_BITFIELD instead of CHAR_BITFIELD.
cp:
* cp-tree.h (language_function, lang_type_header): Use
BOOL_BITFIELD.
* name-lookup.h (cp_binding_level): Likewise.
From-SVN: r76686
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/c-decl.c | 8 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 20 | ||||
-rw-r--r-- | gcc/cp/name-lookup.h | 2 | ||||
-rw-r--r-- | gcc/gengtype-lex.l | 2 | ||||
-rw-r--r-- | gcc/system.h | 13 |
7 files changed, 38 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4674b7c..1e9e491 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-01-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * system.h (CHAR_BITFIELD): Delete. + (BOOL_BITFIELD): New. + * c-decl.c (c_scope): Use BOOL_BITFIELD. + * gengtype-lex.l: Recognize BOOL_BITFIELD instead of CHAR_BITFIELD. + 2004-01-26 Kazu Hirata <kazu@cs.umass.edu> * config/arc/arc.c (TARGET_PROMOTE_FUNCTION_ARGS): New. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 6dd6bc0..c0cd219 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -230,21 +230,21 @@ struct c_scope GTY(()) /* True if we are currently filling this scope with parameter declarations. */ - bool parm_flag : 1; + BOOL_BITFIELD parm_flag : 1; /* True if we already complained about forward parameter decls in this scope. This prevents double warnings on foo (int a; int b; ...) */ - bool warned_forward_parm_decls : 1; + BOOL_BITFIELD warned_forward_parm_decls : 1; /* True if this is the outermost block scope of a function body. This scope contains the parameters, the local variables declared in the outermost block, and all the labels (except those in nested functions, or declared at block scope with __label__). */ - bool function_body : 1; + BOOL_BITFIELD function_body : 1; /* True means make a BLOCK for this scope no matter what. */ - bool keep : 1; + BOOL_BITFIELD keep : 1; }; /* The scope currently in effect. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a6248b6..001c992 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-01-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * cp-tree.h (language_function, lang_type_header): Use + BOOL_BITFIELD. + * name-lookup.h (cp_binding_level): Likewise. + 2004-01-26 Mark Mitchell <mark@codesourcery.com> PR c++/13663 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f7d3a65..0614d72 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -794,7 +794,7 @@ struct language_function GTY(()) int in_base_initializer; /* True if this function can throw an exception. */ - bool can_throw : 1; + BOOL_BITFIELD can_throw : 1; struct named_label_use_list *x_named_label_uses; struct named_label_list *x_named_labels; @@ -1013,15 +1013,15 @@ enum languages { lang_c, lang_cplusplus, lang_java }; are put in this structure to save space. */ struct lang_type_header GTY(()) { - CHAR_BITFIELD is_lang_type_class : 1; - - CHAR_BITFIELD has_type_conversion : 1; - CHAR_BITFIELD has_init_ref : 1; - CHAR_BITFIELD has_default_ctor : 1; - CHAR_BITFIELD uses_multiple_inheritance : 1; - CHAR_BITFIELD const_needs_init : 1; - CHAR_BITFIELD ref_needs_init : 1; - CHAR_BITFIELD has_const_assign_ref : 1; + BOOL_BITFIELD is_lang_type_class : 1; + + BOOL_BITFIELD has_type_conversion : 1; + BOOL_BITFIELD has_init_ref : 1; + BOOL_BITFIELD has_default_ctor : 1; + BOOL_BITFIELD uses_multiple_inheritance : 1; + BOOL_BITFIELD const_needs_init : 1; + BOOL_BITFIELD ref_needs_init : 1; + BOOL_BITFIELD has_const_assign_ref : 1; }; /* This structure provides additional information above and beyond diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index c986fbc..f9764fc 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -215,7 +215,7 @@ struct cp_binding_level GTY(()) /* True if this scope is an SK_TEMPLATE_SPEC scope. This field is only valid if KIND == SK_TEMPLATE_PARMS. */ - bool explicit_spec_p : 1; + BOOL_BITFIELD explicit_spec_p : 1; /* true means make a BLOCK for this level regardless of all else. */ unsigned keep : 1; diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l index 2f52659..2d0462b 100644 --- a/gcc/gengtype-lex.l +++ b/gcc/gengtype-lex.l @@ -47,7 +47,7 @@ update_lineno (const char *l, size_t len) ID [[:alpha:]_][[:alnum:]_]* WS [[:space:]]+ -IWORD short|long|(un)?signed|char|int|HOST_WIDE_INT|bool|size_t|CHAR_BITFIELD +IWORD short|long|(un)?signed|char|int|HOST_WIDE_INT|bool|size_t|BOOL_BITFIELD ITYPE {IWORD}({WS}{IWORD})* %x in_struct in_struct_comment in_comment in_yacc_escape diff --git a/gcc/system.h b/gcc/system.h index 93cfd18..defeed0 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -486,16 +486,21 @@ extern int snprintf (char *, size_t, const char *, ...); #define HOST_BIT_BUCKET "/dev/null" #endif -/* Be conservative and only use enum bitfields with GCC. Likewise for - char bitfields. +/* Be conservative and only use enum bitfields with GCC. FIXME: provide a complete autoconf test for buggy enum bitfields. */ #if (GCC_VERSION > 2000) #define ENUM_BITFIELD(TYPE) __extension__ enum TYPE -#define CHAR_BITFIELD __extension__ unsigned char #else #define ENUM_BITFIELD(TYPE) unsigned int -#define CHAR_BITFIELD unsigned int +#endif + +/* We only use bool bitfields with gcc3. Some supposedly C99 + compilers don't handle them correctly. */ +#if (GCC_VERSION >= 3000) +#define BOOL_BITFIELD _Bool +#else +#define BOOL_BITFIELD unsigned int #endif #ifndef offsetof |