mirror of https://github.com/rui314/chibicc
Align global variables
This commit is contained in:
parent
5c6e15506a
commit
342e5b8b13
|
@ -520,6 +520,7 @@ static void emit_data(Program *prog) {
|
|||
if (var->initializer)
|
||||
continue;
|
||||
|
||||
printf(".align %d\n", var->ty->align);
|
||||
printf("%s:\n", var->name);
|
||||
printf(" .zero %d\n", var->ty->size);
|
||||
}
|
||||
|
@ -531,6 +532,7 @@ static void emit_data(Program *prog) {
|
|||
if (!var->initializer)
|
||||
continue;
|
||||
|
||||
printf(".align %d\n", var->ty->align);
|
||||
printf("%s:\n", var->name);
|
||||
|
||||
for (Initializer *init = var->initializer; init; init = init->next) {
|
||||
|
|
Loading…
Reference in New Issue