From: Dale Weiler Date: Wed, 29 May 2013 03:43:49 +0000 (+0000) Subject: Merge branch 'union-replacement' into cooking X-Git-Tag: v0.3.0~151^2~41 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2923b718e16d7c82b9cd3244d77bb8c701fd5b53;p=xonotic%2Fgmqcc.git Merge branch 'union-replacement' into cooking Conflicts: ast.c --- 2923b718e16d7c82b9cd3244d77bb8c701fd5b53 diff --cc ast.c index 96f768f,b104073..01a08e5 --- a/ast.c +++ b/ast.c @@@ -34,45 -34,8 +34,45 @@@ return NULL; \ } \ ast_node_init((ast_node*)self, ctx, TYPE_##T); \ - ( (ast_node*)self )->node.destroy = (ast_node_delete*)destroyfn + ( (ast_node*)self )->destroy = (ast_node_delete*)destroyfn +/* + * forward declarations, these need not be in ast.h for obvious + * static reasons. + */ +static bool ast_member_codegen(ast_member*, ast_function*, bool lvalue, ir_value**); +static void ast_array_index_delete(ast_array_index*); +static bool ast_array_index_codegen(ast_array_index*, ast_function*, bool lvalue, ir_value**); +static void ast_store_delete(ast_store*); +static bool ast_store_codegen(ast_store*, ast_function*, bool lvalue, ir_value**); +static void ast_ifthen_delete(ast_ifthen*); +static bool ast_ifthen_codegen(ast_ifthen*, ast_function*, bool lvalue, ir_value**); +static void ast_ternary_delete(ast_ternary*); +static bool ast_ternary_codegen(ast_ternary*, ast_function*, bool lvalue, ir_value**); +static void ast_loop_delete(ast_loop*); +static bool ast_loop_codegen(ast_loop*, ast_function*, bool lvalue, ir_value**); +static void ast_breakcont_delete(ast_breakcont*); +static bool ast_breakcont_codegen(ast_breakcont*, ast_function*, bool lvalue, ir_value**); +static void ast_switch_delete(ast_switch*); +static bool ast_switch_codegen(ast_switch*, ast_function*, bool lvalue, ir_value**); +static void ast_label_delete(ast_label*); +static void ast_label_register_goto(ast_label*, ast_goto*); +static bool ast_label_codegen(ast_label*, ast_function*, bool lvalue, ir_value**); +static bool ast_goto_codegen(ast_goto*, ast_function*, bool lvalue, ir_value**); +static void ast_goto_delete(ast_goto*); +static void ast_call_delete(ast_call*); +static bool ast_call_codegen(ast_call*, ast_function*, bool lvalue, ir_value**); +static bool ast_block_codegen(ast_block*, ast_function*, bool lvalue, ir_value**); +static void ast_unary_delete(ast_unary*); +static bool ast_unary_codegen(ast_unary*, ast_function*, bool lvalue, ir_value**); +static void ast_entfield_delete(ast_entfield*); +static bool ast_entfield_codegen(ast_entfield*, ast_function*, bool lvalue, ir_value**); +static void ast_return_delete(ast_return*); +static bool ast_return_codegen(ast_return*, ast_function*, bool lvalue, ir_value**); +static void ast_binstore_delete(ast_binstore*); +static bool ast_binstore_codegen(ast_binstore*, ast_function*, bool lvalue, ir_value**); +static void ast_binary_delete(ast_binary*); +static bool ast_binary_codegen(ast_binary*, ast_function*, bool lvalue, ir_value**); /* It must not be possible to get here. */ static GMQCC_NORETURN void _ast_node_destroy(ast_node *self) @@@ -1170,12 -1132,12 +1170,12 @@@ static const char* ast_function_label(a * But I can't imagine a pituation where the output is truly unnecessary. */ - static void _ast_codegen_output_type(ast_expression_common *self, ir_value *out) -void _ast_codegen_output_type(ast_expression *self, ir_value *out) ++static void _ast_codegen_output_type(ast_expression *self, ir_value *out) { if (out->vtype == TYPE_FIELD) - out->fieldtype = self->next->expression.vtype; + out->fieldtype = self->next->vtype; if (out->vtype == TYPE_FUNCTION) - out->outtype = self->next->expression.vtype; + out->outtype = self->next->vtype; } #define codegen_output_type(a,o) (_ast_codegen_output_type(&((a)->expression),(o)))