Commit graph

149 commits

Author SHA1 Message Date
Marijn Haverbeke
3816e57fd2 Downcase std modules again, move to :: for module dereferencing
This should be a snapshot transition.
2011-05-12 21:30:44 +02:00
Marijn Haverbeke
6510f1ce7c Change module dereference syntax from . to ::
This will need to be a snapshot.
2011-05-12 21:30:35 +02:00
Marijn Haverbeke
358a1aeec9 Keep resolve data in external hash table, rather than embedded defs
One step closer to removing fold and having a single, immutable AST.
Resolve still uses fold, because it has to detect and transform
expr_field expressions. If we go through on our plan of moving to a
different syntax for module dereferencing, the parser can spit out
expr_field expressions, and resolve can move to walk.

(I am truly sorry for the things I did in typestate_check.rs. I expect
we'll want to change that to walk as well in the near future, at which
point it should probably pass around a context record, which could
hold the def_map.)
2011-05-12 15:40:21 +02:00
Marijn Haverbeke
2b36e40c58 Ensure ann tags are actually kept around during typechecking
This way, the tag assigned by the parser stays with the node.
I realize ann replacing is probably going away real soon, but
I needed this now for moving the resolve defs out of the AST.
2011-05-12 10:51:13 +02:00
Patrick Walton
531515d7ae rustc: Represent types as uints. Cuts typechecking down from 14s to 12s. 2011-05-11 17:05:39 -07:00
Patrick Walton
da09a0320e rustc: Remove a few kludges intended to work around rustboot's lack of structural comparison from equal_type_structures() 2011-05-11 16:18:02 -07:00
Patrick Walton
6953841e25 rustc: Remove magic numbers; they aren't a win 2011-05-11 16:10:17 -07:00
Patrick Walton
df914e8904 rustc: Intern all types. 4s regression. 2011-05-11 15:56:23 -07:00
Patrick Walton
1448fc1a24 rustc: Lower the size limit on ty_to_short_str() and always call it in favor of direct calls to metadata.Encode.ty_str() in trans 2011-05-10 17:50:39 -07:00
Patrick Walton
10c9266525 rustc: Number everything with an annotation 2011-05-10 17:27:59 -07:00
Patrick Walton
17daf1f9bf rustc: Cache intermediate results of metadata.Encode.ty_str. Shaves 30% off translation time. 2011-05-10 14:48:24 -07:00
Graydon Hoare
476442e48c Alias-ify walk, typeck, metadata. Cuts another 80kb off rustc. 2011-05-09 16:17:17 -07:00
Patrick Walton
70c759030c rustc: Alias fix part 2 -- Check that the aliasness of function parameters matches. Add a test case. 2011-05-09 14:00:50 -07:00
Graydon Hoare
b2b33de819 Alias-ify a variety of fn signatures in ty. Cuts 180kb off rustc. 2011-05-09 13:09:20 -07:00
Patrick Walton
662e949540 rustc: Alias fix part 1 -- Separate out AST modes from typechecker modes, and introduce an "either value or alias" mode 2011-05-09 12:27:03 -07:00
Marijn Haverbeke
a3ec0b1f64 Rename std modules to be camelcased
(Have fun mergining your stuff with this.)
2011-05-06 22:51:19 +02:00
Lindsey Kuper
9d7fc21967 Consolidating expr_to_str functions. 2011-05-05 16:53:25 -07:00
Patrick Walton
9a1f0977a2 rustc: Fix bug in equal_abi that was preventing Rust intrinsics from working 2011-05-05 14:21:59 -07:00
Marijn Haverbeke
1f45dda9d2 Remove 'deprecated mutable...' from our code
This should make compilation a bit less noisy.
2011-05-05 20:19:43 +02:00
Patrick Walton
e43729ccf2 rustc: Refactor metadata.Encode.* to not require a type abbreviation table if abbreviation isn't enabled 2011-05-03 14:41:05 -07:00
Patrick Walton
a833f152ba rustc: Remove the artificial block in ty.rs. Fixes self-hosting. Add a test case for this, XFAIL'd. 2011-05-02 17:50:46 -07:00
Patrick Walton
147a2d655f Un-revert "Use different syntax for checks that matter to typestate", fixing the problem.
This reverts commit d08b443fff.
2011-05-02 17:50:46 -07:00
Graydon Hoare
d08b443fff Revert "Use different syntax for checks that matter to typestate"
This reverts commit aa25f22f19. It broke stage2, not sure why yet.
2011-05-02 17:35:33 -07:00
Tim Chevalier
aa25f22f19 Use different syntax for checks that matter to typestate
This giant commit changes the syntax of Rust to use "assert" for
"check" expressions that didn't mean anything to the typestate
system, and continue using "check" for checks that are used as
part of typestate checking.

Most of the changes are just replacing "check" with "assert" in test
cases and rustc.
2011-05-02 12:16:29 -07:00
Graydon Hoare
a2f68b2d58 Intern metadata while writing, shrink stage1 from 12mb to 5.7mb. 2011-04-29 15:26:28 +00:00
Graydon Hoare
e300b8047f Consider unop deref as an lval. Un-XFAIL vec-push. 2011-04-28 16:37:18 -07:00
Tim Chevalier
34dae82b48 Add a session field to ty_ctxt and change an err to span_err
I changed instantiate to print out a more helpful error message,
which required passing it a session argument. To avoid
threading extra arguments through a lot of functions,
I added a session field to ty_ctxt.
2011-04-28 13:26:19 -07:00
Graydon Hoare
776255695a Use cnames when present in ty.ty_to_str. 2011-04-27 13:36:39 -07:00
Patrick Walton
ba3a4f6cc6 rustc: Cap ridiculous type name sizes 2011-04-26 13:08:48 -07:00
Graydon Hoare
cf23db6be5 A little more guarding against wasted work in ty, typeck. 2011-04-25 18:08:13 -07:00
Patrick Walton
c4e13cd1fa rustc: Use the abbreviated type names to avoid LLVM bitcode size explosion 2011-04-25 17:00:25 -07:00
Graydon Hoare
da328b1ba9 Kick ty_var and ty_local entries out of the type store. Pre-compute presence of var, local, param and bound_params in types. 2011-04-25 16:40:25 -07:00
Patrick Walton
e102413aad rustc: Pass a "type context" around instead of directly passing the type store; prep for removing type annotations 2011-04-25 12:15:55 -07:00
Graydon Hoare
b258060a94 Avoid type_store hashtable access for a variety of cases, probably only ty_var matters. 2011-04-25 09:49:08 -07:00
Graydon Hoare
485399a8d5 Skip substitution and/or binding when there's no work to do. 2011-04-25 05:39:18 +00:00
Patrick Walton
2b298fa3e8 rustc: Use a silly "magic numbers" hack; seems to speed things up a bit. 2011-04-22 19:52:30 -07:00
Patrick Walton
94e5ca4df8 rustc: Include the cname in the hash to increase entropy 2011-04-22 19:26:00 -07:00
Patrick Walton
e0eccaddb2 rustc: Thread the type store through everything that needs to access type structures 2011-04-22 17:00:46 -07:00
Patrick Walton
14d1c53a9c rustc: Remove direct access to the cname field of types 2011-04-22 13:45:21 -07:00
Patrick Walton
c7473c8260 rustc: Switch @ty.t to ty.t so that we can change it to a uint 2011-04-22 12:27:52 -07:00
Patrick Walton
c1335510d5 rustc: Eliminate the direct use of ty.t.struct 2011-04-22 12:09:09 -07:00
Patrick Walton
106f783b33 rustc: Add a fast path when the types to be unified are exactly equal 2011-04-22 10:51:32 -07:00
Patrick Walton
9edaa7dba3 rustc: Add a fast path if there are no type substitutions to be made 2011-04-22 10:37:51 -07:00
Patrick Walton
9ab9bd9cc2 rustc: Improve the efficiency of lookup_item_type() slightly 2011-04-22 10:19:57 -07:00
Patrick Walton
117aff8688 rustc: Intern types 2011-04-21 19:31:13 -07:00
Patrick Walton
5e7336ec0d rustc: Add a shallow type equality function, not used yet 2011-04-21 17:06:01 -07:00
Patrick Walton
5dbf554bb3 rustc: Pass a type store around, which does nothing yet 2011-04-21 14:30:27 -07:00
Patrick Walton
ef0fcdd630 rustc: Create a unification context 2011-04-21 12:10:53 -07:00
Patrick Walton
f4b89f5d79 rustc: Move ty.unify to a separate namespace 2011-04-21 11:46:31 -07:00
Graydon Hoare
4509e6fd70 Change ty.eq_ty to avoid stringification. 2011-04-21 05:31:00 +00:00