From c6c7cc727290663e50b8a4d28e92214fa805ca95 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 18 Dec 2024 14:44:37 -0500 Subject: Revert "Deprecate "&" for stack references" This reverts commit 41c0ea851a542bcd7d54b8c5c06d70e1e00095e1. --- types.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'types.c') diff --git a/types.c b/types.c index f526af60..bcbb74c9 100644 --- a/types.c +++ b/types.c @@ -74,7 +74,7 @@ CORD type_to_cord(type_t *t) { } case PointerType: { auto ptr = Match(t, PointerType); - CORD sigil = ptr->is_view ? "&" : "@"; + CORD sigil = ptr->is_stack ? "&" : "@"; return CORD_all(sigil, type_to_cord(ptr->pointed)); } case EnumType: { @@ -134,7 +134,7 @@ bool type_is_a(type_t *t, type_t *req) auto t_ptr = Match(t, PointerType); auto req_ptr = Match(req, PointerType); if (type_eq(t_ptr->pointed, req_ptr->pointed)) - return (!t_ptr->is_view && req_ptr->is_view) || (!t_ptr->is_view); + return (!t_ptr->is_stack && req_ptr->is_stack) || (!t_ptr->is_stack); } return false; } @@ -295,11 +295,11 @@ PUREFUNC bool can_send_over_channel(type_t *t) } } -PUREFUNC bool has_view_memory(type_t *t) +PUREFUNC bool has_stack_memory(type_t *t) { switch (t->tag) { - case PointerType: return Match(t, PointerType)->is_view; - case OptionalType: return has_view_memory(Match(t, OptionalType)->type); + case PointerType: return Match(t, PointerType)->is_stack; + case OptionalType: return has_stack_memory(Match(t, OptionalType)->type); default: return false; } } @@ -378,7 +378,7 @@ PUREFUNC bool can_promote(type_t *actual, type_t *needed) // Can't use @Foo for a function that wants @Baz // But you *can* use @Foo for a function that wants @Memory return false; - else if (actual_ptr->is_view && !needed_ptr->is_view) + else if (actual_ptr->is_stack && !needed_ptr->is_stack) // Can't use &x for a function that wants a @Foo or ?Foo return false; else -- cgit v1.2.3