harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f9132effef31c1eb0220c5dd3278fe747e91b893
parent 3228c9044b3074c8b86410213e7404a3dbdbabf9
Author: Drew DeVault <sir@cmpwn.com>
Date:   Wed,  4 Aug 2021 12:33:17 +0200

gen: simplify gen_copy_memcpy

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Msrc/gen.c | 14+++-----------
1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -18,18 +18,10 @@ gen_copy_memcpy(struct gen_context *ctx, struct gen_value dest, struct gen_value src) { struct qbe_value rtfunc = mkrtfunc(ctx, "rt.memcpy"); + struct qbe_value dtemp = mklval(ctx, &dest); + struct qbe_value stemp = mklval(ctx, &src); struct qbe_value sz = constl(dest.type->size); - struct qbe_value dtemp = { - .kind = QV_TEMPORARY, - .type = ctx->arch.ptr, - .name = dest.name, - }, stemp = { - .kind = QV_TEMPORARY, - .type = ctx->arch.ptr, - .name = src.name, - }; - pushi(ctx->current, NULL, Q_CALL, &rtfunc, - &dtemp, &stemp, &sz, NULL); + pushi(ctx->current, NULL, Q_CALL, &rtfunc, &dtemp, &stemp, &sz, NULL); } static void