From 79593974e358c98aeac763086c00e09fe6e81695 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 29 Jun 2020 11:40:26 +0200 Subject: [PATCH] add serialization to eolian --- src/bin/eolian/sources.c | 24 ++++++++++++++++++++++++ src/compiler-plugins/myplugin.cc | 6 ++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c index dc79ee2daa..84e79b1af6 100644 --- a/src/bin/eolian/sources.c +++ b/src/bin/eolian/sources.c @@ -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("); diff --git a/src/compiler-plugins/myplugin.cc b/src/compiler-plugins/myplugin.cc index 809f59812c..a3e01573d6 100644 --- a/src/compiler-plugins/myplugin.cc +++ b/src/compiler-plugins/myplugin.cc @@ -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 } }