MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / call

Method call

crates/rustc_codegen_nvvm/src/builder.rs:1093–1126  ·  view source on GitHub ↗
(
        &mut self,
        _: &'ll Type,
        llfn: &'ll Value,
        args: &[&'ll Value],
        _funclet: Option<&()>,
    )

Source from the content-addressed store, hash-verified

1091 }
1092
1093 fn call(
1094 &mut self,
1095 _: &'ll Type,
1096 llfn: &'ll Value,
1097 args: &[&'ll Value],
1098 _funclet: Option<&()>,
1099 ) -> &'ll Value {
1100 trace!("Calling fn {:?} with args {:?}", llfn, args);
1101 self.cx.last_call_llfn.set(None);
1102 let args = self.check_call("call", llfn, args);
1103
1104 let mut ret = unsafe {
1105 llvm::LLVMRustBuildCall(
1106 self.llbuilder,
1107 llfn,
1108 args.as_ptr() as *const &llvm::Value,
1109 args.len() as c_uint,
1110 None,
1111 )
1112 };
1113
1114 // bitcast return type if the type was remapped
1115 let map = self.cx.remapped_integer_args.borrow();
1116 let mut fn_ty = unsafe { LLVMRustGetValueType(llfn) };
1117 while self.cx.type_kind(fn_ty) == TypeKind::Pointer {
1118 fn_ty = self.cx.element_type(fn_ty);
1119 }
1120 if let Some((Some(ret_ty), _)) = map.get(fn_ty) {
1121 self.cx.last_call_llfn.set(Some(ret));
1122 ret = transmute_llval(self.llbuilder, self.cx, ret, ret_ty);
1123 }
1124
1125 ret
1126 }
1127
1128 fn zext(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
1129 trace!("Zext {:?} to {:?}", val, dest_ty);

Callers 12

override_libm_functionFunction · 0.80
abortMethod · 0.80
assumeMethod · 0.80
expectMethod · 0.80
va_startMethod · 0.80
va_endMethod · 0.80
inline_asm_callFunction · 0.80
invokeMethod · 0.80
checked_binopMethod · 0.80
atomic_loadMethod · 0.80

Calls 11

LLVMRustGetValueTypeFunction · 0.85
transmute_llvalFunction · 0.85
check_callMethod · 0.80
as_ptrMethod · 0.80
borrowMethod · 0.80
type_kindMethod · 0.80
element_typeMethod · 0.80
LLVMRustBuildCallFunction · 0.70
setMethod · 0.45
lenMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected