don't warn about unused end_sys_{globals,fields}

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-10-02 15:35:43 +02:00
parent 984d8e7adc
commit 4742ee9123

View file

@ -2928,9 +2928,13 @@ bool parser_finish(const char *output)
continue; continue;
asvalue = (ast_value*)(parser->globals[i].var); asvalue = (ast_value*)(parser->globals[i].var);
if (!asvalue->uses && !asvalue->isconst && asvalue->expression.vtype != TYPE_FUNCTION) { if (!asvalue->uses && !asvalue->isconst && asvalue->expression.vtype != TYPE_FUNCTION) {
if (strcmp(asvalue->name, "end_sys_globals") &&
strcmp(asvalue->name, "end_sys_fields"))
{
retval = retval && !genwarning(ast_ctx(asvalue), WARN_UNUSED_VARIABLE, retval = retval && !genwarning(ast_ctx(asvalue), WARN_UNUSED_VARIABLE,
"unused global: `%s`", asvalue->name); "unused global: `%s`", asvalue->name);
} }
}
if (!ast_global_codegen(asvalue, ir)) { if (!ast_global_codegen(asvalue, ir)) {
printf("failed to generate global %s\n", parser->globals[i].name); printf("failed to generate global %s\n", parser->globals[i].name);
ir_builder_delete(ir); ir_builder_delete(ir);