diff options
| author | Patrick Walton <[email protected]> | 2011-05-09 15:32:12 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-05-09 15:33:02 -0700 |
| commit | 071ed380fb74d2e6a01aebdae0e9ae8ba8b4a9ee (patch) | |
| tree | c43a419e5c5cfa9678ec726bafded5494ebd0fc6 /src/comp/middle/trans.rs | |
| parent | Register new snapshots. (diff) | |
| download | rust-071ed380fb74d2e6a01aebdae0e9ae8ba8b4a9ee.tar.xz rust-071ed380fb74d2e6a01aebdae0e9ae8ba8b4a9ee.zip | |
rustc: Declare upcalls with real signatures; preparation for killing rust_native_rust_* stubs
Diffstat (limited to 'src/comp/middle/trans.rs')
| -rw-r--r-- | src/comp/middle/trans.rs | 25 |
1 files changed, 25 insertions, 0 deletions
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! |