Signed-off-by: Armin Weigl <tb46305@gmail.com>
---
include/check.h | 1 -
src/check.c | 7 +++----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/check.h b/include/check.h
index d9c7e24..5fe6228 100644
--- a/include/check.h
+++ b/include/check.h
@@ -104,7 +104,6 @@ enum idecl_type {
// Keeps track of enum specific context required for enum field resolution
struct incomplete_enum_field {
struct ast_enum_field *field;
- const struct type *type;
struct scope *enum_scope;
};
diff --git a/src/check.c b/src/check.c
index 72e0161..6526c11 100644
--- a/src/check.c
+++ b/src/check.c
@@ -3567,7 +3567,6 @@ scan_enum_field(struct context *ctx, struct scope *imports,
xcalloc(1, sizeof(struct incomplete_enum_field));
*field = (struct incomplete_enum_field){
.field = f,
- .type = etype,
.enum_scope = enum_scope,
};
@@ -3583,6 +3582,7 @@ scan_enum_field(struct context *ctx, struct scope *imports,
&name, &localname);
fld->type = IDECL_ENUM_FLD;
fld->imports = imports;
+ fld->obj.type = etype,
fld->field = field;
}
@@ -3733,7 +3733,7 @@ resolve_enum_field(struct context *ctx, struct incomplete_declaration *idecl)
{
assert(idecl->type == IDECL_ENUM_FLD);
- const struct type *type = idecl->field->type;
+ const struct type *type = idecl->obj.type;
struct identifier localname = {
.name = idecl->obj.ident.name
@@ -3793,7 +3793,6 @@ resolve_enum_field(struct context *ctx, struct incomplete_declaration *idecl)
}
idecl->obj.otype = O_CONST;
- idecl->obj.type = type;
idecl->obj.value = value;
}
@@ -3888,13 +3887,13 @@ scan_enum_field_aliases(struct context *ctx, const struct scope_object *obj)
(struct incomplete_declaration *)val;
*field = (struct incomplete_enum_field){
.field = afield,
- .type = obj->type,
.enum_scope = idecl->field->enum_scope,
};
idecl = incomplete_declaration_create(ctx, (struct location){0},
ctx->scope, &ident, &name);
idecl->type = IDECL_ENUM_FLD;
+ idecl->obj.type = obj->type;
idecl->field = field;
};
}
base-commit: b84c8ba483396a597fb57c5db9b0d764d2484632
--
2.39.2