~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH harec v1] scan_enum_field: store type directly in scope_object

Details
Message ID
<20230219095514.13070-1-tb46305@gmail.com>
DKIM signature
pass
Download raw message
Patch: +3 -5
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

[harec/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CQMG7USJBG2A.8O9XU1JJBBCP@cirno2>
In-Reply-To
<20230219095514.13070-1-tb46305@gmail.com> (view parent)
DKIM signature
missing
Download raw message
harec/patches: SUCCESS in 59s

[scan_enum_field: store type directly in scope_object][0] from [Armin Weigl][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/39151
[1]: tb46305@gmail.com

✓ #943269 SUCCESS harec/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/943269
✓ #943270 SUCCESS harec/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/943270
✓ #943271 SUCCESS harec/patches/netbsd.yml  https://builds.sr.ht/~sircmpwn/job/943271
Details
Message ID
<CQOZKVLC2UYN.27KGWED0BPEZH@taiga>
In-Reply-To
<20230219095514.13070-1-tb46305@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/harec
   8ab6702..b95dcfd  master -> master
Reply to thread Export thread (mbox)