@@ -1462,16 +1462,6 @@ pub const MapIndex = enum(u32) {
14621462 }
14631463};
14641464
1465- pub const RuntimeIndex = enum (u32 ) {
1466- zero = 0 ,
1467- comptime_field_ptr = std .math .maxInt (u32 ),
1468- _ ,
1469-
1470- pub fn increment (ri : * RuntimeIndex ) void {
1471- ri .* = @enumFromInt (@intFromEnum (ri .* ) + 1 );
1472- }
1473- };
1474-
14751465pub const ComptimeAllocIndex = enum (u32 ) { _ };
14761466
14771467pub const NamespaceIndex = enum (u32 ) {
@@ -1971,9 +1961,6 @@ pub const Key = union(enum) {
19711961 is_var_args : bool ,
19721962 is_generic : bool ,
19731963 is_noinline : bool ,
1974- cc_is_generic : bool ,
1975- section_is_generic : bool ,
1976- addrspace_is_generic : bool ,
19771964
19781965 pub fn paramIsComptime (self : @This (), i : u5 ) bool {
19791966 assert (i < self .param_types .len );
@@ -5466,10 +5453,7 @@ pub const Tag = enum(u8) {
54665453 has_comptime_bits : bool ,
54675454 has_noalias_bits : bool ,
54685455 is_noinline : bool ,
5469- cc_is_generic : bool ,
5470- section_is_generic : bool ,
5471- addrspace_is_generic : bool ,
5472- _ : u6 = 0 ,
5456+ _ : u9 = 0 ,
54735457 };
54745458 };
54755459
@@ -6895,9 +6879,6 @@ fn extraFuncType(tid: Zcu.PerThread.Id, extra: Local.Extra, extra_index: u32) Ke
68956879 .cc = type_function .data .flags .cc .unpack (),
68966880 .is_var_args = type_function .data .flags .is_var_args ,
68976881 .is_noinline = type_function .data .flags .is_noinline ,
6898- .cc_is_generic = type_function .data .flags .cc_is_generic ,
6899- .section_is_generic = type_function .data .flags .section_is_generic ,
6900- .addrspace_is_generic = type_function .data .flags .addrspace_is_generic ,
69016882 .is_generic = type_function .data .flags .is_generic ,
69026883 };
69036884}
@@ -8539,9 +8520,6 @@ pub fn getFuncType(
85398520 .has_noalias_bits = key .noalias_bits != 0 ,
85408521 .is_generic = key .is_generic ,
85418522 .is_noinline = key .is_noinline ,
8542- .cc_is_generic = key .cc == null ,
8543- .section_is_generic = key .section_is_generic ,
8544- .addrspace_is_generic = key .addrspace_is_generic ,
85458523 },
85468524 });
85478525
@@ -8713,10 +8691,6 @@ pub const GetFuncDeclIesKey = struct {
87138691 bare_return_type : Index ,
87148692 /// null means generic.
87158693 cc : ? std.builtin.CallingConvention ,
8716- /// null means generic.
8717- alignment : ? Alignment ,
8718- section_is_generic : bool ,
8719- addrspace_is_generic : bool ,
87208694 is_var_args : bool ,
87218695 is_generic : bool ,
87228696 is_noinline : bool ,
@@ -8802,9 +8776,6 @@ pub fn getFuncDeclIes(
88028776 .has_noalias_bits = key .noalias_bits != 0 ,
88038777 .is_generic = key .is_generic ,
88048778 .is_noinline = key .is_noinline ,
8805- .cc_is_generic = key .cc == null ,
8806- .section_is_generic = key .section_is_generic ,
8807- .addrspace_is_generic = key .addrspace_is_generic ,
88088779 },
88098780 });
88108781 if (key .comptime_bits != 0 ) extra .appendAssumeCapacity (.{key .comptime_bits });
@@ -8936,9 +8907,6 @@ pub const GetFuncInstanceKey = struct {
89368907 comptime_args : []const Index ,
89378908 noalias_bits : u32 ,
89388909 bare_return_type : Index ,
8939- cc : std.builtin.CallingConvention ,
8940- alignment : Alignment ,
8941- section : OptionalNullTerminatedString ,
89428910 is_noinline : bool ,
89438911 generic_owner : Index ,
89448912 inferred_error_set : bool ,
@@ -8953,11 +8921,14 @@ pub fn getFuncInstance(
89538921 if (arg .inferred_error_set )
89548922 return getFuncInstanceIes (ip , gpa , tid , arg );
89558923
8924+ const generic_owner = unwrapCoercedFunc (ip , arg .generic_owner );
8925+ const generic_owner_ty = ip .indexToKey (ip .funcDeclInfo (generic_owner ).ty ).func_type ;
8926+
89568927 const func_ty = try ip .getFuncType (gpa , tid , .{
89578928 .param_types = arg .param_types ,
89588929 .return_type = arg .bare_return_type ,
89598930 .noalias_bits = arg .noalias_bits ,
8960- .cc = arg .cc ,
8931+ .cc = generic_owner_ty .cc ,
89618932 .is_noinline = arg .is_noinline ,
89628933 });
89638934
@@ -8967,8 +8938,6 @@ pub fn getFuncInstance(
89678938 try extra .ensureUnusedCapacity (@typeInfo (Tag .FuncInstance ).@"struct" .fields .len +
89688939 arg .comptime_args .len );
89698940
8970- const generic_owner = unwrapCoercedFunc (ip , arg .generic_owner );
8971-
89728941 assert (arg .comptime_args .len == ip .funcTypeParamsLen (ip .typeOf (generic_owner )));
89738942
89748943 const prev_extra_len = extra .mutate .len ;
@@ -9015,8 +8984,6 @@ pub fn getFuncInstance(
90158984 generic_owner ,
90168985 func_index ,
90178986 func_extra_index ,
9018- arg .alignment ,
9019- arg .section ,
90208987 );
90218988 return gop .put ();
90228989}
@@ -9041,6 +9008,7 @@ pub fn getFuncInstanceIes(
90419008 try items .ensureUnusedCapacity (4 );
90429009
90439010 const generic_owner = unwrapCoercedFunc (ip , arg .generic_owner );
9011+ const generic_owner_ty = ip .indexToKey (ip .funcDeclInfo (arg .generic_owner ).ty ).func_type ;
90449012
90459013 // The strategy here is to add the function decl unconditionally, then to
90469014 // ask if it already exists, and if so, revert the lengths of the mutated
@@ -9096,15 +9064,12 @@ pub fn getFuncInstanceIes(
90969064 .params_len = params_len ,
90979065 .return_type = error_union_type ,
90989066 .flags = .{
9099- .cc = .pack (arg .cc ),
9067+ .cc = .pack (generic_owner_ty .cc ),
91009068 .is_var_args = false ,
91019069 .has_comptime_bits = false ,
91029070 .has_noalias_bits = arg .noalias_bits != 0 ,
91039071 .is_generic = false ,
91049072 .is_noinline = arg .is_noinline ,
9105- .cc_is_generic = false ,
9106- .section_is_generic = false ,
9107- .addrspace_is_generic = false ,
91089073 },
91099074 });
91109075 // no comptime_bits because has_comptime_bits is false
@@ -9168,8 +9133,6 @@ pub fn getFuncInstanceIes(
91689133 generic_owner ,
91699134 func_index ,
91709135 func_extra_index ,
9171- arg .alignment ,
9172- arg .section ,
91739136 );
91749137
91759138 func_gop .putFinal (func_index );
@@ -9187,8 +9150,6 @@ fn finishFuncInstance(
91879150 generic_owner : Index ,
91889151 func_index : Index ,
91899152 func_extra_index : u32 ,
9190- alignment : Alignment ,
9191- section : OptionalNullTerminatedString ,
91929153) Allocator.Error ! void {
91939154 const fn_owner_nav = ip .getNav (ip .funcDeclInfo (generic_owner ).owner_nav );
91949155 const fn_namespace = ip .getCau (fn_owner_nav .analysis_owner .unwrap ().? ).namespace ;
@@ -9201,8 +9162,8 @@ fn finishFuncInstance(
92019162 .name = nav_name ,
92029163 .fqn = try ip .namespacePtr (fn_namespace ).internFullyQualifiedName (ip , gpa , tid , nav_name ),
92039164 .val = func_index ,
9204- .alignment = alignment ,
9205- .@"linksection" = section ,
9165+ .alignment = fn_owner_nav . status . resolved . alignment ,
9166+ .@"linksection" = fn_owner_nav . status . resolved .@ "linksection" ,
92069167 .@"addrspace" = fn_owner_nav .status .resolved .@"addrspace" ,
92079168 });
92089169
@@ -9788,7 +9749,6 @@ fn addExtraAssumeCapacity(extra: Local.Extra.Mutable, item: anytype) u32 {
97889749 OptionalNamespaceIndex ,
97899750 MapIndex ,
97909751 OptionalMapIndex ,
9791- RuntimeIndex ,
97929752 String ,
97939753 NullTerminatedString ,
97949754 OptionalNullTerminatedString ,
@@ -9852,7 +9812,6 @@ fn extraDataTrail(extra: Local.Extra, comptime T: type, index: u32) struct { dat
98529812 OptionalNamespaceIndex ,
98539813 MapIndex ,
98549814 OptionalMapIndex ,
9855- RuntimeIndex ,
98569815 String ,
98579816 NullTerminatedString ,
98589817 OptionalNullTerminatedString ,
0 commit comments