mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-30 15:41:12 +00:00
Have the parser generate immediates AFTER generating the globals for correct def layout
This commit is contained in:
parent
f6e5396f9f
commit
d4077f6884
1 changed files with 21 additions and 21 deletions
42
parser.c
42
parser.c
|
@ -2767,27 +2767,6 @@ bool parser_finish(const char *output)
|
|||
return false;
|
||||
}
|
||||
|
||||
for (i = 0; i < parser->imm_float_count; ++i) {
|
||||
if (!ast_global_codegen(parser->imm_float[i], ir)) {
|
||||
printf("failed to generate global %s\n", parser->imm_float[i]->name);
|
||||
ir_builder_delete(ir);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < parser->imm_string_count; ++i) {
|
||||
if (!ast_global_codegen(parser->imm_string[i], ir)) {
|
||||
printf("failed to generate global %s\n", parser->imm_string[i]->name);
|
||||
ir_builder_delete(ir);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < parser->imm_vector_count; ++i) {
|
||||
if (!ast_global_codegen(parser->imm_vector[i], ir)) {
|
||||
printf("failed to generate global %s\n", parser->imm_vector[i]->name);
|
||||
ir_builder_delete(ir);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < parser->fields_count; ++i) {
|
||||
ast_value *field;
|
||||
bool isconst;
|
||||
|
@ -2823,6 +2802,27 @@ bool parser_finish(const char *output)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < parser->imm_float_count; ++i) {
|
||||
if (!ast_global_codegen(parser->imm_float[i], ir)) {
|
||||
printf("failed to generate global %s\n", parser->imm_float[i]->name);
|
||||
ir_builder_delete(ir);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < parser->imm_string_count; ++i) {
|
||||
if (!ast_global_codegen(parser->imm_string[i], ir)) {
|
||||
printf("failed to generate global %s\n", parser->imm_string[i]->name);
|
||||
ir_builder_delete(ir);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < parser->imm_vector_count; ++i) {
|
||||
if (!ast_global_codegen(parser->imm_vector[i], ir)) {
|
||||
printf("failed to generate global %s\n", parser->imm_vector[i]->name);
|
||||
ir_builder_delete(ir);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < parser->functions_count; ++i) {
|
||||
if (!ast_function_codegen(parser->functions[i], ir)) {
|
||||
printf("failed to generate function %s\n", parser->functions[i]->name);
|
||||
|
|
Loading…
Reference in a new issue