@@ -2941,9 +2941,13 @@ pub const Object = struct {
|
||||
const target = owner_mod.resolved_target.result;
|
||||
const sret = firstParamSRet(fn_info, zcu);
|
||||
|
||||
const is_extern = decl.isExtern(zcu);
|
||||
const function_index = try o.builder.addFunction(
|
||||
try o.lowerType(zig_fn_type),
|
||||
try o.builder.string(ip.stringToSlice(try decl.getFullyQualifiedName(zcu))),
|
||||
try o.builder.string(ip.stringToSlice(if (is_extern)
|
||||
decl.name
|
||||
else
|
||||
try decl.getFullyQualifiedName(zcu))),
|
||||
toLlvmAddressSpace(decl.@"addrspace", target),
|
||||
);
|
||||
gop.value_ptr.* = function_index.ptrConst(&o.builder).global;
|
||||
@@ -2951,7 +2955,6 @@ pub const Object = struct {
|
||||
var attributes: Builder.FunctionAttributes.Wip = .{};
|
||||
defer attributes.deinit(&o.builder);
|
||||
|
||||
const is_extern = decl.isExtern(zcu);
|
||||
if (!is_extern) {
|
||||
function_index.setLinkage(.internal, &o.builder);
|
||||
function_index.setUnnamedAddr(.unnamed_addr, &o.builder);
|
||||
|
||||
Reference in New Issue
Block a user