diff options
author | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2018-01-12 17:25:23 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2018-01-12 18:05:13 +0100 |
commit | db417349545efeb8e54f2281192bd3480c78e1a4 (patch) | |
tree | 198ef6a31e99bae4230b0c2fc6d6198a6923be4e | |
parent | 4dfde2cd245e3d8ffcb426232fa8245d5b0b88fc (diff) | |
download | efl-db417349545efeb8e54f2281192bd3480c78e1a4.tar.gz |
eolian: store typedecl/class in type
-rw-r--r-- | src/lib/eolian/database_validate.c | 14 | ||||
-rw-r--r-- | src/lib/eolian/eolian_database.h | 5 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 9ac74dba76..b6e40b690a 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 f68093df3b..00a3967183 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; |