Apply noreturn and nounwind LLVM attributes to callsites
This commit is contained in:
parent
8c7a05a23f
commit
007bd17a68
1 changed files with 6 additions and 1 deletions
|
@ -511,7 +511,12 @@ impl<'tcx> FnAbiLlvmExt<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply_attrs_callsite(&self, bx: &mut Builder<'a, 'll, 'tcx>, callsite: &'ll Value) {
|
fn apply_attrs_callsite(&self, bx: &mut Builder<'a, 'll, 'tcx>, callsite: &'ll Value) {
|
||||||
// FIXME(wesleywiser, eddyb): We should apply `nounwind` and `noreturn` as appropriate to this callsite.
|
if self.ret.layout.abi.is_uninhabited() {
|
||||||
|
llvm::Attribute::NoReturn.apply_callsite(llvm::AttributePlace::Function, callsite);
|
||||||
|
}
|
||||||
|
if !self.can_unwind {
|
||||||
|
llvm::Attribute::NoUnwind.apply_callsite(llvm::AttributePlace::Function, callsite);
|
||||||
|
}
|
||||||
|
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
let mut apply = |cx: &CodegenCx<'_, '_>, attrs: &ArgAttributes| {
|
let mut apply = |cx: &CodegenCx<'_, '_>, attrs: &ArgAttributes| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue