summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-12-31 10:58:48 -0500
committermidipix <writeonce@midipix.org>2016-01-01 22:50:25 -0500
commit9ea4a335eec614867318a1a280a38ad9d392a269 (patch)
tree49550fac0d3902895a8fb016a5d0cae097390e7a
parent890152e338506badc1348a6d7642414a805b2419 (diff)
downloadapimagic-9ea4a335eec614867318a1a280a38ad9d392a269.tar.bz2
apimagic-9ea4a335eec614867318a1a280a38ad9d392a269.tar.xz
ammgc_get_unit_entities(): obtain enum member values at initialization.
-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: