summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-10-08 21:09:19 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-10-08 22:28:51 -0300
commit36405c6556fe81afe13062e908300c36d798f4c0 (patch)
tree0316a0e5eb04a902e359f38124270849d0cd318e /src/bin/eolian_cxx
parent101c13d582a38a8e3886c14032b2ae3fa92e8351 (diff)
eolian-cxx: Fixed pointer dereferencing for Eolian types and constant propagation for C++ eina list containers
With the addition of pointer types, the eolian C++ generator now has to dereference to get the base type which might be a complex type.
Diffstat (limited to 'src/bin/eolian_cxx')
-rw-r--r--src/bin/eolian_cxx/type_lookup.hh5
-rw-r--r--src/bin/eolian_cxx/type_lookup_table.cc3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/eolian_cxx/type_lookup.hh b/src/bin/eolian_cxx/type_lookup.hh
index d366f5d87a..006201c122 100644
--- a/src/bin/eolian_cxx/type_lookup.hh
+++ b/src/bin/eolian_cxx/type_lookup.hh
@@ -56,15 +56,16 @@ type_lookup(const Eolian_Type* type,
56 lookup_table_type const& lut = type_lookup_table) 56 lookup_table_type const& lut = type_lookup_table)
57{ 57{
58 if (type == NULL) return { efl::eolian::void_type }; // XXX shouldn't 58 if (type == NULL) return { efl::eolian::void_type }; // XXX shouldn't
59 // assert(type != NULL);
59 60
60 std::vector<Eolian_Type const*> types; 61 std::vector<Eolian_Type const*> types;
61 types.push_back(type); 62 types.push_back(type);
62 63
63 if (type_is_complex(*type)) 64 if (::eolian_type_type_get(type) == EOLIAN_TYPE_POINTER && type_is_complex(*eolian_type_base_type_get(type)))
64 { 65 {
65 efl::eina::iterator<Eolian_Type const> end; 66 efl::eina::iterator<Eolian_Type const> end;
66 efl::eina::iterator<Eolian_Type const> it 67 efl::eina::iterator<Eolian_Type const> it
67 (::eolian_type_subtypes_get(type)); 68 (::eolian_type_subtypes_get(eolian_type_base_type_get(type)));
68 while(it != end) 69 while(it != end)
69 { 70 {
70 if(Eolian_Type const* t = &*it) 71 if(Eolian_Type const* t = &*it)
diff --git a/src/bin/eolian_cxx/type_lookup_table.cc b/src/bin/eolian_cxx/type_lookup_table.cc
index 7c58618fba..2702225dd0 100644
--- a/src/bin/eolian_cxx/type_lookup_table.cc
+++ b/src/bin/eolian_cxx/type_lookup_table.cc
@@ -21,11 +21,12 @@ type_lookup_table
21 {"Eina_List *", eolian_type::complex_, false, "efl::eina::range_list", {"eina-cxx/eina_list.hh"}}, 21 {"Eina_List *", eolian_type::complex_, false, "efl::eina::range_list", {"eina-cxx/eina_list.hh"}},
22 {"Eina_List *", eolian_type::complex_, true, "efl::eina::list", {"eina-cxx/eina_list.hh"}}, 22 {"Eina_List *", eolian_type::complex_, true, "efl::eina::list", {"eina-cxx/eina_list.hh"}},
23 {"Eo *", eolian_type::simple_, true, "efl::eo::base", {"eo_base.hh"}}, 23 {"Eo *", eolian_type::simple_, true, "efl::eo::base", {"eo_base.hh"}},
24 {"Eo *", eolian_type::simple_, false, "efl::eo::base", {"eo_base.hh"}},
24 //{"Evas_Object_Box_Layout", eolian_type::callback_, {"Evas.h"}}, 25 //{"Evas_Object_Box_Layout", eolian_type::callback_, {"Evas.h"}},
25 {"Evas_Object *", eolian_type::simple_, false, "evas::object", {"canvas/evas_object.eo.hh"}}, 26 {"Evas_Object *", eolian_type::simple_, false, "evas::object", {"canvas/evas_object.eo.hh"}},
26 {"char *", eolian_type::simple_, true, "std::unique_ptr<char*>", {"memory"}}, 27 {"char *", eolian_type::simple_, true, "std::unique_ptr<char*>", {"memory"}},
27 {"const Eina_Inlist *", eolian_type::complex_, false, "efl::eina::range_inlist", {"eina-cxx/eina_inlist.hh"}}, 28 {"const Eina_Inlist *", eolian_type::complex_, false, "efl::eina::range_inlist", {"eina-cxx/eina_inlist.hh"}},
28 {"const Eina_List *", eolian_type::complex_, false, "efl::eina::range_list", {"eina-cxx/eina_ptrlist.hh"}}, 29 {"const Eina_List *", eolian_type::complex_, false, "efl::eina::crange_list", {"eina-cxx/eina_ptrlist.hh"}},
29 {"const char *", eolian_type::simple_, false, "std::string", {"string"}} 30 {"const char *", eolian_type::simple_, false, "std::string", {"string"}}
30}; 31};
31 32