~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] gen: don't reinvent mkgtemp

Details
Message ID
<20230923015005.28436-1-bgs@turminal.net>
DKIM signature
missing
Download raw message
Patch: +5 -24
Signed-off-by: Bor Grošelj Simić <bgs@turminal.net>
---
 src/gen.c | 29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

diff --git a/src/gen.c b/src/gen.c
index 03ea6f7..daca666 100644
--- a/src/gen.c
+++ b/src/gen.c
@@ -162,11 +162,7 @@ gen_load(struct gen_context *ctx, struct gen_value object)
		break; // no-op
	}

	struct gen_value value = {
		.kind = GV_TEMP,
		.type = object.type,
		.name = gen_name(&ctx->id, "load.%d"),
	};
	struct gen_value value = mkgtemp(ctx, object.type, "load.%d");
	struct qbe_value qobj = mkqval(ctx, &object),
		qval = mkqval(ctx, &value);
	enum qbe_instr qi = load_for_type(ctx, object.type);
@@ -997,12 +993,7 @@ gen_expr_binding_unpack(struct gen_context *ctx,
	assert(binding->object == NULL);

	const struct type *type = binding->initializer->result;
	char *tuple_name = gen_name(&ctx->id, "tupleunpack.%d");
	struct gen_value tuple_gv = {
		.kind = GV_TEMP,
		.type = type,
		.name = tuple_name,
	};
	struct gen_value tuple_gv = mkgtemp(ctx, type, "tupleunpack.%d");
	struct qbe_value tuple_qv = mklval(ctx, &tuple_gv);
	struct qbe_value sz = constl(type->size);
	enum qbe_instr alloc = alloc_for_align(type->align);
@@ -1017,14 +1008,8 @@ gen_expr_binding_unpack(struct gen_context *ctx,
		}
		assert(unpack->object->otype != O_DECL);

		const struct type *type = unpack->object->type;
		struct gen_value item_gv = {
			.kind = GV_TEMP,
			.type = type,
			.name = gen_name(&ctx->id, "binding.%d"),
		};
		struct gen_binding *gb = xcalloc(1, sizeof(struct gen_binding));
		gb->value = item_gv;
		gb->value = mkgtemp(ctx, unpack->object->type, "binding.%d");
		gb->object = unpack->object;
		gb->next = ctx->bindings;
		ctx->bindings = gb;
@@ -1064,9 +1049,7 @@ gen_expr_binding(struct gen_context *ctx, const struct expression *expr)

		const struct type *type = binding->object->type;
		struct gen_binding *gb = xcalloc(1, sizeof(struct gen_binding));
		gb->value.kind = GV_TEMP;
		gb->value.type = type;
		gb->value.name = gen_name(&ctx->id, "binding.%d");
		gb->value = mkgtemp(ctx, type, "binding.%d");
		gb->object = binding->object;
		gb->next = ctx->bindings;
		ctx->bindings = gb;
@@ -2519,9 +2502,7 @@ gen_match_with_tagged(struct gen_context *ctx,
		}

		struct gen_binding *gb = xcalloc(1, sizeof(struct gen_binding));
		gb->value.kind = GV_TEMP;
		gb->value.type = _case->type;
		gb->value.name = gen_name(&ctx->id, "binding.%d");
		gb->value = mkgtemp(ctx, _case->type, "binding.%d");
		gb->object = _case->object;
		gb->next = ctx->bindings;
		ctx->bindings = gb;
-- 
2.38.4

[harec/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CVPWX058AD58.1YPJRC5P13R6E@cirno2>
In-Reply-To
<20230923015005.28436-1-bgs@turminal.net> (view parent)
DKIM signature
missing
Download raw message
harec/patches: SUCCESS in 58s

[gen: don't reinvent mkgtemp][0] from [Bor Grošelj Simić][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/44958
[1]: bgs@turminal.net

✓ #1061644 SUCCESS harec/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/1061644
✓ #1061646 SUCCESS harec/patches/netbsd.yml  https://builds.sr.ht/~sircmpwn/job/1061646
✓ #1061645 SUCCESS harec/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/1061645
Details
Message ID
<CVRMDR1M7NXJ.1CGE9KQGTB2XV@monch>
In-Reply-To
<20230923015005.28436-1-bgs@turminal.net> (view parent)
DKIM signature
missing
Download raw message
thanks!

to git@git.sr.ht:~sircmpwn/harec
  6151bd6..a3687cb  master -> master
Reply to thread Export thread (mbox)