mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Inline BuilderMethods::call for intrinsics
Intrinsics only need a fraction of the functionality offered by BuilderMethods::call and in particular don't need the FnAbi to be computed other than (currently) as step towards computing the function value type.
This commit is contained in:
@@ -1705,7 +1705,7 @@ pub(crate) fn catch_ret(
|
||||
ret.expect("LLVM does not have support for catchret")
|
||||
}
|
||||
|
||||
fn check_call<'b>(
|
||||
pub(crate) fn check_call<'b>(
|
||||
&mut self,
|
||||
typ: &str,
|
||||
fn_ty: &'ll Type,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
use std::assert_matches::assert_matches;
|
||||
use std::cmp::Ordering;
|
||||
use std::ffi::c_uint;
|
||||
use std::ptr;
|
||||
|
||||
use rustc_abi::{
|
||||
Align, BackendRepr, ExternAbi, Float, HasDataLayout, Primitive, Size, WrappingRange,
|
||||
@@ -677,7 +679,20 @@ fn codegen_llvm_intrinsic_call(
|
||||
}
|
||||
}
|
||||
|
||||
let llret = self.call(fn_ty, None, None, fn_ptr, &llargs, None, None);
|
||||
debug!("call intrinsic {:?} with args ({:?})", instance, llargs);
|
||||
let args = self.check_call("call", fn_ty, fn_ptr, &llargs);
|
||||
let llret = unsafe {
|
||||
llvm::LLVMBuildCallWithOperandBundles(
|
||||
self.llbuilder,
|
||||
fn_ty,
|
||||
fn_ptr,
|
||||
args.as_ptr() as *const &llvm::Value,
|
||||
args.len() as c_uint,
|
||||
ptr::dangling(),
|
||||
0,
|
||||
c"".as_ptr(),
|
||||
)
|
||||
};
|
||||
if is_cleanup {
|
||||
self.apply_attrs_to_cleanup_callsite(llret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user