summaryrefslogtreecommitdiff
path: root/src/logic
diff options
context:
space:
mode:
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/amgc_unit_entities.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/logic/amgc_unit_entities.c b/src/logic/amgc_unit_entities.c
index e5b9000..4309d89 100644
--- a/src/logic/amgc_unit_entities.c
+++ b/src/logic/amgc_unit_entities.c
@@ -6,6 +6,7 @@
#include <cparser/ast/ast_t.h>
#include <cparser/ast/entity_t.h>
+#include <cparser/ast/type_t.h>
#include <libfirm/tv.h>
#include <apimagic/apimagic.h>
@@ -40,10 +41,12 @@ int amgc_get_unit_entities(
struct amgc_entity * aentity;
struct amgc_unit_entities * uentities;
union entity_t * entity;
+ union type_t * etype;
struct amgc_unit_entities_impl *entities;
size_t ndefs;
size_t nelements;
int enumval;
+ int ptrdepth;
if (!meta)
meta = &umeta;
@@ -125,7 +128,14 @@ int amgc_get_unit_entities(
break;
case ENTITY_TYPEDEF:
+ etype = entity->declaration.type;
+ ptrdepth = 0;
+
+ for (; etype->kind == TYPE_POINTER; etype=etype->pointer.points_to)
+ ptrdepth++;
+
uentities->typedefs[meta->ntypedefs].entity = entity;
+ uentities->typedefs[meta->ntypedefs].ptrdepth = ptrdepth;
meta->ntypedefs++;
break;