X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=ast.c;h=49446a111d7035085c90981018c91b02e48f5e06;hb=214c063b3f53430960c256372914f1b90d1457eb;hp=00ab6117c407a34044dc817bb3f7b6fa81a297ee;hpb=200b425db02c97bdacb769de2ede98d130517df0;p=xonotic%2Fgmqcc.git diff --git a/ast.c b/ast.c index 00ab611..49446a1 100644 --- a/ast.c +++ b/ast.c @@ -36,7 +36,7 @@ ( (ast_node*)self )->node.destroy = (ast_node_delete*)destroyfn /* It must not be possible to get here. */ -static void _ast_node_destroy(ast_node *self) +static GMQCC_NORETURN void _ast_node_destroy(ast_node *self) { fprintf(stderr, "ast node missing destroy()\n"); abort(); @@ -772,7 +772,7 @@ bool ast_ifthen_codegen(ast_ifthen *self, ast_function *func, bool lvalue, ir_va return false; } else ontrue = NULL; - + /* on-false path */ if (self->on_false) { /* create on-false block */ @@ -793,7 +793,7 @@ bool ast_ifthen_codegen(ast_ifthen *self, ast_function *func, bool lvalue, ir_va /* Merge block were they all merge in to */ merge = ir_function_create_block(func->ir_func, ast_function_label(func, "endif")); if (!merge) - return NULL; + return false; /* add jumps ot the merge block */ if (ontrue && !ir_block_create_jump(ontrue, merge)) @@ -844,7 +844,7 @@ bool ast_ternary_codegen(ast_ternary *self, ast_function *func, bool lvalue, ir_ return false; /* In the following, contraty to ast_ifthen, we assume both paths exist. */ - + /* generate the condition */ func->curblock = cond; cgen = self->cond->expression.codegen; @@ -865,7 +865,7 @@ bool ast_ternary_codegen(ast_ternary *self, ast_function *func, bool lvalue, ir_ if (!(*cgen)((ast_expression*)(self->on_true), func, false, &trueval)) return false; } - + /* create on-false block */ onfalse = ir_function_create_block(func->ir_func, ast_function_label(func, "tern_F")); if (!onfalse) @@ -884,7 +884,7 @@ bool ast_ternary_codegen(ast_ternary *self, ast_function *func, bool lvalue, ir_ /* create merge block */ merge = ir_function_create_block(func->ir_func, ast_function_label(func, "tern_out")); if (!merge) - return NULL; + return false; /* jump to merge block */ if (!ir_block_create_jump(ontrue, merge)) return false; @@ -925,31 +925,31 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value { ast_expression_codegen *cgen; - ir_value *dummy; - ir_value *precond; - ir_value *postcond; + ir_value *dummy = NULL; + ir_value *precond = NULL; + ir_value *postcond = NULL; /* Since we insert some jumps "late" so we have blocks * ordered "nicely", we need to keep track of the actual end-blocks * of expressions to add the jumps to. */ - ir_block *bbody, *end_bbody; - ir_block *bprecond, *end_bprecond; - ir_block *bpostcond, *end_bpostcond; - ir_block *bincrement, *end_bincrement; - ir_block *bout, *bin; + ir_block *bbody = NULL, *end_bbody = NULL; + ir_block *bprecond = NULL, *end_bprecond = NULL; + ir_block *bpostcond = NULL, *end_bpostcond = NULL; + ir_block *bincrement = NULL, *end_bincrement = NULL; + ir_block *bout = NULL, *bin = NULL; /* let's at least move the outgoing block to the end */ size_t bout_id; /* 'break' and 'continue' need to be able to find the right blocks */ - ir_block *bcontinue = NULL; - ir_block *bbreak = NULL; + ir_block *bcontinue = NULL; + ir_block *bbreak = NULL; - ir_block *old_bcontinue; - ir_block *old_bbreak; + ir_block *old_bcontinue = NULL; + ir_block *old_bbreak = NULL; - ir_block *tmpblock; + ir_block *tmpblock = NULL; (void)lvalue; (void)out;