diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/InternPool.zig | 6 | ||||
| -rw-r--r-- | src/Sema.zig | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index 3e2077fd55..b8eaafceab 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -4705,6 +4705,7 @@ pub const GetFuncInstanceKey = struct { bare_return_type: Index, cc: std.builtin.CallingConvention, alignment: Alignment, + section: OptionalNullTerminatedString, is_noinline: bool, generic_owner: Index, inferred_error_set: bool, @@ -4782,6 +4783,7 @@ pub fn getFuncInstance(ip: *InternPool, gpa: Allocator, arg: GetFuncInstanceKey) func_extra_index, arg.generation, func_ty, + arg.section, ); } @@ -4911,6 +4913,7 @@ pub fn getFuncInstanceIes( func_extra_index, arg.generation, func_ty, + arg.section, ); } @@ -4922,6 +4925,7 @@ fn finishFuncInstance( func_extra_index: u32, generation: u32, func_ty: Index, + section: OptionalNullTerminatedString, ) Allocator.Error!Index { const fn_owner_decl = ip.declPtr(ip.funcDeclOwner(generic_owner)); const decl_index = try ip.createDecl(gpa, .{ @@ -4934,7 +4938,7 @@ fn finishFuncInstance( .ty = func_ty.toType(), .val = func_index.toValue(), .alignment = .none, - .@"linksection" = fn_owner_decl.@"linksection", + .@"linksection" = section, .@"addrspace" = fn_owner_decl.@"addrspace", .analysis = .complete, .deletion_flag = false, diff --git a/src/Sema.zig b/src/Sema.zig index a88b29cd10..3f8b936e0b 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -8846,6 +8846,11 @@ fn funcCommon( .bare_return_type = bare_return_type.toIntern(), .cc = cc_resolved, .alignment = alignment.?, + .section = switch (section) { + .generic => unreachable, + .default => .none, + .explicit => |x| x.toOptional(), + }, .is_noinline = is_noinline, .inferred_error_set = inferred_error_set, .generic_owner = sema.generic_owner, |
