From: Daniel Kolesa Date: Fri, 12 Jan 2018 16:25:23 +0000 (+0100) Subject: eolian: store typedecl/class in type X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09911c0c8fb92cc0a14419061c4b1e6b1a2d2831;p=platform%2Fupstream%2Fefl.git eolian: store typedecl/class in type --- diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 9ac74db..b6e40b6 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -225,7 +225,6 @@ _validate_type(const Eolian_Unit *src, Eolian_Type *tp) } return _validate(&tp->base); } - Eolian_Typedecl *tpp; /* builtins */ int id = eo_lexer_keyword_str_to_id(tp->full_name); if (id) @@ -253,21 +252,22 @@ _validate_type(const Eolian_Unit *src, Eolian_Type *tp) return _validate(&tp->base); } /* user defined */ - tpp = (Eolian_Typedecl *)eolian_type_typedecl_get(src, tp); - if (!tpp) + tp->tdecl = (Eolian_Typedecl *)eolian_type_typedecl_get(src, tp); + if (!tp->tdecl) { snprintf(buf, sizeof(buf), "undefined type %s", tp->full_name); return _obj_error(&tp->base, buf); } - if (!_validate_typedecl(src, tpp)) + if (!_validate_typedecl(src, tp->tdecl)) return EINA_FALSE; - if (tpp->freefunc && !tp->freefunc) - tp->freefunc = eina_stringshare_ref(tpp->freefunc); + if (tp->tdecl->freefunc && !tp->freefunc) + tp->freefunc = eina_stringshare_ref(tp->tdecl->freefunc); return _validate(&tp->base); } case EOLIAN_TYPE_CLASS: { - if (!eolian_type_class_get(src, tp)) + tp->klass = (Eolian_Class *)eolian_type_class_get(src, tp); + if (!tp->klass) { snprintf(buf, sizeof(buf), "undefined class %s " "(likely wrong namespacing)", tp->full_name); diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index f68093d..00a3967 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h @@ -196,6 +196,11 @@ struct _Eolian_Type Eina_Stringshare *full_name; Eina_List *namespaces; Eina_Stringshare *freefunc; + union + { + Eolian_Class *klass; + Eolian_Typedecl *tdecl; + }; Eina_Bool is_const :1; Eina_Bool is_ptr :1; Eina_Bool owned :1;