add serialization to eolian

This commit is contained in:
Marcel Hollerbach 2020-06-29 11:40:26 +02:00
parent da1de5a2bb
commit 79593974e3
2 changed files with 28 additions and 2 deletions

View File

@ -1205,6 +1205,30 @@ eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
eina_strbuf_append(buf, "};\n\n");
/* add implementation details to the declaration */
const Eolian_Implement *imp;
Eina_Iterator *itr = eolian_class_implements_get(cl);
EINA_ITERATOR_FOREACH(itr, imp)
{
const Eolian_Class *icl = eolian_implement_class_get(imp);
Eolian_Function_Type ftype;
const Eolian_Function *fid = eolian_implement_function_get(imp, &ftype);
if (eolian_function_is_static(fid)) continue;
if (icl == cl) continue;
Eina_Bool found_get = !!eina_hash_find(_funcs_params_init_get, &imp);
Eina_Bool found_set = !!eina_hash_find(_funcs_params_init_set, &imp);
char *ocnamel = NULL;
if (cl != icl)
eo_gen_class_names_get(icl, NULL, NULL, &ocnamel);
eina_strbuf_append_printf(buf, "//register_next(\"%s\",\"_%s_%s\");\n", eolian_function_full_c_name_get(fid, ftype), ocnamel, eolian_function_full_c_name_get(fid, ftype)); //FIXME wrong name
free(ocnamel);
}
eina_iterator_free(itr);
/* class def */
eina_strbuf_append(buf, "EFL_DEFINE_CLASS(");

View File

@ -80,10 +80,12 @@ static Caller fetch_efl_super_class(const_gimple stmt)
{
Caller ret = {false, NULL, NULL};
tree called_api_tree = gimple_call_fndecl(stmt);
if (!called_api_tree) return ret;
//check that we have efl_super as the first argument
Fetch_Result first = _fetch_first_argument(stmt, 0);
if (!first.valid) return ret;
tree called_api_tree = gimple_call_fndecl(first.first_argument);
ret.called_api = IDENTIFIER_POINTER(DECL_NAME(called_api_tree));
if (!!strncmp(first.api_name, "efl_super", 9)) return ret;
@ -118,7 +120,7 @@ static unsigned int eo_execute(void)
if (!c.klass)
continue;
// FIXME fprintf(stderr, "Found call of %s as super of %s\n", c.called_api, c.klass);
fprintf(stderr, "Found call of %s as super of %s\n", c.called_api, c.klass);
//FIXME work
}
}