Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects

This commit is contained in:
Folkert 2022-10-30 15:57:07 +01:00
commit dbd0d30893
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
98 changed files with 4649 additions and 1433 deletions

View file

@ -981,12 +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),
Linkage::Private,
linkage,
);
let subprogram = env.new_subprogram(fn_name);