From 083ee8e0e28ed0d1c4e1df6b5aa12f2709731b50 Mon Sep 17 00:00:00 2001 From: mlugg Date: Mon, 14 Aug 2023 13:06:47 +0100 Subject: InternPool: preserve indices of builtin types when resolved Some builtin types have a special InternPool index (e.g. `.type_info_type`) so that AstGen can refer to them before semantic analysis. Unfortunately, this previously led to a second index existing to refer to the type once it was resolved, complicating Sema by having the concept of an "unresolved" type index. This change makes Sema modify these InternPool indices in-place to contain the expanded representation when resolved. The analysis of the corresponding decls is caught in `Module.semaDecl`, and a field is set on Sema telling it which index to place struct/union/enum types at. This system could break if `std.builtin` contained complex decls which evaluate multiple struct types, but this will be caught by the assertions in `InternPool.resolveBuiltinType`. The AstGen result types which were disabled in 6917a8c have been re-enabled. Resolves: #16603 --- src/codegen/llvm.zig | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/codegen') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 1ddf211bda..3db6321119 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -3134,17 +3134,6 @@ pub const Object = struct { .null_type, .undefined_type, .enum_literal_type, - .atomic_order_type, - .atomic_rmw_op_type, - .calling_convention_type, - .address_space_type, - .float_mode_type, - .reduce_op_type, - .call_modifier_type, - .prefetch_options_type, - .export_options_type, - .extern_options_type, - .type_info_type, => unreachable, .manyptr_u8_type, .manyptr_const_u8_type, -- cgit v1.2.3