harec

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

commit 19d98d5ac19b9f31c8196dd411a850856503e952
parent 9986c9218f691f5d6f579a6d31a3b03776297d2c
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Thu, 24 Jun 2021 16:56:27 +0000

Rename typ_store_reduce_{tagged => result}

The previous name was ambiguous with tagged union reduction, which is
what type_store_lookup_tagged does.

Signed-off-by: Eyal Sawady <ecs@d2evs.net>

Diffstat:
Minclude/type_store.h | 2+-
Msrc/check.c | 6+++---
Msrc/type_store.c | 2+-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/type_store.h b/include/type_store.h @@ -18,7 +18,7 @@ struct type_store { }; // Applies the type reduction algorithm to the given tagged union. -const struct type *type_store_reduce_tagged(struct type_store *store, +const struct type *type_store_reduce_result(struct type_store *store, struct type_tagged_union *in); struct ast_type; diff --git a/src/check.c b/src/check.c @@ -1594,7 +1594,7 @@ check_expr_if(struct context *ctx, .next = &_tags, }; expr->result = - type_store_reduce_tagged(ctx->store, &tags); + type_store_reduce_result(ctx->store, &tags); if (expr->result == NULL) { return error(aexpr->loc, expr, errors, "Invalid result type (dangling or ambiguous null)"); @@ -1818,7 +1818,7 @@ check_expr_match(struct context *ctx, if (hint) { expr->result = hint; } else { - expr->result = type_store_reduce_tagged( + expr->result = type_store_reduce_result( ctx->store, &result_type); if (expr->result == NULL) { return error(aexpr->loc, expr, errors, @@ -2361,7 +2361,7 @@ check_expr_switch(struct context *ctx, if (hint) { expr->result = hint; } else { - expr->result = type_store_reduce_tagged( + expr->result = type_store_reduce_result( ctx->store, &result_type); if (expr->result == NULL) { return error(aexpr->loc, expr, errors, diff --git a/src/type_store.c b/src/type_store.c @@ -873,7 +873,7 @@ type_store_lookup_tuple(struct type_store *store, struct type_tuple *values) // - If the resulting union only has one type, return that type // - Otherwise, return a tagged union of all the selected types const struct type * -type_store_reduce_tagged(struct type_store *store, struct type_tagged_union *in) +type_store_reduce_result(struct type_store *store, struct type_tagged_union *in) { if (!in) { return &builtin_type_void;