Michael Sullivan
af60716281
Get an initial implementation of boxed vectors working.
2012-06-14 18:01:05 -07:00
Tim Chevalier
97bcb20244
Avoid some duplicated typechecking work
...
There was a FIXME noting that ty::enum_variants and typeck::check::
check_enum_variants both call eval_const_expr. I tried refactoring the
code so that check_enum_variants does all the work and enum_variants
just looks up cached results, but this turned out not to be easy because
several ty functions call enum_variants and it might get invoked on an
enum before that enum item has been typechecked. Instead, I just made
check_enum_variants update the enum_var_cache so that enum_variants
will never call eval_const_expr twice on the same const.
2012-06-14 16:21:53 -07:00
Graydon Hoare
aeb9a2b72c
Add zero check/fail paths on div/mod paths. Close #944 .
2012-06-14 15:39:24 -07:00
Tim Chevalier
c6462eec30
Comments only: annotate FIXMEs in reflect
2012-06-14 14:13:52 -07:00
Tim Chevalier
1642df8efa
Remove a workaround
2012-06-14 12:40:49 -07:00
Tim Chevalier
fcab11da47
Refactor; annotate a FIXME
2012-06-14 12:24:56 -07:00
Tim Chevalier
24f9f45ac6
Comments only: annotate FIXMEs in typeck::infer
2012-06-14 12:10:48 -07:00
Tim Chevalier
699b14b99d
Comments only: annotate a FIXME and remove an obsolete one
2012-06-14 12:07:42 -07:00
Tim Chevalier
730381d936
Annotate and fix FIXMEs in typeck
2012-06-14 12:04:05 -07:00
Tim Chevalier
87af3f3cca
Dead code elimination
2012-06-14 11:10:32 -07:00
Michael Sullivan
591b2802ff
Make trans only generate calls to the _dyn malloc upcalls, so we can get rid of the non dyn ones.
2012-06-13 18:00:17 -07:00
Michael Sullivan
4c0d41cffa
Add a malloc_dyn upcall for dynamically sized allocations on the shared heap.
2012-06-13 17:59:21 -07:00
Tim Chevalier
e5a5fc2029
Allow impls to be re-exported
...
It was a little hard for me to believe, but it seems that re-exporting
an impl doesn't work at a, because encoder::encode_info_for_mod requires
that all the impls in the current module's impl map be local (that is,
bound to a value in the current crate's item map). Fixed it.
Closes #2414 .
2012-06-13 15:52:00 -07:00
Tim Chevalier
6f95c79b95
Traverse types in reachability
...
Issue 2526 showed a test case where a library exported only a type
that was a synonym for a class. Because the class's destructor wasn't
getting marked as reachable, its linkage was wrongly getting set to
"internal". The solution is for reachability to traverse types.
Closes #2526 .
2012-06-13 11:57:01 -07:00
Brian Anderson
ce750a7dbc
Box AST idents
2012-06-13 11:30:45 -07:00
Michael Sullivan
bdd2000066
Some cleanup in tvec.
2012-06-13 11:17:02 -07:00
Tim Chevalier
aa9d2d88d3
Handle class destructors correctly in metadata
...
This allows destructors to be inlined, which is necessary since
classes can have both ty params and destructors.
2012-06-12 17:37:04 -07:00
Michael Sullivan
35dd717352
Simplify a bunch of trans functions to not need the rust type. Remove some PointerCasts.
2012-06-12 17:01:13 -07:00
Michael Sullivan
ccf4e8cf9a
Make vectors contain the right type descriptor. Closes #2536 .
2012-06-12 17:01:13 -07:00
Michael Sullivan
4f61dcb026
Introduce an unboxed_vec type
2012-06-12 17:01:13 -07:00
Michael Sullivan
e67b5b25a6
Introduce a SHAPE_UNBOXED_VEC shape in order to seperate out vector logic.
2012-06-12 17:01:13 -07:00
Tim Chevalier
ebdf0c20cd
Correct typo in comment
2012-06-12 14:56:26 -07:00
Tim Chevalier
72360970fc
Change trans::common::block to be a class
...
And replace trans::common::block_parent with option<block>. To handle
the recursive self-reference in the block_ class, I had to add a
newtype-like enum "block" which is equivalent to @block_ -- which due
to an interaction with borrowck, resulted in having to change a few
functions in trans::base to take their block argument in ++ mode,
irritatingly enough (but not that irritatingly, since we're supposed to
get rid of modes).
2012-06-12 14:55:44 -07:00
Niko Matsakis
d1ec1d4abb
Treat enums with one variant specially in borrowck: #2573
2012-06-12 14:30:14 -07:00
Michael Sullivan
d04ed0c493
Reorder things in hash_type_structure to make more sense.
2012-06-12 10:58:00 -07:00
Graydon Hoare
9f3b12b6c6
Change llsize_real to use LLVMSizeOfTypeInBits. Add comments.
2012-06-11 18:34:24 -07:00
Lindsey Kuper
8467279fac
Add a new AST node for unsuffixed integer types.
2012-06-11 16:34:56 -07:00
Michael Sullivan
baf58a764b
Stop emitting type parameters in shape.rs.
2012-06-11 12:52:49 -07:00
Michael Sullivan
665ba3531d
Clean up tydesc declaration to make it clear what is unused.
2012-06-11 12:29:04 -07:00
Michael Sullivan
b22620624c
Get rid of a bunch of dead shape code. Closes #2552 .
2012-06-11 12:19:40 -07:00
Tim Chevalier
87d57e4919
Don't treat all class fields as mutable, except in trans
...
Closes #2550
2012-06-11 10:16:17 -07:00
Niko Matsakis
013fc92423
remove alias analysis and replace with borrowck
...
This reverts commit 7ef825bb60
.
2012-06-08 20:39:11 -07:00
Niko Matsakis
1351117aa8
avoid rooting @ptrs that live in immutable, stable memory
2012-06-08 20:39:11 -07:00
Niko Matsakis
a628f7f47e
make ccx/tcx/sess methods on bcx pure
2012-06-08 20:39:10 -07:00
Lindsey Kuper
0863ac25a7
Update READMEs and comments to reflect "rustsyntax" -> "syntax" change
2012-06-08 17:24:14 -07:00
Lindsey Kuper
7c0fd858db
Get rid of little-used logging fns in util::common. Closes #2553 .
...
Also got rid of a bunch of commented-out logging statements and
generally cleaned up the logging situation, mostly in typestate.
2012-06-08 17:22:19 -07:00
Graydon Hoare
7a699852cb
Pass names of fields and variants when reflecting.
2012-06-08 16:41:38 -07:00
Graydon Hoare
d182c14247
Visit the substructure for classes and enums as well.
2012-06-08 15:36:02 -07:00
Lindsey Kuper
b8af02e219
WIP on issue #1425 : mostly infrastructure changes.
2012-06-08 15:20:21 -07:00
Niko Matsakis
fc9eadf75b
profile LLVM cleanup insns
2012-06-08 14:34:55 -07:00
Graydon Hoare
dc94ccc4a4
More work on reflect, only missing enum and class substructures.
2012-06-08 13:26:15 -07:00
Brian Anderson
7a74545e97
Convert reinterpret_cast + forget to 'transmute'
2012-06-08 10:58:46 -07:00
Brian Anderson
95b9d538b8
Use #[cfg(unix)] and #[cfg(windows)] everywhere
2012-06-07 22:28:00 -07:00
Brian Anderson
7ef825bb60
Revert "remove alias analysis and replace with borrowck"
...
18s perf regression compiling rustc with opts
This reverts commit 7f6ee0ce0d
.
2012-06-07 19:42:27 -07:00
Michael Sullivan
45cc95fa22
Remove a bunch of old "remove after snapshot" code.
2012-06-07 18:05:12 -07:00
Michael Sullivan
bf0d6a77c5
Reorder the arms of sty.
2012-06-07 17:09:23 -07:00
Niko Matsakis
7f6ee0ce0d
remove alias analysis and replace with borrowck
...
cc #2540
2012-06-07 16:46:57 -07:00
Tim Chevalier
8c6d439a81
Comments only: annotate remainder of FIXMEs in typestate
2012-06-07 16:29:41 -07:00
Tim Chevalier
64b5ae27ac
Start annotating FIXMEs in typestate; also some minor refactoring
2012-06-07 16:01:45 -07:00
Tim Chevalier
6b2cfe793b
Remove an irrelevant comment
...
Comment doesn't seem relevant anymore because the block comment at the
very beginning of the file says it's a bad idea.
2012-06-07 15:13:35 -07:00