From 071ed380fb74d2e6a01aebdae0e9ae8ba8b4a9ee Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 9 May 2011 15:32:12 -0700 Subject: rustc: Declare upcalls with real signatures; preparation for killing rust_native_rust_* stubs --- src/comp/middle/trans.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/comp/middle') diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 08cebc58..cb537b38 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -305,6 +305,11 @@ fn T_char() -> TypeRef { ret T_i32(); } +fn T_size_t() -> TypeRef { + // FIXME: switch on target type. + ret T_i32(); +} + fn T_fn(vec[TypeRef] inputs, TypeRef output) -> TypeRef { ret llvm.LLVMFunctionType(output, Vec.buf[TypeRef](inputs), @@ -586,6 +591,26 @@ fn T_opaque_obj_ptr(type_names tn) -> TypeRef { ret T_obj_ptr(tn, 0u); } +fn T_opaque_port_ptr(type_names tn) -> TypeRef { + auto s = "*port"; + if (tn.name_has_type(s)) { ret tn.get_type(s); } + + auto t = T_ptr(T_i8()); + + tn.associate(s, t); + ret t; +} + +fn T_opaque_chan_ptr(type_names tn) -> TypeRef { + auto s = "*chan"; + if (tn.name_has_type(s)) { ret tn.get_type(s); } + + auto t = T_ptr(T_i8()); + + tn.associate(s, t); + ret t; +} + // This function now fails if called on a type with dynamic size (as its // return value was always meaningless in that case anyhow). Beware! -- cgit v1.2.3