Skip to content

Commit ffb0058

Browse files
committed
add nounwind
1 parent 1fb800e commit ffb0058

File tree

1 file changed

+4
-1
lines changed
  • compiler/rustc_codegen_llvm/src/back

1 file changed

+4
-1
lines changed

compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,10 @@ pub(crate) fn run_pass_manager(
730730
let foo = crate::declare::declare_simple_fn(&cx, &mapper_begin, llvm::CallConv::CCallConv, llvm::UnnamedAddr::No, llvm::Visibility::Default, mapper_fn_ty);
731731
let bar = crate::declare::declare_simple_fn(&cx, &mapper_update, llvm::CallConv::CCallConv, llvm::UnnamedAddr::No, llvm::Visibility::Default, mapper_fn_ty);
732732
let baz = crate::declare::declare_simple_fn(&cx, &mapper_end, llvm::CallConv::CCallConv, llvm::UnnamedAddr::No, llvm::Visibility::Default, mapper_fn_ty);
733-
// TODO: add nounwind
733+
let nounwind = llvm::AttributeKind::NoUnwind.create_attr(cx.llcx);
734+
attributes::apply_to_llfn(foo, Function, &[nounwind]);
735+
attributes::apply_to_llfn(bar, Function, &[nounwind]);
736+
attributes::apply_to_llfn(baz, Function, &[nounwind]);
734737

735738
dbg!("created struct");
736739
for num in 0..9 {

0 commit comments

Comments
 (0)