Add the no-builtins
attribute to functions when no_builtins
is applied at the crate level.
When `no_builtins` is applied at the crate level, we should add the `no-builtins` attribute to each function to ensure it takes effect in LTO.
This commit is contained in:
parent
f0580df0d5
commit
cc08749df2
8 changed files with 68 additions and 1 deletions
|
@ -335,6 +335,10 @@ pub fn from_fn_attrs<'ll, 'tcx>(
|
|||
to_add.extend(probestack_attr(cx));
|
||||
to_add.extend(stackprotector_attr(cx));
|
||||
|
||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::NO_BUILTINS) {
|
||||
to_add.push(llvm::CreateAttrString(cx.llcx, "no-builtins"));
|
||||
}
|
||||
|
||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::COLD) {
|
||||
to_add.push(AttributeKind::Cold.create_attr(cx.llcx));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue