irio: Added union support. Save calling_convention and additional_properties attribut...
authorMoritz Kroll <Moritz.Kroll@gmx.de>
Fri, 20 Feb 2009 21:55:51 +0000 (21:55 +0000)
committerMoritz Kroll <Moritz.Kroll@gmx.de>
Fri, 20 Feb 2009 21:55:51 +0000 (21:55 +0000)
[r25538]

ir/ir/irio.c

index 8fa0719..85c21c5 100644 (file)
@@ -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;
                }