make inc/dec private on non-windows

This commit is contained in:
Folkert 2022-10-26 16:47:12 +02:00
parent 38d7e57248
commit bb19644d40
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -981,14 +981,20 @@ pub fn build_header_help<'a, 'ctx, 'env>(
VoidType(t) => t.fn_type(arguments, false),
};
// this should be `Linkage::Private`, but that will remove all of the code for the inc/dec
// functions on windows. LLVM just does not emit the assembly for them. Investigate why this is
let linkage = if let roc_target::OperatingSystem::Windows = env.target_info.operating_system {
Linkage::External
} else {
Linkage::Private
};
let fn_val = add_func(
env.context,
env.module,
fn_name,
FunctionSpec::known_fastcc(fn_type),
// this should be `Linkage::Private`, but that will remove all of the code for the inc/dec
// functions on windows. LLVM just does not emit the assembly for them. Investigate why this is
Linkage::External,
linkage,
);
let subprogram = env.new_subprogram(fn_name);