aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/evaluate.c
diff options
authorLinus Torvalds <torvalds@penguin.transmeta.com>2003-04-01 16:57:19 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:02 -0700
commit2823bff27b1ad4bc42f29163fc0d2711fdb0990f (patch)
treec5724d7f715cc6655b78e155c5e2572772c8f732 /evaluate.c
parent731d979ea2e87de7090d5e5f92ad70ea5ffdd09f (diff)
downloadsparse-dev-2823bff27b1ad4bc42f29163fc0d2711fdb0990f.tar.gz
Move symbol alignment into the "ctype" part of the symbol,
so that type parsing gets access to it.
Diffstat (limited to 'evaluate.c')
-rw-r--r--evaluate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/evaluate.c b/evaluate.c
index aaade9e8..f41d2252 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -52,8 +52,7 @@ static struct symbol *evaluate_string(struct expression *expr)
sym->array_size = length;
sym->bit_size = BITS_IN_CHAR * length;
- sym->alignment = 1;
-
+ sym->ctype.alignment = 1;
sym->ctype.modifiers = MOD_CONST;
sym->ctype.base_type = &char_ctype;
expr->ctype = sym;
@@ -191,7 +190,7 @@ static struct symbol *degenerate(struct expression *expr, struct symbol *ctype)
struct symbol *sym = alloc_symbol(expr->pos, SYM_PTR);
sym->ctype = ctype->ctype;
sym->bit_size = BITS_IN_POINTER;
- sym->alignment = POINTER_ALIGNMENT;
+ sym->ctype.alignment = POINTER_ALIGNMENT;
ctype = sym;
}
return ctype;
@@ -592,8 +591,8 @@ static struct symbol *evaluate_preop(struct expression *expr)
case '&': {
struct symbol *symbol = alloc_symbol(expr->pos, SYM_PTR);
symbol->ctype.base_type = ctype;
+ symbol->ctype.alignment = POINTER_ALIGNMENT;
symbol->bit_size = BITS_IN_POINTER;
- symbol->alignment = POINTER_ALIGNMENT;
expr->ctype = symbol;
return symbol;
}