Commit Graph

2474 Commits

Author SHA1 Message Date
Patrick Walton
f74298215c rustc: Fix indentation in typeck::check_lit() 2011-05-16 15:24:32 -07:00
Patrick Walton
1fc1ad91ce rustc: Don't rebuild the call expression in typeck::replace_expr_type() 2011-05-16 15:20:11 -07:00
Patrick Walton
278d64dafc rustc: Don't unpack annotations in trans::lval_generic_fn() 2011-05-16 15:20:11 -07:00
Graydon Hoare
d577f5bdf9 Let the snapshot-file parser parse empty T lines, since they are used to start a transition. 2011-05-16 15:14:44 -07:00
Patrick Walton
3ea3d9eed6 rustc: Make the parser use the interner 2011-05-16 14:54:10 -07:00
Kelly Wilson
b91ef944c8 Replace --bitcode with the canonical --emit-llvm 2011-05-16 14:07:43 -07:00
Kelly Wilson
196351aa44 Add automatic exe generation capabilities. Add --bitcode flag to generate only an LLVM bitcode file. 2011-05-16 14:07:43 -07:00
Patrick Walton
32b8dcb97c rustc: Factor out the code that interns types into an "interner" data structure 2011-05-16 13:58:13 -07:00
Patrick Walton
3760bfab87 rustc: Don't rebuild AST patterns during typechecking 2011-05-16 11:45:00 -07:00
Patrick Walton
ca51b49c0a rustc: Replace the redundant typeck::node_ann_ty_params() with ty::ann_to_type_params() 2011-05-16 11:43:50 -07:00
Patrick Walton
3aaf02b907 rustc: Make the type collection pass no longer rebuild the AST 2011-05-16 10:34:32 -07:00
Patrick Walton
525a5c582f rustc: Fix indentation in ty_param_count_and_ty_for_def() 2011-05-16 10:32:38 -07:00
Patrick Walton
594c70f788 rustc: Add an item_ann() accessor function 2011-05-16 10:32:38 -07:00
Brian Anderson
f77c5ba512 rustc: Wait until generic glue is actually emitted to define it as internal
The verifier was not liking this when generating unoptimized bitcode. Per LLVM
docs it is not valid for function declarations to be marked internal, but
their implementations may be.
2011-05-15 19:53:06 -04:00
Brian Anderson
8eaafdaa2d rustc: Rename 'Unify' modules to 'unify' 2011-05-14 21:13:47 -04:00
Brian Anderson
f33d490032 Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
Patrick Walton
de421afa55 rustc: Use walk instead of fold for the first item collection pass 2011-05-14 11:03:10 -07:00
Patrick Walton
8b3f359442 rustc: Change "Collect" to "collect" 2011-05-14 11:03:10 -07:00
Brian Anderson
ec30c71296 Add a regression test for issue #374 (XFAILed) 2011-05-14 13:29:49 -04:00
Brian Anderson
fb76c25729 WIP 2011-05-14 13:11:37 -04:00
Marijn Haverbeke
b7d6934ef3 fix a long line that i forgot to commit 2011-05-14 13:27:21 +02:00
Marijn Haverbeke
ee45fd80c6 Mark IDENT tokens that are followed by ::
So that the type parser won't go off and try to parse a vec
type when it sees vec::init_op.
2011-05-14 12:57:42 +02:00
Brian Anderson
1ad58d4dd6 rustllvm: Free TargetMachine in LLVMRustWriteOutputFile 2011-05-14 00:48:51 -04:00
Brian Anderson
aaf41815b1 rustc: Dispose intrinsics memory buffer 2011-05-14 00:29:24 -04:00
Brian Anderson
371dbf9834 rustc: Dispose the intrinsics LLVMModuleRef 2011-05-14 00:22:44 -04:00
Brian Anderson
0b73b29383 rt: Don't overshoot the end of the logging spec during parsing 2011-05-13 23:22:29 -04:00
Brian Anderson
9e9d57657d rt: Allocate room for null terminator in logging spec 2011-05-13 23:22:25 -04:00
Patrick Walton
85120d9959 rustc: Look types up in the side table 2011-05-13 18:46:44 -07:00
Graydon Hoare
6997adf763 Remove rustboot from the repository. 2011-05-13 18:38:28 -07:00
Patrick Walton
ef75860a0a rustc: Write nil types into the node type table wherever plain_ann() is used 2011-05-13 17:55:07 -07:00
Lindsey Kuper
5679f5c55e 'with' no longer a token; whitespace police.
Plus renaming the anonymous objects test to a more descriptive name,
and XFAILing it because it doesn't work yet.
2011-05-13 17:37:01 -07:00
Lindsey Kuper
cd31d5d532 More anon obj work; whitespace police in middle::fold
Passing args to middle::fold::fold_expr_anon_obj by reference to be
consistent with the other folds; adding a dummy fold_expr_anon_obj to
typeck to be filled in later.
2011-05-13 17:35:13 -07:00
Lindsey Kuper
814b17352c Use new module namespace syntax. 2011-05-13 17:35:13 -07:00
Lindsey Kuper
b6f35c6a4b More work toward anonymous objects. 2011-05-13 17:35:13 -07:00
Lindsey Kuper
d3242b9644 Bug fixes.
Fixed infinite loop on anonymous objects in parser; added
expr_anon_obj to walk.rs; fixed syntax of test case.
2011-05-13 17:35:13 -07:00
Lindsey Kuper
6c1c5b3948 More progress on anonymous objects.
Still segfaulting on the method-overriding.rs test, though.
2011-05-13 17:35:13 -07:00
Lindsey Kuper
6a53e39e71 Correct capitalization of "Option". 2011-05-13 17:35:12 -07:00
Lindsey Kuper
7c2979e26f Starting on support for anonymous objects. Just syntax so far. 2011-05-13 17:35:12 -07:00
Graydon Hoare
ae784df3ce Add support for 'T' transition snapshots, which are identical to S snapshots except they tell the makefile to stop at stage1. 2011-05-13 17:06:58 -07:00
Patrick Walton
fac1342513 rustc: Move replace_expr_type() from ty to typeck, as it's only used in the latter 2011-05-13 17:06:30 -07:00
Brian Anderson
843e9435ab rustc: Fix long lines in typeck.rs 2011-05-13 20:06:02 -04:00
Patrick Walton
23d3b0ec57 rustc: Get ann_to_type_params() on board the ann_to_ty_param_substs_opt_and_ty() train 2011-05-13 16:53:35 -07:00
Patrick Walton
0739849e9f rustc: Make all type lookups go through the one ty::ann_to_ty_param_substs_opt_and_ty() function 2011-05-13 16:40:21 -07:00
Patrick Walton
4f2eb31870 rustc: Write types contained in "trivial annotations" to the table 2011-05-13 16:27:55 -07:00
Patrick Walton
e888fe6f9b rustc: Change ty::triv_ann() to take a node ID instead of a full annotation 2011-05-13 14:39:00 -07:00
Brian Anderson
2f440b1452 rustc: lowercase the link and link::write modules 2011-05-13 16:55:37 -04:00
Graydon Hoare
0d32ff723a Slight adjustments to shape, rename to type_glue.rs. 2011-05-13 13:29:50 -07:00
Patrick Walton
c97b05141a rustc: Add write_type() wherever ann_types are written, except for triv_ann() 2011-05-13 13:06:34 -07:00
Marijn Haverbeke
7647b838a1 Remove reserved word tests (since reserved words were removed)
Ping me if you disagree, but I think that in a language that's as
in-flux as rust currently is, it is silly to try and enforce a single
future-compatibility. The reserved words didn't work well with the
parser refactor, so I dropped them for the time being. We can,
eventually, bring them back as type-only reserved words.
2011-05-13 22:00:13 +02:00
Marijn Haverbeke
571afe71ba Safeguard against using statement or item keywords as value ids
This prevents insane things like 'auto while = 2', which would parse
in the previous revision, but then break when you tried to mutate it
with 'while = 10'.
2011-05-13 22:00:13 +02:00
Marijn Haverbeke
57ffa2a487 Make the parser more careful about keywords
Keywords are now only recognized in contexts where they are valid. The
lexer no longer recognizes them, all words are lexed as IDENT tokens,
that get interpreted by the parser.
2011-05-13 22:00:13 +02:00
Patrick Walton
be9aa1cc5e rustc: Fix the type of node_types; stub the write_type function 2011-05-13 12:12:54 -07:00
Patrick Walton
6e34679a65 rustc: Remove a minor rustboot workaround in typeck::resolve_local_types_in_block() 2011-05-13 11:23:00 -07:00
Brian Anderson
c124404d0e Fix naming of libc that was mangled by recent module changes
It doesn't appear that rustc makes use of these strings so it didn't actually
break anything yet.
2011-05-13 13:55:57 -04:00
Patrick Walton
8a8f68aa75 rustc: Make typeck::instantiate_path() not return an annotation 2011-05-13 10:53:55 -07:00
Marijn Haverbeke
ae26b775b4 Implement module namespaces
Module names no longer clash with type and value names. The
tokenizer/parser still needs to be taught to be more careful in
identifying keywords, so that we can use 'str' and 'vec' and so as
module names.
2011-05-13 17:20:46 +02:00
Marijn Haverbeke
eb419fd8c7 Extend crate format to allow multiple definitions for a single name
The type/value namespace distinction pretty much works now. Module
namespace is up next.
2011-05-13 17:20:39 +02:00
Marijn Haverbeke
1a12a7b04b Make module indices hold a list of items
This way, they can support having both a type and a value
of the same name.
2011-05-13 13:34:59 +02:00
Marijn Haverbeke
58ec5d1654 Move capture checking into resolve.rs
Drops capture.rs. The new algorithm also checks for captures function
arguments and obj fields.
2011-05-13 12:44:05 +02:00
Marijn Haverbeke
89490e416b Change resolve to use walk instead of fold
Possibly, at some point, we should add a state-passing variant of
walk, or a wrapper that makes it easier to thread state. (See the
repetetive pop_state_for_* functions in this commit.)
2011-05-13 11:35:25 +02:00
Marijn Haverbeke
7082bf4478 Ensure visit_ty is called on type parameters during walk 2011-05-13 11:35:25 +02:00
Marijn Haverbeke
39a000714a Add visit_arm and visit_method to walk.rs
The resolver needs to update its state for individual arms and
methods.
2011-05-13 11:34:51 +02:00
Brian Anderson
2896a866d6 Change fuzzer to match new module standards 2011-05-12 22:45:55 -04:00
Brian Anderson
02fdd2d2d9 Rename std.extfmt.CT to std.extfmt.RT to ct and rt
Temporarily duplicate the entire RT module, leaving it with the old name to
accomodate the stage0 compiler. Will be removed after the next snapshot.
2011-05-12 22:22:28 -04:00
Patrick Walton
5295a4dabd rustc: Flatten recursive vectors in trans::simplify_type(). Prevents an infinite loop. 2011-05-12 18:37:28 -07:00
Patrick Walton
b163247d4e rustc: Beginnings of a "shape" module to convert types to shapes 2011-05-12 18:30:21 -07:00
Patrick Walton
033b38b636 rustc: Make ty::expr_ann() terser 2011-05-12 16:57:08 -07:00
Patrick Walton
0b7dd0d918 rustc: Pass a node type table around, unused as of yet 2011-05-12 16:41:55 -07:00
Graydon Hoare
5ceaf345ed Add stats option and lazily emit glue. 2011-05-12 15:42:51 -07:00
Patrick Walton
295c037aac etc: Update rust.vim with new keywords; color types differently from keywords 2011-05-12 14:32:54 -07:00
Graydon Hoare
1fdddede22 Add snap-stageN targets. 2011-05-12 13:08:57 -07:00
Graydon Hoare
b64098e58c Register new snapshots for incompatible-syntax transition. 2011-05-12 13:03:05 -07:00
Marijn Haverbeke
9419c5df77 Fix mistaken replacements in error-pattern comments in tests 2011-05-12 21:45:29 +02:00
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
b1d3364487 Transitional change to make extfmt output lowercase module name 2011-05-12 21:30:43 +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
dd9b6dccb4 Remove some truly wrong logic in parse_constrs 2011-05-12 15:52:12 +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
079512494f Properly lex block comments followed by EOF 2011-05-12 09:31:06 +02:00
Marijn Haverbeke
d719b5cae7 Provide a more useful message when failing to translate a const 2011-05-12 09:17:59 +02:00
Brian Anderson
353ed4bdff Remove unused filename parameter from lexer.new_reader 2011-05-11 23:38:20 -04:00
Brian Anderson
a459bcd127 Give the lexer a session so that it can fail more informatively 2011-05-11 23:04:16 -04: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
Graydon Hoare
927138016a Register new snapshots. 2011-05-11 09:35:58 -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
5bea22d75c Add a missed xfail-stage0 2011-05-11 16:44:42 +02:00
Marijn Haverbeke
88621bc53c Remove a few more 'mutable' words
Didn't see these before because they live in non-Linux code.
2011-05-11 15:39:39 +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
Brian Anderson
e4c3287367 Reuse a single work buffer every time the SHA1 message block is processed.
This finally allows the full lib-sha1 test to run in a reasonable amount of
time. Was 30s, now 3s. Trims a second or two from stage2/rustc. XFAIL lib-sha1
in stage0 since it will be very slow until the next snapshot.
2011-05-11 01:38:17 -04:00
Brian Anderson
7e7d134e3c Remove unnecessary array access from SHA1
Provides a very small speedup.
2011-05-11 01:38:17 -04:00
Brian Anderson
e35984b6c6 Introduce str_slice runtime function
This reduces the time to execute the new lib-str tests from 1:40ish to a few
seconds and will eventually allow the full lib-sha1 test to run in a
reasonable amount of time. XFAIL lib-str in stage0 - it will run very slowly
until the next snapshot.
2011-05-11 01:38:16 -04:00
Graydon Hoare
dc0aab47a7 More alias-ification of trans. 2011-05-11 05:11:59 +00:00
Brian Anderson
aa40d61d5d Link fuzzer to the rustc crate 2011-05-10 21:31:14 -04:00
Brian Anderson
a8e8585fbc Add meta info to rustc.rc 2011-05-10 21:31:14 -04:00
Brian Anderson
a5ea56c6f0 Introduce the fuzzer crate and make rules 2011-05-10 21:31:14 -04: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
869e9017eb rustc: Create mutable vectors in macos_OS.rs. Should put out Darwin tinderbox. 2011-05-10 17:50:39 -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
7da9101e11 rustc: Make -g not take an argument 2011-05-10 17:50:39 -07:00
Graydon Hoare
46886b2339 Attempt to put out burning darwin tinderbox. 2011-05-10 17:47:55 -07:00
Patrick Walton
10c9266525 rustc: Number everything with an annotation 2011-05-10 17:27:59 -07:00
Graydon Hoare
4b5b96c511 Remove a couple more spurious 'mutable' value qualifiers from macos_OS.rs. 2011-05-10 17:04:41 -07:00
Graydon Hoare
7e8b57d1bb Only name LLVM values / blocks / types when saving temporaries. 2011-05-10 17:04:41 -07:00
Brian Anderson
4c70ddb162 Un-XFAIL syntax-extension-fmt.rs 2011-05-10 19:46:22 -04:00
Brian Anderson
92471efff4 Un-XFAIL compile-fail export tests for stage0 2011-05-10 19:18:38 -04:00
Graydon Hoare
d6f1fcff6b Add --time-llvm-passes. 2011-05-10 16:10:08 -07:00
Patrick Walton
813636d52e stdlib: Remove Str.unsafe_from_mutable_bytes(). rustc now self-hosts 18 seconds faster. 2011-05-10 15:20:36 -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
Patrick Walton
cfcc8678e5 rustc: Give our upcall definitions the right values 2011-05-09 16:59:18 -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
Graydon Hoare
4cfca125da Register new snapshots. 2011-05-09 15:07:53 -07:00
Graydon Hoare
b00f3074d4 Remove boxes from token.t. 2011-05-09 14:17:45 -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
bc879a4e1e rustc: Replace our homebrew list of passes with the standard function and module passes, along with the TargetData passes. 2011-05-09 11:44:47 -07:00
Graydon Hoare
d97c5d97de Register new snapshots. 2011-05-09 10:46:38 -07:00
Patrick Walton
7641142ce2 rt: Consistently refer to structs as structs and classes as classes. Clang complains about this. 2011-05-08 21:10:42 -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
Patrick Walton
a71fda40b8 rustc: Make llvm_err() conform to Postel's law a little better 2011-05-06 18:19:42 -07:00
Patrick Walton
ca1b1666e0 rustllvm: Add a function to add the standard function passes to a module; change uses of bool in LLVMAddStandardModulePasses() to LLVMBool 2011-05-06 18:13:22 -07:00
Graydon Hoare
10a2093d37 Failure to re-stage changes strikes again. 2011-05-06 16:54:50 -07:00
Graydon Hoare
0f23bbac01 Fix GenericOS.getenv returning a raw str, return an Option.t[str] instead. 2011-05-06 16:30:39 -07:00
Graydon Hoare
e2f7f11d47 Put out burning linux tinderbox. 2011-05-06 16:07:28 -07:00
Patrick Walton
c624ed72b1 rustc: Uncomment LLVMAddStandardPasses, now that we have a native glue that supports 8 arguments. 2011-05-06 14:22:17 -07:00
Marijn Haverbeke
d39ca857fc Remove a few more superfluous 'mutable' keywords 2011-05-06 22:52:02 +02: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
Graydon Hoare
44c1621525 Register new snapshots. 2011-05-06 13:34:56 -07:00
Patrick Walton
ab437253d3 rustc: Bump the number of native glues to 8 2011-05-06 12:50:48 -07:00
Patrick Walton
d089d9f9ed rustllvm: Add a binding to the LLVM standard module passes 2011-05-06 12:38:00 -07:00