Commit graph

905 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
Marijn Haverbeke
d719b5cae7 Provide a more useful message when failing to translate a const 2011-05-12 09:17:59 +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
26ab36afb1 rustc: Hoist derived type descriptors to the top of the function 2011-05-11 12:05:02 -07:00
Marijn Haverbeke
14f1fe0e29 Remove mod indices from the AST
They are now created by the resolve pass, which is the only pass that
needs them, and kept internal to that pass.
2011-05-11 17:11:44 +02:00
Marijn Haverbeke
fe29d24b6e Get rid of arm indices 2011-05-11 15:26:36 +02:00
Marijn Haverbeke
5405f45274 Get rid of block indices 2011-05-11 15:10:24 +02:00
Marijn Haverbeke
7d086df095 Stop depending on block indices in capture.rs 2011-05-11 13:49:48 +02:00
Marijn Haverbeke
9cb20153a8 Hash only on def_num when storing def_ids that are local 2011-05-11 13:06:43 +02:00
Marijn Haverbeke
7f222423b7 Use a const for crate-num-zero (ast.local_crate) 2011-05-11 12:59:34 +02:00
Marijn Haverbeke
6b46113afc Cache external crate lookups in resolve.rs
According to --time-passes, resolution went from 2 to 0 seconds. Not
really the bottleneck... but if we want to be crazy fast, just
consider this a future bottleneck that was fixed very timely.
2011-05-11 12:32:37 +02:00
Marijn Haverbeke
e9c12ab1d0 Rewrite comp/middle/resolve.rs
* Cleans up the algorithm
 * Move first pass to walk (second still folds)
 * Support part of a type/value namespace split
   (crate metadata and module indices still need to be taught about this)
 * Remove a few blatant inefficiencies (import tables being recreated for
   every lookup, most importantly)
2011-05-11 12:32:37 +02:00
Graydon Hoare
dc0aab47a7 More alias-ification of trans. 2011-05-11 05:11:59 +00:00
Patrick Walton
f627c2ff21 rustc: Don't interleave allocas with stores when copying arguments to allocas 2011-05-10 18:29:14 -07:00
Graydon Hoare
390ce40165 Begin alias-ifying trans. 2011-05-10 18:07:40 -07:00
Graydon Hoare
cf3e737eee Avoid mangle_name_by_type_only call in tydesc names unless debugging. 2011-05-10 18:07:40 -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
Graydon Hoare
7e8b57d1bb Only name LLVM values / blocks / types when saving temporaries. 2011-05-10 17:04:41 -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
3bec4c8193 Switch memcpy to memmove since we're willing to compile x = x and such. 2011-05-10 14:22:14 -07:00
Patrick Walton
2849103f24 rustc: Get rid of native Rust glue for all upcalls except the exit task glue 2011-05-10 14:04:34 -07:00
Graydon Hoare
55f0f79a46 Re-enable use of llvm intrinsics for memcpy, memset. Should have aligned stack now. 2011-05-10 11:50:29 -07:00
Brian Anderson
1abb7a868e Fix long lines in fold.rs, typeck.rs 2011-05-09 22:11:56 -04:00
Graydon Hoare
4539f8a03c Alias-ify fold and its users, remove another 85kb. 2011-05-09 17:50:06 -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
071ed380fb rustc: Declare upcalls with real signatures; preparation for killing rust_native_rust_* stubs 2011-05-09 15:33:02 -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
Patrick Walton
106216d673 rustc: Stop emitting zero-length arrays 2011-05-08 16:26:35 -07:00
Graydon Hoare
db3b9a4992 Stop stringifying integers to get integral constants. 2011-05-07 18:54:23 +00: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
Patrick Walton
5e2088f2fa rustc: For stack local derived tydescs, allocate the root tydesc separately from the parameter tydescs. This allows SROA, and consequently inlining, to work. 2011-05-06 12:37:59 -07:00
Patrick Walton
57a5c3ac9f rustc: Factor derived tydesc construction out of get_tydesc() 2011-05-06 12:37:59 -07:00
Patrick Walton
8e7aeed2d5 rustc: Include a representation of the type in question in the symbols generated for tydescs 2011-05-06 12:37:59 -07:00
Patrick Walton
883eb38b28 rustc: Remove some debugging code from decl_native_fn_and_pair() 2011-05-05 17:58:48 -07:00
Patrick Walton
81cda5ad45 rustc: Fix a bunch of argument-passing bugs in decl_native_fn_and_pair() 2011-05-05 17:48:10 -07:00
Lindsey Kuper
9d7fc21967 Consolidating expr_to_str functions. 2011-05-05 16:53:25 -07:00
Rafael Ávila de Espíndola
157f61f8c8 Change the setup so that rust_activate_glue returns to rust_exit_task_glue
and rust_exit_task_glue calls the rust main.

This is simpler since we only need to setup one frame. It also matches
what ld.so does, so gdb is happy and stops a backtrace at rust_exit_task_glue
instead of continuing past whatever function happened to be before
rust_exit_task_glue is the object file.

This is only the rustc changes and should be merged first.
2011-05-05 15:14:34 -07:00
Patrick Walton
2d9ccf3ae5 rustc: Add Rust intrinsic support to the crate metadata reader and writer 2011-05-05 14:35:18 -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
Tim Chevalier
6b742aec91 Enforce in typechecker that preds return a bool
as well as a test case
2011-05-05 11:26:07 -07:00
Tim Chevalier
e3a68e235c Bring back "pred" syntax for writing predicates for check
This commit reinstates the requirement that the predicate in a
"check" must be a manifest call to a special kind of function
declared with the new "pred" keyword instead of "fn". Preds must
have a boolean return type and can only call other preds; they
can't have any effects (as enforced by the typechecker).
The arguments to a predicate in a check expression must be
slot variables or literals.
2011-05-05 11:26:07 -07:00