aboutsummaryrefslogtreecommitdiffstats
path: root/symbol.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-29 11:58:42 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:03:50 -0700
commit9fb615407dca8d4835971ec4668a435845038c12 (patch)
treed5710b05e7525749bc98cbd7b5d77fbcc5956053 /symbol.c
parent5e766f5dc9e91ea93d3ae3b2b4da6ef627f45605 (diff)
downloadsparse-9fb615407dca8d4835971ec4668a435845038c12.tar.gz
Use 'bad_type' instead of NULL when something bad happens
in type evaluation. This avoids a lot of special cases later on, and makes the error messages more readable anyway. We re-use the old "bad_enum_ctype" for this, and just make it more generic (and rename it).
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/symbol.c b/symbol.c
index 3f8b2a38..d5489ec6 100644
--- a/symbol.c
+++ b/symbol.c
@@ -309,7 +309,7 @@ static struct symbol *examine_enum_type(struct symbol *sym)
{
struct symbol *base_type = examine_base_type(sym);
- if (!base_type || base_type == &bad_enum_ctype) {
+ if (!base_type || base_type == &bad_ctype) {
warning(sym->pos, "invalid enum type");
sym->bit_size = -1;
return sym;
@@ -618,9 +618,7 @@ static struct sym_init eval_init_table[] = {
* Abstract types
*/
struct symbol int_type,
- fp_type,
- vector_type,
- bad_type;
+ fp_type;
/*
* C types (ie actual instances that the abstract types
@@ -634,7 +632,7 @@ struct symbol bool_ctype, void_ctype, type_ctype,
llong_ctype, sllong_ctype, ullong_ctype,
float_ctype, double_ctype, ldouble_ctype,
string_ctype, ptr_ctype, lazy_ptr_ctype,
- incomplete_ctype, label_ctype, bad_enum_ctype;
+ incomplete_ctype, label_ctype, bad_ctype;
#define __INIT_IDENT(str, res) { .len = sizeof(str)-1, .name = str, .reserved = res }
@@ -684,7 +682,7 @@ static const struct ctype_declare {
{ &void_ctype, SYM_BASETYPE, 0, NULL, NULL, NULL },
{ &type_ctype, SYM_BASETYPE, MOD_TYPE, NULL, NULL, NULL },
{ &incomplete_ctype,SYM_BASETYPE, 0, NULL, NULL, NULL },
- { &bad_enum_ctype, SYM_BAD, 0, NULL, NULL, NULL },
+ { &bad_ctype, SYM_BASETYPE, 0, NULL, NULL, NULL },
{ &char_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_CHAR, &bits_in_char, &max_int_alignment, &int_type },
{ &schar_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_CHAR, &bits_in_char, &max_int_alignment, &int_type },