q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=25d57a4b44fd8fcb9a2ee606685cd89acefe6161
commit 25d57a4b44fd8fcb9a2ee606685cd89acefe6161 Author: Daniel Kolesa <d.kol...@samsung.com> Date: Fri Sep 12 13:25:26 2014 +0100 eolian: remove some unnecessary temps --- src/lib/eolian/eo_definitions.c | 12 ---------- src/lib/eolian/eo_definitions.h | 4 ---- src/lib/eolian/eo_parser.c | 50 +++++++++-------------------------------- 3 files changed, 10 insertions(+), 56 deletions(-) diff --git a/src/lib/eolian/eo_definitions.c b/src/lib/eolian/eo_definitions.c index 470f7e0..4f1b9d6 100644 --- a/src/lib/eolian/eo_definitions.c +++ b/src/lib/eolian/eo_definitions.c @@ -31,24 +31,12 @@ eo_definitions_temps_free(Eo_Lexer_Temps *tmp) EINA_LIST_FREE(tmp->var_defs, var) database_var_del(var); - if (tmp->func) - database_function_del(tmp->func); - if (tmp->param) database_parameter_del(tmp->param); EINA_LIST_FREE(tmp->str_items, s) if (s) eina_stringshare_del(s); - if (tmp->event) - database_event_del(tmp->event); - - if (tmp->impl) - database_implement_del(tmp->impl); - - if (tmp->ctor) - database_constructor_del(tmp->ctor); - EINA_LIST_FREE(tmp->strs, s) if (s) eina_stringshare_del(s); diff --git a/src/lib/eolian/eo_definitions.h b/src/lib/eolian/eo_definitions.h index abc1a6c..6fa35ed 100644 --- a/src/lib/eolian/eo_definitions.h +++ b/src/lib/eolian/eo_definitions.h @@ -17,12 +17,8 @@ typedef struct _Eo_Lexer_Temps Eolian_Class *kls; Eina_List *type_defs; Eina_List *var_defs; - Eolian_Function *func; Eolian_Function_Parameter *param; Eina_List *str_items; - Eolian_Event *event; - Eolian_Implement *impl; - Eolian_Constructor *ctor; Eina_List *expr_defs; Eina_List *strs; } Eo_Lexer_Temps; diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 5faa499..b54c4c0 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -1348,7 +1348,7 @@ parse_property(Eo_Lexer *ls) prop->base.file = eina_stringshare_ref(ls->filename); prop->base.line = ls->line_number; prop->base.column = ls->column; - ls->tmp.func = prop; + ls->tmp.kls->properties = eina_list_append(ls->tmp.kls->properties, prop); check(ls, TOK_VALUE); prop->name = eina_stringshare_ref(ls->t.value.s); eo_lexer_get(ls); @@ -1422,7 +1422,7 @@ parse_method(Eo_Lexer *ls, Eina_Bool ctor) meth->base.file = eina_stringshare_ref(ls->filename); meth->base.line = ls->line_number; meth->base.column = ls->column; - ls->tmp.func = meth; + ls->tmp.kls->methods = eina_list_append(ls->tmp.kls->methods, meth); if (ctor) { if (ls->t.token != TOK_VALUE) @@ -1545,7 +1545,7 @@ parse_implement(Eo_Lexer *ls, Eina_Bool iface) impl->base.file = eina_stringshare_ref(ls->filename); impl->base.line = iline; impl->base.column = icol; - ls->tmp.impl = impl; + ls->tmp.kls->implements = eina_list_append(ls->tmp.kls->implements, impl); switch (ls->t.kw) { case KW_at_virtual: @@ -1644,7 +1644,7 @@ parse_constructor(Eo_Lexer *ls) ctor->base.file = eina_stringshare_ref(ls->filename); ctor->base.line = ls->line_number; ctor->base.column = ls->column; - ls->tmp.ctor = ctor; + ls->tmp.kls->constructors = eina_list_append(ls->tmp.kls->constructors, ctor); if (ls->t.token == '.') { check_next(ls, '.'); @@ -1685,7 +1685,7 @@ parse_event(Eo_Lexer *ls) ev->base.line = ls->line_number; ev->base.column = ls->column; Eina_Strbuf *buf = push_strbuf(ls); - ls->tmp.event = ev; + ls->tmp.kls->events = eina_list_append(ls->tmp.kls->events, ev); check(ls, TOK_VALUE); eina_strbuf_append(buf, ls->t.value.s); eo_lexer_get(ls); @@ -1727,53 +1727,28 @@ parse_event(Eo_Lexer *ls) static void parse_methods(Eo_Lexer *ls) { - PARSE_SECTION - { - parse_method(ls, EINA_FALSE); - ls->tmp.kls->methods = eina_list_append(ls->tmp.kls->methods, - ls->tmp.func); - ls->tmp.func = NULL; - } + PARSE_SECTION parse_method(ls, EINA_FALSE); check_match(ls, '}', '{', line, col); } static void parse_properties(Eo_Lexer *ls) { - PARSE_SECTION - { - parse_property(ls); - ls->tmp.kls->properties = eina_list_append(ls->tmp.kls->properties, - ls->tmp.func); - ls->tmp.func = NULL; - } + PARSE_SECTION parse_property(ls); check_match(ls, '}', '{', line, col); } static void parse_implements(Eo_Lexer *ls, Eina_Bool iface) { - PARSE_SECTION - { - parse_implement(ls, iface); - if (ls->tmp.impl) - ls->tmp.kls->implements = eina_list_append(ls->tmp.kls->implements, - ls->tmp.impl); - ls->tmp.impl = NULL; - } + PARSE_SECTION parse_implement(ls, iface); check_match(ls, '}', '{', line, col); } static void parse_constructors(Eo_Lexer *ls) { - PARSE_SECTION - { - parse_constructor(ls); - ls->tmp.kls->constructors = eina_list_append(ls->tmp.kls->constructors, - ls->tmp.ctor); - ls->tmp.ctor = NULL; - } + PARSE_SECTION parse_constructor(ls); check_match(ls, '}', '{', line, col); } @@ -1787,12 +1762,7 @@ parse_events(Eo_Lexer *ls) check(ls, '{'); eo_lexer_get(ls); while (ls->t.token != '}') - { - parse_event(ls); - ls->tmp.kls->events = eina_list_append(ls->tmp.kls->events, - ls->tmp.event); - ls->tmp.event = NULL; - } + parse_event(ls); check_match(ls, '}', '{', line, col); } --