(
&mut self,
_: &'ll Type,
llfn: &'ll Value,
args: &[&'ll Value],
_funclet: Option<&()>,
)
| 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); |
no test coverage detected