summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-06-29 11:40:26 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-07-06 13:58:11 +0200
commit79593974e358c98aeac763086c00e09fe6e81695 (patch)
treeccee5632e17e44f2b996dde42d0884123d1ee218
parentda1de5a2bb762ef1dc3b3239089fd9f457f41c36 (diff)
downloadefl-79593974e358c98aeac763086c00e09fe6e81695.tar.gz
add serialization to eolian
-rw-r--r--src/bin/eolian/sources.c24
-rw-r--r--src/compiler-plugins/myplugin.cc6
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
}
}