| ... | ... | @@ -66,11 +66,14 @@ comptime_args_fn_inst: Zir.Inst.Index = 0, |
| 66 | 66 | /// extra hash table lookup in the `monomorphed_funcs` set. |
| 67 | 67 | /// Sema will set this to null when it takes ownership. |
| 68 | 68 | preallocated_new_func: ?*Module.Fn = null, |
| 69 | | /// The key is `constant` AIR instructions to types that must be fully resolved |
| 70 | | /// after the current function body analysis is done. |
| 71 | | /// TODO: after upgrading to use InternPool change the key here to be an |
| 72 | | /// InternPool value index. |
| 73 | | types_to_resolve: std.ArrayListUnmanaged(Air.Inst.Ref) = .{}, |
| 69 | /// The key is types that must be fully resolved prior to machine code |
| 70 | /// generation pass. Types are added to this set when resolving them |
| 71 | /// immediately could cause a dependency loop, but they do need to be resolved |
| 72 | /// before machine code generation passes process the AIR. |
| 73 | /// It would work fine if this were an array list instead of an array hash map. |
| 74 | /// I chose array hash map with the intention to save time by omitting |
| 75 | /// duplicates. |
| 76 | types_to_resolve: std.AutoArrayHashMapUnmanaged(InternPool.Index, void) = .{}, |
| 74 | 77 | /// These are lazily created runtime blocks from block_inline instructions. |
| 75 | 78 | /// They are created when an break_inline passes through a runtime condition, because |
| 76 | 79 | /// Sema must convert comptime control flow to runtime control flow, which means |
| ... | ... | @@ -34085,8 +34088,7 @@ fn anonStructFieldIndex( |
| 34085 | 34088 | } |
| 34086 | 34089 | |
| 34087 | 34090 | fn queueFullTypeResolution(sema: *Sema, ty: Type) !void { |
| 34088 | | const inst_ref = try sema.addType(ty); |
| 34089 | | try sema.types_to_resolve.append(sema.gpa, inst_ref); |
| 34091 | try sema.types_to_resolve.put(sema.gpa, ty.toIntern(), {}); |
| 34090 | 34092 | } |
| 34091 | 34093 | |
| 34092 | 34094 | fn intAdd(sema: *Sema, lhs: Value, rhs: Value, ty: Type) !Value { |