diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2009-03-11 07:08:25 +0000 |
---|---|---|
committer | Christopher Li <sparse@chrisli.org> | 2009-07-18 05:30:09 +0000 |
commit | 3829c4d8b097776e6b3472290a9fae08a705ab7a (patch) | |
tree | b2218b8e8294de1414820fb62c117274f609f233 /symbol.h | |
parent | Simplify get_number_value() and ctype_integer() (diff) | |
download | sparse-3829c4d8b097776e6b3472290a9fae08a705ab7a.tar.gz sparse-3829c4d8b097776e6b3472290a9fae08a705ab7a.tar.bz2 sparse-3829c4d8b097776e6b3472290a9fae08a705ab7a.zip |
Don't mix storage class bits with ctype->modifiers while parsing type
Keep storage class (and "is it inline") explicitly in decl_state;
translate to modifiers only when we are done with parsing. That
avoids the need to separate MOD_STORAGE bits while constructing
the type (e.g. in alloc_indirect_symbol(), etc.). It also allows
to get rid of MOD_FORCE for good - instead of passing it to typename()
we pass an int * and let typename() tell whether we'd got a force-cast.
Indication of force-cast never makes it into the modifier bits at all.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Christopher Li <chrisl@hera.kernel.org>
Diffstat (limited to 'symbol.h')
-rw-r--r-- | symbol.h | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -92,8 +92,8 @@ struct ctype { struct decl_state { struct ctype ctype; struct ident **ident; - int prefer_abstract; struct symbol_op *mode; + unsigned char prefer_abstract, is_inline, storage_class; }; struct symbol_op { @@ -212,12 +212,11 @@ struct symbol { #define MOD_SAFE 0x8000000 // non-null/non-trapping pointer #define MOD_USERTYPE 0x10000000 -#define MOD_FORCE 0x20000000 #define MOD_EXPLICITLY_SIGNED 0x40000000 #define MOD_BITWISE 0x80000000 #define MOD_NONLOCAL (MOD_EXTERN | MOD_TOPLEVEL) -#define MOD_STORAGE (MOD_AUTO | MOD_REGISTER | MOD_STATIC | MOD_EXTERN | MOD_INLINE | MOD_TOPLEVEL | MOD_FORCE) +#define MOD_STORAGE (MOD_AUTO | MOD_REGISTER | MOD_STATIC | MOD_EXTERN | MOD_INLINE | MOD_TOPLEVEL) #define MOD_SIGNEDNESS (MOD_SIGNED | MOD_UNSIGNED | MOD_EXPLICITLY_SIGNED) #define MOD_SPECIFIER (MOD_CHAR | MOD_SHORT | MOD_LONG | MOD_LONGLONG | MOD_SIGNEDNESS) #define MOD_SIZE (MOD_CHAR | MOD_SHORT | MOD_LONG | MOD_LONGLONG) |