summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/logic/amgc_unit_entities.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/logic/amgc_unit_entities.c b/src/logic/amgc_unit_entities.c
index b528a19..c86c1bc 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 <libfirm/tv.h>
#include <apimagic/apimagic.h>
@@ -42,6 +43,7 @@ int amgc_get_unit_entities(
struct amgc_unit_entities_impl *entities;
size_t ndefs;
size_t nelements;
+ int enumval;
if (!meta)
meta = &umeta;
@@ -116,7 +118,10 @@ int amgc_get_unit_entities(
break;
case ENTITY_ENUM_VALUE:
- uentities->enumvals[meta->nenumvals++].entity = entity;
+ enumval = (int)get_tarval_long(entity->enum_value.tv);
+ uentities->enumvals[meta->nenumvals].entity = entity;
+ uentities->enumvals[meta->nenumvals].enumval = enumval;
+ meta->nenumvals++;
break;
case ENTITY_TYPEDEF: