From f28c0db45fe2f7d6f24d60f3a18e9c7a9719cf7e Mon Sep 17 00:00:00 2001 From: Moritz Kroll Date: Fri, 20 Feb 2009 21:55:51 +0000 Subject: [PATCH] irio: Added union support. Save calling_convention and additional_properties attributes of methods [r25538] --- ir/ir/irio.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ir/ir/irio.c b/ir/ir/irio.c index 8fa07197f..85c21c5ce 100644 --- a/ir/ir/irio.c +++ b/ir/ir/irio.c @@ -146,6 +146,7 @@ static void symtbl_init(void) INSERT("pointer", tt_tpo, tpo_pointer); INSERT("primitive", tt_tpo, tpo_primitive); INSERT("struct", tt_tpo, tpo_struct); + INSERT("union", tt_tpo, tpo_union); INSERT("Unknown", tt_tpo, tpo_unknown); #include "gen_irio_lex.inl" @@ -364,7 +365,8 @@ static void export_type(io_env_t *env, ir_type *tp) { int nparams = get_method_n_params(tp); int nresults = get_method_n_ress(tp); - fprintf(f, "%i %i ", nparams, nresults); + fprintf(f, "0x%X 0x%X %i %i ", get_method_calling_convention(tp), + get_method_additional_properties(tp), nparams, nresults); for(i = 0; i < nparams; i++) fprintf(f, "%ld ", get_type_nr(get_method_param_type(tp, i))); for(i = 0; i < nresults; i++) @@ -384,6 +386,9 @@ static void export_type(io_env_t *env, ir_type *tp) case tpo_struct: break; + case tpo_union: + break; + case tpo_unknown: break; @@ -969,8 +974,10 @@ static void import_type(io_env_t *env) case tpo_method: { - int nparams = (int) read_long(env); - int nresults = (int) read_long(env); + unsigned callingconv = (unsigned) read_long(env); + unsigned addprops = (unsigned) read_long(env); + int nparams = (int) read_long(env); + int nresults = (int) read_long(env); type = new_type_method(id, nparams, nresults); @@ -988,6 +995,9 @@ static void import_type(io_env_t *env) set_method_res_type(type, i, restype); } + + set_method_calling_convention(type, callingconv); + set_method_additional_properties(type, addprops); break; } -- 2.20.1