Patrick Walton
9869aebf7d
rustc: Remove the static "size" field from the tag info
2011-03-01 16:58:33 -08:00
Patrick Walton
9d59d33515
rustc: Add in the size of the discriminant to generic_size_of() for tags
2011-03-01 16:49:05 -08:00
Patrick Walton
71f853b3fd
rustc: Add logic for generic tags to dynamic_size_of().
2011-03-01 16:37:17 -08:00
Patrick Walton
bdbaf0c789
rustc: Factor out the align-elements logic in dynamic_size_of()
2011-03-01 16:02:19 -08:00
Graydon Hoare
7f2398e557
Implement structured compare for rec, tup, tag. Un-XFAIL structured-compare.rs.
2011-03-01 13:00:58 -08:00
Patrick Walton
f239ecb5f2
rustc: Switch from storing nullary tags as constants to storing their discriminants
2011-03-01 12:41:41 -08:00
Patrick Walton
8d8b3d985a
rustc: Mark tags that have subtypes with dynamic size as dynamic
2011-02-28 19:07:26 -08:00
Patrick Walton
687d328d7c
rustc: Trivial cleanup: Remove unused "arity" tag
2011-02-28 18:27:50 -08:00
Graydon Hoare
d08f3a1c70
More complete sketch of structural compare. Still not quite working.
2011-02-28 17:49:26 -08:00
Graydon Hoare
1291cc2df9
Groundwork for structural comparison. Still lacking the actual loop that does it.
2011-02-28 16:36:14 -08:00
Patrick Walton
86309ed3ea
rustc: Write tag variant discriminants into the crate as integer constants
2011-02-28 16:09:22 -08:00
Rafael Ávila de Espíndola
a172f5aef5
Declare wrappers to the native functions and use those to create
...
the fn/closure pairs.
Disable native2.rs for now as we are not yet defining the wrappers and it
fails to link.
2011-02-28 17:33:46 -05:00
Rafael Ávila de Espíndola
4ac4d03f0c
Update the function declarations with rust abi. A cdecl
...
fn write(int fd, rustrt.vbuf buf, uint count) -> int;
compiles to
declare i32 @write(i32, i8*, i32)
and a rust
fn vec_buf[T](vec[T] v, uint offset) -> vbuf;
compiles to
declare i8* @vec_buf(%task*, %tydesc*, %"vec[<P0:2>]", i32)
which I think is the correct declaration for both :-)
2011-02-28 10:37:49 -05:00
Patrick Walton
0120571e90
rustc: Make the tag info table keyed by both tag ID and type parameter. Also fix a bug that was causing all tags to compare equal.
2011-02-25 19:42:26 -08:00
Patrick Walton
e37db13b02
rustc: Eliminate the "ty_params" field from the tag info
2011-02-25 18:24:58 -08:00
Patrick Walton
699eb69cc8
rustc: Eliminate the "variants" field from the tag info
2011-02-25 18:16:50 -08:00
Patrick Walton
9c928fcf8c
rustc: Make iter_structural_ty() not use the "variants" field in the tag info
2011-02-25 17:14:48 -08:00
Patrick Walton
b5081a6a82
Add a tag_variant_count() function to trans that doesn't go through the soon-to-be-deprecated tag info table
2011-02-25 16:45:43 -08:00
Patrick Walton
2cd7fbbdf1
rustc: Move all of the logic in type_of() to type_of_inner()
2011-02-25 16:24:19 -08:00
Patrick Walton
6c24d0403b
Revert "rustc: Push type parameters down through alt tag patterns; add a test" due to valgrind failures
...
This reverts commit 7a1d01effcfa5763bc62aefba40f67ad2130d28d.
2011-02-25 15:49:35 -08:00
Patrick Walton
69464aae62
rustc: Remove FIXME obsoleted by the previous commit
2011-02-25 13:44:37 -08:00
Patrick Walton
7a1d01effc
rustc: Push type parameters down through alt tag patterns; add a test
2011-02-25 13:44:08 -08:00
Rafael Ávila de Espíndola
081c3aa76d
Pass the abi of native functions all the way to codegen.
2011-02-25 15:58:08 -05:00
Rafael Ávila de Espíndola
f8f6f078c5
There are no native iterators (or at least they are not going to be supported
...
soon.).
2011-02-25 12:08:21 -05:00
Patrick Walton
19b2850388
rustc: Perform type parameter substitutions when emitting glue for generic tags. Un-XFAIL generic-tag.rs.
2011-02-24 19:25:05 -08:00
Patrick Walton
dcd65fac19
Cast more aggressively to the callee type when calling generic functions. Add a test-case for this, and XFAIL it in rustboot.
2011-02-24 14:24:32 -08:00
Patrick Walton
5332250d3b
Revert "Cast more aggressively to the callee type when calling generic functions. Add a test-case for this, and XFAIL it in rustboot." due to test failures
...
This reverts commit 0a65283c5eeae0b98fff7d213dbaad59889e677e.
2011-02-24 13:51:18 -08:00
Patrick Walton
0a65283c5e
Cast more aggressively to the callee type when calling generic functions. Add a test-case for this, and XFAIL it in rustboot.
2011-02-24 12:33:08 -08:00
Patrick Walton
b4d6589e73
Implement type descriptor binding. Un-XFAIL test/run-pass/generic-bind.rs.
2011-02-23 17:08:02 -08:00
Rafael Ávila de Espíndola
ffcb461370
Parse the abi in native modules.
2011-02-23 14:06:37 -05:00
Rafael Ávila de Espíndola
6849abcf7d
Handle the new ty_native_fn in type check.
2011-02-23 11:59:07 -05:00
Patrick Walton
b6f1c832e3
rustc: Perform explicit type substitution as requested by the programmer
2011-02-22 18:33:07 -08:00
Graydon Hoare
d7f7634c95
Drop for-loop temporary at end of scope, fixes memory leak.
2011-02-22 18:07:47 -08:00
Graydon Hoare
af4d6ae76b
Add ABI tagging to crates, adjust rustc output and runtime stack-frame setup so access to argv works.
2011-02-22 16:37:27 -08:00
Patrick Walton
01c2761769
Rework typechecking of bind expressions
2011-02-22 15:50:07 -08:00
Rafael Ávila de Espíndola
b389611ce7
Finish the type of native functions. We now get
...
declare i32 @write(i32, i8*, i32)
2011-02-22 17:37:11 -05:00
Graydon Hoare
60f97aa9cc
Find main functions buried within modules. Un-XFAIL import.rs.
2011-02-21 17:42:23 -08:00
Graydon Hoare
b0c7439d77
Implement expr_put. Un-XFAIL foreach-simple.rs; iters w/o env access work.
2011-02-18 18:52:31 -08:00
Patrick Walton
5508c28ff0
Factor out the call typechecking logic so that bind can use it
2011-02-18 18:19:27 -08:00
Graydon Hoare
80c67268fc
Pass correct lliterbody; can compile and run no-put iters.
2011-02-18 18:04:37 -08:00
Graydon Hoare
34c60b6edb
Make a tag for iterness / fnness, teach many places about it.
2011-02-18 17:30:57 -08:00
Patrick Walton
3aba50ff33
Implement Robinson's algorithm for type unification. Closes #227 .
2011-02-18 14:52:33 -08:00
Graydon Hoare
0ddb832a4e
Teach trans and llvm to cooperate on producing tidier diagnostic names in trans.ty_str.
2011-02-17 18:16:51 -08:00
Patrick Walton
10befcd9a4
Add type parameters to tag types
2011-02-17 16:23:31 -08:00
Graydon Hoare
79d3ceaac0
Steps toward implementing iterators.
2011-02-17 12:20:55 -08:00
Rafael Avila de Espindola
07c7888037
Don't add the rust arguments to native functions. We now produce the
...
correct arguments for native functions.
2011-02-16 16:16:11 -05:00
Rafael Avila de Espindola
a63696dfe2
Add a more specialized decl_native_fn_and_pair. Native functions now have
...
the right name.
2011-02-16 15:34:59 -05:00
Rafael Avila de Espindola
293637139f
Add missing case to ty_to_str.
...
Disable test that now fails because we produce undefined references to the
native functions.
2011-02-16 15:00:40 -05:00
Graydon Hoare
f50caa75c2
Wrap long line in last commit.
2011-02-16 11:33:14 -08:00
Rafael Avila de Espindola
012fa69ea5
More typechecking for native types and the needed plumbing in codegen.
2011-02-16 14:02:02 -05:00