From b389611ce772d65ed135d6e52fecb9ca2238e902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Tue, 22 Feb 2011 17:37:11 -0500 Subject: Finish the type of native functions. We now get declare i32 @write(i32, i8*, i32) --- src/comp/middle/trans.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 35fefc10..9da7e009 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -514,7 +514,7 @@ fn type_of_fn(@crate_ctxt cx, fn type_of_native_fn(@crate_ctxt cx, vec[ty.arg] inputs, @ty.t output) -> TypeRef { let vec[TypeRef] atys = type_of_explicit_args(cx, inputs); - ret T_fn(atys, llvm.LLVMVoidType()); + ret T_fn(atys, type_of(cx, output)); } fn type_of_inner(@crate_ctxt cx, @ty.t t) -> TypeRef { @@ -4305,7 +4305,7 @@ fn decl_native_fn_and_pair(@crate_ctxt cx, auto llpairty = node_type(cx, ann); auto llfty = get_pair_fn_ty(llpairty); - let ValueRef llfn = decl_fastcall_fn(cx.llmod, name, llfty); + let ValueRef llfn = decl_cdecl_fn(cx.llmod, name, llfty); cx.item_ids.insert(id, llfn); } -- cgit v1.2.3