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
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
Kelly Wilson
b4a0d891c0
Ge the host triple using LLVM. Fix a few 'mutable' warnings also.
2011-05-06 11:30:39 -07:00
Graydon Hoare
1e03f00404
Use #env to bake a git revision string into rustc's --version output.
2011-05-06 11:21:51 -07:00
Rafael Ávila de Espíndola
8df37716ce
Fix OS X build.
2011-05-05 23:16:59 -04: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
Graydon Hoare
9e3b096d98
Fix x86.rs triple for linux.
2011-05-05 17:20:27 -07:00
Lindsey Kuper
9d7fc21967
Consolidating expr_to_str functions.
2011-05-05 16:53:25 -07:00
Kelly Wilson
850dff486e
Add quick sort function to the std lib.
2011-05-05 16:40:57 -07:00
Rafael Ávila de Espíndola
4445d6771d
Use symbolic register names so that we get the correct encoding on OS X.
2011-05-05 19:00:42 -04:00
Rafael Ávila de Espíndola
d6deeffd95
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 the rt part and should be merged after the rust0 part.
2011-05-05 15:46:10 -07:00
Graydon Hoare
d85260bcc5
Register new stage0 snapshots.
2011-05-05 15:46:05 -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
Graydon Hoare
50ac893b00
Attempt to fix fs.dirname harder.
2011-05-05 14:31:45 -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
Graydon Hoare
2131f2bb6b
Because good hackers at least check to see if the code compiles.
2011-05-05 13:53:57 -07:00
Graydon Hoare
c80255e510
Fix assumption that only os_fs.path_sep can separate paths, sigh.
2011-05-05 13:42:52 -07:00
Graydon Hoare
f5f2f76339
Add --help, --version and -v flags (not yet supporting GIT_REV env var, waiting on snapshot).
2011-05-05 13:09:43 -07:00
Patrick Walton
a74feaf159
rustc: Link with intrinsics.bc; change intrinsics linkage to linkonce_odr
2011-05-05 12:46:22 -07:00
Patrick Walton
5fb6e6364b
rustc: Add a binding to LLVM's bitcode parser
2011-05-05 11:34:45 -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
acf9bd7909
Test cases for pred / check stuff
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
Tim Chevalier
3060eadcba
Check well-formedness of constraints
...
Check that the operand in a constraint is an explicit name,
and that the operands are all local variables or literals. Still need
to check that the name refers to a pure function.
2011-05-05 11:26:07 -07:00
Tim Chevalier
bc5650a9d0
Change checks to asserts in test/bench files
2011-05-05 11:26:07 -07:00
Tim Chevalier
4f892dd9d7
Check that the operand in a check is a call
...
In addition, fix bug in fold that was turning asserts into checks.
More typechecking still needs to be done.
2011-05-05 11:26:07 -07:00
Tim Chevalier
59a0e98096
Un-XFAILed not-a-pred in stage0 (it fails correctly)
2011-05-05 11:26:07 -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
Marijn Haverbeke
3d738e9e06
Return a fresh, unreachable context after ret, break, and cont
...
This ensures we don't get compile errors on unreachable code (see
test/run-pass/artificial-block.rs for an example of sane code that
wasn't compiling). In the future, we might want to warn about
non-trivial code appearing in an unreachable context, and/or avoid
generating unreachable code altogether (though I'm sure LLVM will weed
it out as well).
2011-05-05 20:19:43 +02:00
Marijn Haverbeke
9432626b68
Eradicate fold from capture.rs
...
The pass now uses walk.
2011-05-05 20:19:43 +02:00
Ralph Giles
06f0713906
Mark valgrind's _qzz_res as unused to silence warnings on gcc 4.6.
...
This applies c11675 by Julian Seward from valgrind trunk
(svn://svn.valgrind.org/valgrind/trunk) to rustrt's included
copies of memcheck.h and valgrind.h, effectively backporting
the fix from the unreleased 3.6.2. The commit simply applies
the gcc 'unused' attribute to the relevant declarations.
This change allows compilation of the runtime code under
gcc 4.6 with -Werror, as the makefile currently requests.
2011-05-05 10:55:54 -07:00
Patrick Walton
fea623211f
rustc: Add a Link module; move crate writing to it to slim down trans slightly
2011-05-05 10:48:02 -07:00
Patrick Walton
729648282b
rustllvm: Add bindings to the LLVM linker
2011-05-04 21:27:00 -07:00
Patrick Walton
c47a075a99
rustllvm: Whitespace police in RustWrapper.cpp
2011-05-04 20:30:23 -07:00
Patrick Walton
bde44a03a9
rustc: Detect the system root and allow the user to override if necessary
2011-05-04 19:27:54 -07:00
Graydon Hoare
d55fa2a9a3
Add #env syntax extension for plucking strings out of the compilation environment.
2011-05-04 19:05:32 -07:00
Graydon Hoare
a7db032725
Re-snapshot to pick up fixed crasher bugs in resolve and performance improvements.
2011-05-04 19:05:32 -07:00
Patrick Walton
04f966f0bc
build: Build intrinsics.bc
2011-05-04 18:29:08 -07:00
Marijn Haverbeke
898e089d7b
Fix and re-enable destructors
...
There was some confusion on whether the destructors took their
argument by pointer or direct value. They now take it directly, just
like other methods. You no longer get a segfault when a constructor
actually does something with its self value.
2011-05-05 02:16:49 +02:00
Graydon Hoare
cdb6822405
Add a structure for passing option flags around the compiler, put it in session, and use it.
2011-05-04 16:59:21 -07:00
Brian Anderson
bd34770a92
Add missing ret statements to check_mod
...
Un-XFAIL compile-fail export tests
2011-05-04 19:29:27 -04:00
Graydon Hoare
ce9468761c
Support new -g flag, only mangle glue names by type when it's passed.
2011-05-04 15:36:42 -07:00
Graydon Hoare
b73a640ce0
More export XFAILs.
2011-05-04 15:35:41 -07:00
Graydon Hoare
54dc34b658
Re-snapshot stage0
2011-05-04 14:45:09 -07:00
Graydon Hoare
978e3d0f4a
XFAIL some compile-fail tests mysteriously failing on win32 tinderbox.
2011-05-04 14:44:57 -07:00
Graydon Hoare
4642d7a355
extend xfail-stage0 to stage1, stage2 on obj-dtor-2.rs
2011-05-04 11:23:05 -07:00
Graydon Hoare
456398a403
Change two compile-fail patterns to match rustc output.
2011-05-04 11:20:47 -07:00
Graydon Hoare
895ec07453
Try to fail nicely, again.
2011-05-04 15:04:53 +00:00
Graydon Hoare
99f1dffd49
Fail in a slightly more organized fashion for now.
2011-05-04 06:19:58 +00:00
Patrick Walton
dc181bca4e
rustc: Stub Rust intrinsics. We check in the .ll file for now to temporarily dodge a dependency on clang.
2011-05-03 18:51:41 -07:00
Graydon Hoare
c36645b358
Assume xfail-stage0 implies stage1 and stage2 in tests, for now.
2011-05-03 18:14:02 -07:00
Patrick Walton
ac8eb20224
rustc: Stub support for Rust intrinsics
2011-05-03 18:03:59 -07:00
Patrick Walton
2bc17adc29
Revert "Rename the "llvm" API to "llvm-intrinsic"" due to tinderbox bustage
...
This reverts commit 6871c245a6
.
2011-05-03 17:50:37 -07:00
Graydon Hoare
b81897d7e4
More python portability fixes (for windows).
2011-05-03 16:53:36 -07:00
Graydon Hoare
1965a156f0
Attempt to use more portable python
2011-05-03 16:22:00 -07:00
Graydon Hoare
b453c3c728
Start sketching --depend support in rustc.
2011-05-03 15:56:00 -07:00
Patrick Walton
6871c245a6
Rename the "llvm" API to "llvm-intrinsic"
2011-05-03 15:55:01 -07: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
3f317ede41
rustc: Name type glue properly
2011-05-03 14:41:05 -07:00
Graydon Hoare
b5a6082d41
Update valgrind.h and memcheck.h to 3.6.0
2011-05-03 12:04:00 -07:00
Graydon Hoare
dbe5dc9768
Attempt to shift build to stage0-from-snapshots.
2011-05-03 11:34:44 -07:00
Graydon Hoare
54bfe8ee27
Small fixes to snapshot script.
2011-05-03 09:25:59 -07:00
Rafael Ávila de Espíndola
5617462388
Remove unused variable.
2011-05-03 11:06:57 -04:00
Rafael Ávila de Espíndola
a3ff02f126
Split start into rustc and rustboot versions. This introduces a bit of
...
duplication, but we will hopefully drop the rustboot one soon.
This is also a preparation for changing the rustc one to have the activate glue
return to the exit glue which will then call the main function.
This (returning to the function that calls main) matches what happens when
loader stats a program or a new thread. It lets gdb produce good backtraces
and should help with EH too.
2011-05-03 10:24:18 -04:00
Graydon Hoare
a919a3082d
More snapshot logic refactoring.
2011-05-03 07:23:05 -07:00
Graydon Hoare
d987b49a4b
More hacking on the snapshot system.
2011-05-02 23:37:52 -07:00
Brian Anderson
ed40c85af5
Extract ast.is_exported from the resolve module
2011-05-02 22:07:36 -04:00
Brian Anderson
3014a5887d
Add some tests of tag-export interaction
2011-05-02 22:06:35 -04:00
Graydon Hoare
cb53065a21
Initial sketch of snapshot support code, based on code from marijn.
2011-05-02 18:56:13 -07:00
Brian Anderson
2fc58fc6a0
Revert "Use check instead of assert in export-unexported-dep"
...
This reverts commit 480eda0f10
. The commit
adding the assert keyword has been restored.
2011-05-02 20:56:46 -04:00
Patrick Walton
ebc236e91c
rustc: Time the Rust translation and LLVM passes separately
2011-05-02 17:50:46 -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
Brian Anderson
480eda0f10
Use check instead of assert in export-unexported-dep
2011-05-02 20:48:52 -04: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
Brian Anderson
764de078e7
Add a regression test that exports can expose unexported items
...
While those unexported items can't be used by name outside the module in which
they are defined, they can be used as a sort of ADT.
2011-05-02 19:42:00 -04:00
Patrick Walton
9d21cf3b61
rustc: Allocate tydescs on the stack when it's safe to do so. 60% compile speed increase.
2011-05-02 15:28:59 -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
Patrick Walton
870435caf5
rustc: Add a "fat tydesc" LLVM type to trans
2011-05-02 12:05:21 -07:00
Patrick Walton
f969b227c1
rustc: Disable frame pointer omission
2011-05-02 11:01:51 -07:00
Brian Anderson
a5ccead3fd
Add a test that imports can't circumvent exports
2011-05-01 17:22:20 -04:00
Brian Anderson
1dd63ff42d
Remove the search direction from resolve's fold environment
...
It's not actually involved in the fold so it can just be passed between the
functions that need it.
2011-05-01 16:57:36 -04:00
Brian Anderson
f25e678365
Add a regression test for use of unexported fully-qualified paths
...
An unexported foo.baz can't be resolved from inside foo when called as foo.baz
instead of just baz. This behavior may want to change eventually.
2011-05-01 16:57:36 -04:00
Brian Anderson
a697210234
Hide unexported tag variants
2011-05-01 16:57:36 -04:00
Brian Anderson
459b0ec833
Implement simple module export
2011-05-01 16:57:36 -04:00
Brian Anderson
d88776726a
rustc: Preserve dots in input path when using an implicit output path
...
This avoids outputing, e.g. /test.bc for ../test.rs
2011-05-01 14:42:45 -04:00
Brian Anderson
e75edd5e43
Fix expr-alt-generic-box2.rs and un-XFAIL
2011-05-01 12:21:08 -04:00
Brian Anderson
831b0a7501
Un-XFAIL various tests in stage0
2011-05-01 12:15:42 -04:00
Ralph Giles
46fd8dfe21
Fix a typo in the documentation.
2011-05-01 00:16:00 -07:00
Patrick Walton
b101e26d92
rustc: Run scope cleanups in the implicit block created by log statements. Fixes a leak.
2011-04-29 19:19:54 -07:00
Patrick Walton
64a5afadf3
rustc: Add constants for LLVM function attributes
2011-04-29 16:58:49 -07:00
Graydon Hoare
02336e670f
Re-XFAIL lib-io.rs, not quite working yet.
2011-04-29 16:55:45 -07:00
Patrick Walton
f6c472d816
rustc: Emit pure native glue; we don't call it yet
2011-04-29 16:40:30 -07:00
Patrick Walton
593fb195a4
rustc: Start threading a purity flag through upcalls
2011-04-29 15:39:48 -07:00
Graydon Hoare
c11d9f4268
Un-XFAIL most library tests.
2011-04-29 15:06:53 -07:00
Graydon Hoare
b9babe47da
Temporarily disable dtors; they broke self-hosting.
2011-04-29 15:06:53 -07:00
Patrick Walton
1acf404361
rustc: First steps to determine whether tydescs escape
2011-04-29 15:01:07 -07:00
Graydon Hoare
7b95b5c033
Don't emit metadata unless compiling -shared.
2011-04-29 19:20:20 +00:00
Marijn Haverbeke
c39a95da90
Implement destructors in rustc
...
Unlike rustboot, rustc keeps it destructors in vtables. Entry 0 holds
either the destructor for the obj or a NULL pointer. The method
offsets start at 1.
2011-04-29 21:19:50 +02:00
Patrick Walton
9aeb67987c
rustc: Temporarily add a switch and a corresponding makefile variable to disable typestate
2011-04-29 12:16:14 -07:00
Patrick Walton
adfacc5031
rustc: Add a --time-passes option
2011-04-29 11:55:20 -07:00
Patrick Walton
f0d24ff49e
rustc: Handle alias parameters in native functions properly
2011-04-29 11:54:41 -07:00
Patrick Walton
5d3e553141
stdlib: Add a Time module to the standard library
2011-04-29 11:54:06 -07:00
Patrick Walton
c52fb52fbc
rustc: Remove the wrong-compiler warning; we're self-hosting now.
2011-04-29 10:23:53 -07:00
Graydon Hoare
a2f68b2d58
Intern metadata while writing, shrink stage1 from 12mb to 5.7mb.
2011-04-29 15:26:28 +00:00
Patrick Walton
6daf440037
rustc: Fix vec append glue for strings. Add a test case.
2011-04-28 20:16:32 -07:00
Patrick Walton
3e08609ed7
rustc: Add some value names to the vec append glue function. Un-XFAIL vec-growth.rs.
2011-04-28 18:45:56 -07:00
Graydon Hoare
1f44887761
More attempts at fixing broken vec-append glue.
2011-04-28 18:39:12 -07:00
Patrick Walton
96d4577376
test: Add a test case for vec growth
2011-04-28 18:23:39 -07:00
Graydon Hoare
cd8cf44d1d
Make the no-growth path (previously never exercised) in rustc *work*.
2011-04-28 18:11:00 -07:00
Graydon Hoare
bcad52451c
Actually hit the no-growth path on vec-append.
2011-04-28 17:45:35 -07:00
Patrick Walton
66e5dfbde6
stdlib: Provide "array" as a friendlier shorthand for "vec[mutable? T]"
2011-04-28 17:15:32 -07:00
Graydon Hoare
e300b8047f
Consider unop deref as an lval. Un-XFAIL vec-push.
2011-04-28 16:37:18 -07:00
Patrick Walton
f2fe26a821
rustc: Add a testcase for vector push (mutable aliases with *, really)
2011-04-28 16:22:13 -07:00
Patrick Walton
171883f437
rustc: Only use color if it's supported
2011-04-28 14:59:16 -07:00
Patrick Walton
660c742902
stdlib: Add a color_supported() function to Term
2011-04-28 14:54:00 -07:00
Graydon Hoare
f0e1bb75d1
Change vec-ref-count to handle 1 or 2, so long as non-leaky and non-creeping. un-XFAIL.
2011-04-28 14:50:03 -07:00
Graydon Hoare
c9e601b31d
Drop args in native stubs too.
2011-04-28 14:35:12 -07:00
Patrick Walton
5f60937318
stdlib: Add getenv(3) to win32_os.
2011-04-28 14:35:22 -07:00
Patrick Walton
ffbbf42edd
test: Add a test for vector reference counts, XFAIL'd in rustc
2011-04-28 14:35:22 -07:00
Graydon Hoare
bfa3c05994
Log refcounts in upcall_vec_grow.
2011-04-28 13:26:19 -07:00
Tim Chevalier
2c3808b511
Enable typestate_check
...
This was supposed to be in a previous commit. I don't know what happened.
2011-04-28 13:26:19 -07:00
Tim Chevalier
26e177a97a
Enable typestate_check
...
Enable typestate checking (just for uninitialized vars) and un-XFAIL the
relevant tests for stage0.
2011-04-28 13:26:19 -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
Tim Chevalier
f61e77e745
Reindented things and removed superfluous comments, nothing to see here
2011-04-28 13:26:19 -07:00
Tim Chevalier
844fe20720
Fix some nested patterns in rustc
...
In rustc, nested patterns were potentially matching when they shouldn't
match, because a loop index wasn't being incremented. Fixed it and added
one test case.
2011-04-28 13:26:19 -07:00
Tim Chevalier
54aff74af0
Slightly more helpful error message for "null lib handle"
...
I changed the error message to also suggest checking the -L flag
when this happens.
2011-04-28 13:26:19 -07:00
Tim Chevalier
93845d0bae
Fix nested patterns in rustboot
...
The code for taking pattern-bound variables was being interspersed
with pattern code, so that if a nested pattern failed partway through,
a variable would be taken but never dropped (because the drop code
is inside the block representing the action for the pattern). For
example, in the pattern foo(?i, bar(some[t](_)), _), if the scrutinee
was foo(x, bar(none[t]), y), the variable i would be taken but never
dropped. The patch fixes this bug.
2011-04-28 13:26:19 -07:00
Tim Chevalier
25694582d9
Fix bug in handling of expr_alt (postcond for alts was being intersected with postcond for scrutinee)
2011-04-28 13:26:19 -07:00
Tim Chevalier
707cd0281d
Fixed bug in typeck that wasn't filling in anns for stmts
...
(needed for typestate_check).
Also changed a (log; fail) to (log_err; fail) in typestate_check,
and added some more logging funs in util.common.
2011-04-28 13:26:19 -07:00
Tim Chevalier
0190ebfe07
Support all expression forms in typestate
...
Added support for self_method, cont, chan, port, recv, send, be,
do_while, spawn, and ext; handled break and cont correctly.
(However, there are no non-xfailed test cases for ext or spawn in
stage0 currently.)
Although the standard library compiles and all test cases pass with
typestate enabled, I left typestate checking disabled as rustc
terminates abnormally when building the standard library if so,
even though it does generate code correctly.
2011-04-28 13:26:19 -07:00
Tim Chevalier
7c4f8cb459
Further work on typestate_check
...
Lots of work on typestate_check, seems to get a lot of the way
through checking the standard library.
* Added for, for_each, assign_op, bind, cast, put, check, break,
and cont. (I'm not sure break and cont are actually handled correctly.)
* Fixed side-effect bug in seq_preconds so that unioning the
preconditions of a sequence of statements or expressions
is handled correctly.
* Pass poststate correctly through a stmt_decl.
* Handle expr_ret and expr_fail properly (after execution of a ret
or fail, everything is true -- this is needed to handle ifs and alts
where one branch is a ret or fail)
* Fixed bug in set_prestate_ann where a thing that needed to be
mutated wasn't getting passed as an alias
* Fixed bug in how expr_alt was treated (zero is not the identity
for intersect, who knew, right?)
* Update logging to reflect log_err vs. log
* Fixed find_locals so as to return all local decls and exclude
function arguments.
* Make union_postconds work on an empty vector (needed to handle
empty blocks correctly)
* Added _vec.cat_options, which takes a list of option[T] to a list
of T, ignoring any Nones
* Added two test cases.
2011-04-28 13:26:19 -07:00
Rafael Ávila de Espíndola
b0980b7d79
Add a very minimal set of .cfi_* statements to get part of backtraces
...
working (on hello world at least):
~/inst/gdb/bin/gdb --args ./foo
(gdb) b write
...
(gdb) r
...
Breakpoint 1, 0xf7f04270 in write () from /lib32/libc.so.6
(gdb) bt
0 0xf7f04270 in write () from /lib32/libc.so.6
1 0x0804931a in rust_native_cdecl_3 ()
2 0x080487d7 in _rust_wrapper3_ ()
3 0x0804890a in _rust_fn5_main ()
4 0x08049440 in rust_native_cdecl_7 ()
2011-04-28 16:19:20 -04:00
Graydon Hoare
6daca7ea8d
Actually perform take/drop on args (oh my!)
2011-04-28 11:24:29 -07:00
Patrick Walton
91fe4ae090
rustc: Joseph and the Amazing Technicolor Error Messages
2011-04-28 10:51:12 -07:00
Patrick Walton
616ae95f6b
stdlib: Use an unsafe cast to speed up the memory writer
2011-04-27 18:18:28 -07:00
Patrick Walton
180a389832
stdlib/rt: Add an unsafe function to cast immutable vectors to mutable ones
2011-04-27 18:14:56 -07:00
Patrick Walton
e3fa22ab13
rt: Add str_vec to the def file. Puts out burning tinderbox.
2011-04-27 14:40:16 -07:00
Graydon Hoare
776255695a
Use cnames when present in ty.ty_to_str.
2011-04-27 13:36:39 -07:00
Graydon Hoare
12925505fb
Cache sha1 values of types, use seq-based mangling for glue as it's private anyways.
2011-04-27 13:36:23 -07:00
Graydon Hoare
4c7886de80
Fix _str.bytes to trivial version.
2011-04-27 13:06:19 -07:00
Patrick Walton
fef8314c2e
stdlib: Real fix for _uint.parse_buf().
2011-04-27 11:59:22 -07:00
Patrick Walton
73044b3455
stdlib: Fix a crazy underflow bug in _uint.parse_buf. Oops.
2011-04-27 11:49:06 -07:00
Graydon Hoare
031e86ca2d
Partly disable simplified-type glue optimization due to compile-time cost.
2011-04-27 16:03:45 +00:00
Patrick Walton
05587ebdff
rustc: Ignore the return value of native functions that return nil. stage1 can build libstd now, though it leaks.
2011-04-26 19:01:30 -07:00
Patrick Walton
532a65485d
rustc: Actually write the optimized bitcode when --save-temps is on
2011-04-26 19:01:24 -07:00
Brian Anderson
8216b5fc10
Fix the interaction between various flags in #fmt
2011-04-26 20:49:03 -04:00
Brian Anderson
2e12fbfc06
Support octal #fmt conversions
2011-04-26 20:20:17 -04:00
Brian Anderson
66b59e4b05
Make #fmt char conversions behave like printf
2011-04-26 20:20:17 -04:00
Graydon Hoare
e77f5b1561
Speed up calls to get_tydesc and kill cname-redundant glue generation.
2011-04-26 17:19:44 -07:00
Graydon Hoare
592cd5fa30
Disable frame-pointer elimination (not sure how this didn't get commited before).
2011-04-26 15:21:20 -07:00
Graydon Hoare
bc6e981537
Merge branch 'master' of ssh://github.com/graydon/rust
2011-04-26 20:39:33 +00:00
Graydon Hoare
418b23a538
Various bits of trans lint, nothing major.
2011-04-26 20:39:25 +00:00
Patrick Walton
ba3a4f6cc6
rustc: Cap ridiculous type name sizes
2011-04-26 13:08:48 -07:00
Patrick Walton
79d27ccb58
stdlib: Add a silly ANSI color library
2011-04-26 13:08:48 -07:00
Marijn Haverbeke
6b11f6c46f
Change rustc to use GetOpts rather than ad-hoc command-line parsing
...
NOTE: all 'long' parameters now use a double dash, so --shared, rather
than gcc-style -shared.
2011-04-26 20:32:14 +02:00
Marijn Haverbeke
74c7457131
Add GetOpts module to std
2011-04-26 20:30:44 +02:00
Marijn Haverbeke
d0ed2e384a
Add _str.slice to std lib
2011-04-26 17:38:14 +02:00
Patrick Walton
2746d20c83
rustc: Add a missing return value to Collect.ty_of_item()
2011-04-25 18:15: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
e0479c902b
rustc: Add a -save-temps option to save bitcode and write output simultaneously; document command line switches
2011-04-25 14:08:12 -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
Graydon Hoare
1b9e6b3ad2
Bind tag members as aliases rather than new locals.
2011-04-25 04:12:40 +00:00
Graydon Hoare
5fe21b5af0
Skip likely-zero initial probe, speed up map.rs.
2011-04-25 04:12:33 +00:00
Graydon Hoare
912c1fc81c
Fix busted iter/put code. Un-XFAIL foreach-box-drop.rs.
2011-04-23 14:22:10 -07: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
3d62c9adf3
rustc: Move the type serialization logic to an Encode module
2011-04-22 14:48:25 -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
Rafael Ávila de Espíndola
fac8cc3b06
Use -c in the Makefiles.
2011-04-22 15:15:52 -04:00
Patrick Walton
c1335510d5
rustc: Eliminate the direct use of ty.t.struct
2011-04-22 12:09:09 -07:00
Rafael Ávila de Espíndola
9eb1479746
Dispose the module.
...
Thanks to brson for noticing it.
2011-04-22 14:49:02 -04: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
Marijn Haverbeke
2361b65526
Switch to binary search in codemap.lookup_pos
...
Patrick observed excessive slowness when looking up positions
in rustc. This might help.
2011-04-22 12:11:00 +02:00
Graydon Hoare
d3eb3b42aa
Minimize calls to hash function in map.rs
2011-04-22 01:06:20 -07:00
Patrick Walton
117aff8688
rustc: Intern types
2011-04-21 19:31:13 -07:00
Graydon Hoare
3b047bad6e
New minimal test for current stage2 blocker.
2011-04-22 02:07:41 +00:00
Brian Anderson
540344acb9
Fix the signature of expr_ext
...
The extension body is just a string, not an expression.
2011-04-21 20:42:26 -04:00
Patrick Walton
c78b73b71d
test: Un-XFAIL drop-parametric-closure-with-bound-box.rs, oops.
2011-04-21 17:36:10 -07:00
Patrick Walton
11c359962e
test: XFAIL lib-box on stage0. Upstream LLVM doesn't have the library reading patch yet.
2011-04-21 17:35:25 -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
735435bf96
stdlib: Add a pointer equality function to the standard library and a test case
2011-04-21 16:44:17 -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
3dbfc9310a
rustc: Make the parser never assign any types, not even ty_nil
2011-04-21 13:00:06 -07:00
Patrick Walton
4d5fad696a
rustc: Get rid of boring_ann(); it duplicates plain_ann()
2011-04-21 12:51:46 -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
Patrick Walton
1ee96891a0
rustc: Create an item collection context during typechecking; move collection to a module
2011-04-20 17:59:33 -07:00
Graydon Hoare
c0d98cec45
Fix walk bug that coupled with marijns work to regress stage1.
2011-04-20 22:52:33 +00:00
Patrick Walton
bc50a3ba44
rustc: Add a type unification cache
2011-04-20 15:26:55 -07:00
Patrick Walton
7596fcfba7
rustc: Define type hashing inductively
2011-04-20 14:34:17 -07:00
Patrick Walton
276a0f2de8
rustc: Precompute type hashes
2011-04-20 12:22:28 -07:00
Patrick Walton
cac7524c1a
rustc: Remove all manual type construction outside ty.rs
2011-04-20 11:59:10 -07:00
Patrick Walton
38e842244c
rustc: Remove all uses of plain_ty() and friends from outside of ty.rs
2011-04-20 11:23:36 -07:00
Patrick Walton
ac62488bb1
rustc: Introduce preferred type constructors, which will eventually precompute hashes and intern
2011-04-20 10:51:41 -07:00
Marijn Haverbeke
c49735d7c4
Remove last uses of fold from trans.rs
2011-04-20 17:43:37 +02:00
Marijn Haverbeke
757f1520d7
Change trans.collect_items to use walk, not fold
2011-04-20 17:23:45 +02:00
Marijn Haverbeke
4fe339d5ef
Change collect_upvars from using fold to using walk
2011-04-20 12:35:34 +02:00
Marijn Haverbeke
fc6fbc1ed0
Integrate walk.rs
2011-04-20 12:35:07 +02:00
Graydon Hoare
9034a8fbd6
Fix #335 , log context needs to be a scope to capture cleanups.
2011-04-20 04:55:55 +00:00
Graydon Hoare
2e6711fca5
Small fast-path hack to ty.hash_ty and eq_ty.
2011-04-19 18:46:54 -07:00
Patrick Walton
1080ac5349
rustc: Add a -noverify option
2011-04-19 18:31:27 -07:00
Graydon Hoare
d1b9ddc8d4
Add testcase for bootstrap blocker and fix for each result type to nil.
2011-04-19 16:53:12 -07:00
Patrick Walton
6651826677
rustc: Cache the results of type_of()
2011-04-19 16:41:08 -07:00
Patrick Walton
5475c0009c
rustc: Use marijnh's stringifier for type hash and equality, since it's not sensitive to cnames
2011-04-19 16:41:08 -07:00
Graydon Hoare
928b25c9fb
Un-XFAIL a few recently passing tests.
2011-04-19 15:41:45 -07:00
Patrick Walton
0ee997cee6
rustc: Make structured comparison glue instead of emitting it inline
2011-04-19 15:29:27 -07:00
Tim Chevalier
b7dd75c904
Handle nested items correctly in typestate_check
...
Summary says it all. Actually, only nested objects and functions
are handled, but that's better than before. The fold that I was using
before to traverse a crate wasn't working correctly, because annotations
have to reflect the number of local variables of the nearest enclosing
function (in turn, because annotations are represented as bit vectors).
The fold was traversing the AST in the wrong order, first filling in
the annotations correctly, but then re-traversing them with the bit
vector length for any outer nested functions, and so on.
Remedying this required writing a lot of tedious boilerplate code
because I scrapped the idea of using a fold altogether.
I also made typestate_check handle unary, field, alt, and fail.
Also, some miscellaneous changes:
* added annotations to blocks in typeck
* fix pprust so it can handle spawn
* added more logging functions in util.common
* fixed _vec.or
* added maybe and from_maybe in option
* removed fold_block field from ast_fold, since it was never used
2011-04-19 14:56:28 -07:00
Graydon Hoare
3d9cf15d0b
Remove half-baked 'opacity' layer qualifier.
2011-04-19 14:00:04 -07:00
Graydon Hoare
d2bd07dcb0
Remove effect system from src.
2011-04-19 13:35:49 -07:00
Patrick Walton
d9d5eb82a7
rustc: Allow glue to be emitted even for scalar types; this is necessary to support compare glue
2011-04-19 11:25:40 -07:00
Patrick Walton
6599b310f7
rustc: Don't return "result" types from glue helper functions. This allows glue to fail.
2011-04-19 11:17:01 -07:00
Patrick Walton
37b5e91544
rustc: Assert that each basic block isn't terminated before adding instructions to it
2011-04-19 10:40:38 -07:00
Marijn Haverbeke
9287641c86
add rustboot-specific log upcalls to .def file
2011-04-19 18:12:49 +02:00
Marijn Haverbeke
880be6a940
Overhaul logging system in runtime
...
See https://github.com/graydon/rust/wiki/Logging-vision
The runtime logging categories are now treated in the same way as
modules in compiled code. Each domain now has a log_lvl that can be
used to restrict the logging from that domain (will be used to allow
logging to be restricted to a single domain).
Features dropped (can be brought back to life if there is interest):
- Logger indentation
- Multiple categories per log statement
- I possibly broke some of the color code -- it confuses me
2011-04-19 16:57:13 +02:00
Marijn Haverbeke
6511d471ba
replace error logging with log_err in stdlib and rustc
2011-04-19 16:57:13 +02:00
Marijn Haverbeke
6d3a423094
add log_err to rustc
2011-04-19 16:57:13 +02:00
Marijn Haverbeke
9bfc8bf11e
Add log_err to rustboot
2011-04-19 16:57:13 +02:00
Brian Anderson
7f90000ab6
Precision overrides 0-padding in #fmt
2011-04-18 22:53:26 -04:00
Brian Anderson
59d5267936
Rearrange ExtFmt.RT.pad to recover some horizontal space
2011-04-18 21:36:04 -04:00
Brian Anderson
869b28e393
Left-justification overrides 0-padding in #fmt
2011-04-18 21:36:04 -04:00
Brian Anderson
d4f1a48111
Support 0 flag in #fmt
2011-04-18 21:36:04 -04:00
Graydon Hoare
4763cd39ca
Boilerplate city, for anyone who wants it.
2011-04-18 18:32:05 -07:00
Patrick Walton
5f2cfa7351
rustc: Add an operation field to compare glue with ==, <=, and < modes
2011-04-18 12:57:00 -07:00
Rafael Ávila de Espíndola
9657e5d2d3
Revert 9ab42038bb
while I find what is
...
wrong on Windows.
2011-04-18 15:37:04 -04:00
Graydon Hoare
8a6590a75f
Remove use of 'use' from type-params-in-for-each.rs, put out darwin fire.
2011-04-18 12:20:50 -07:00
Rafael Ávila de Espíndola
9ab42038bb
Change the makefiles to use -c.
2011-04-18 15:00:17 -04:00
Patrick Walton
abd78f2f04
rustc: Create stub glue for structural comparison
2011-04-18 11:14:38 -07:00
Marijn Haverbeke
ef62fae9db
Add a proper check for rustboot
...
Uncomment log initialization.
2011-04-18 19:59:49 +02:00
Marijn Haverbeke
c40cf96656
Temporarily turn off logging initialization
...
Will be restored as soon as I find a way for the runtime
to figure out whether it is on rustboot or rustc.
2011-04-18 18:29:20 +02:00
Marijn Haverbeke
f6be25a870
Update foregoing patches to leave rust_crate alone.
...
Apparently it can't live in the main binary, since on non-Linux
platforms, dynamics libs won't find symbols in the binary. This
removes the crate_map pointer from rust_crate again, and instead
passes it as an extra argument to rust_start. Rustboot doesn't pass
this argument, but supposedly that's okay as long as we don't actually
use it on that platform.
2011-04-18 16:21:49 +02:00
Rafael Ávila de Espíndola
f12998e5d7
Add a -c option.
2011-04-18 10:02:52 -04:00
Marijn Haverbeke
148e6f7b00
Make log the log level configurable per module
...
This overloads the meaning of RUST_LOG to also allow
'module.submodule' or 'module.somethingelse=2' forms. The first turn
on all logging for a module (loglevel 3), the second sets its loglevel
to 2. Log levels are:
0: Show only errors
1: Errors and warnings
2: Errors, warnings, and notes
3: Everything, including debug logging
Right now, since we only have one 'log' operation, everything happens
at level 1 (warning), so the only meaningful thing that can be done
with the new RUST_LOG support is disable logging (=0) for some
modules.
TODOS:
* Language support for logging at a specific level
* Also add a log level field to tasks, query the current task as well
as the current module before logging (log if one of them allows it)
* Revise the C logging API to conform to this set-up (globals for
per-module log level, query the task level before logging, stop
using a global mask)
Implementation notes:
Crates now contain two extra data structures. A 'module map' that
contains names and pointers to the module-log-level globals for each
module in the crate that logs, and a 'crate map' that points at the
crate's module map, as well as at the crate maps of all external
crates it depends on. These are walked by the runtime (in
rust_crate.cpp) to set the currect log levels based on RUST_LOG.
These module log globals are allocated as-needed whenever a log
expression is encountered, and their location is hard-coded into the
logging code, which compares the current level to the log statement's
level, and skips over all logging code when it is lower.
2011-04-18 15:28:47 +02:00
Marijn Haverbeke
0bf75a203e
collect crate meta info and ext crate names
2011-04-18 15:28:47 +02:00
Marijn Haverbeke
0984d1db2e
move rust_crate structure into the actual crate code
2011-04-18 15:28:47 +02:00
Marijn Haverbeke
36c332a241
introduce local_ctxt in trans.rs to keep crate_ctxt global
...
This reduces crate_ctxt copying (which unfortunately did not
result in a noticeable speedup), and makes the role of that
type a bit more clear.
2011-04-18 15:28:47 +02:00
Brian Anderson
9976bb93d6
Support the space flag in #fmt
2011-04-17 19:50:58 -04:00
Brian Anderson
86a43c24d6
Support + flag in #fmt
2011-04-17 18:19:26 -04:00
Brian Anderson
1bec738c56
Support #fmt precision for bools, with same rules as strings
...
Not totally confident this is desirable. The alternative would be to make it a
compile error.
2011-04-17 17:24:17 -04:00
Brian Anderson
da996d6e6b
Fix indentation in syntax-extension-fmt.rs
2011-04-17 17:12:20 -04:00
Brian Anderson
685e820465
Treat char #fmt conversions just like str conversions
...
Add missing tests
2011-04-17 17:06:55 -04:00
Brian Anderson
8f6603f58e
Support #fmt precision for signed types
2011-04-17 16:51:17 -04:00
Brian Anderson
4c0aea69da
Support #fmt precision for unsigned types
2011-04-17 16:18:25 -04:00
Brian Anderson
c7edcb3a72
Support #fmt precision for string types
2011-04-17 13:10:02 -04:00
Brian Anderson
96e3e29e88
Support left-justification in #fmt conversions
2011-04-16 19:43:29 -04:00
Brian Anderson
f7b68e9edd
Add another test for #fmt conversion widths
2011-04-16 18:22:14 -04:00
Brian Anderson
dcfdb02fab
Make #fmt support explicit conversion widths
2011-04-16 18:01:17 -04:00
Brian Anderson
07e820089f
More tests for #fmt
2011-04-16 18:01:17 -04:00
Patrick Walton
0c288720b6
rustc: Capture type parameters into for-each blocks. Add a test case.
2011-04-15 18:14:29 -07:00
Patrick Walton
e37d9fc2b6
rustc: Use a regular vector instead of a hash table for type descriptors
2011-04-15 17:46:16 -07:00
Patrick Walton
3e922e2ecf
stdlib: Add some vector functions: empty, empty_mut, grow_set, and freeze. Change _vec.grow to use uint arguments.
2011-04-15 17:46:16 -07:00
Rafael Ávila de Espíndola
099e094765
Produce PIC code and use -S in the Makefile.
2011-04-15 19:29:13 -04:00
Patrick Walton
cc6a9c8876
rustc: Remove the "boxed" check, and make the static_size_of_tag recursion-eliminating transformation deep
2011-04-15 15:16:06 -07:00
Rafael Ávila de Espíndola
2214b6835d
Add a -S option for producing assembly. I will move more of it to
...
rust once the necessary APIs are available in C.
2011-04-15 17:41:14 -04:00
Patrick Walton
790084ced1
rustc: Make fold_ty no longer use an object; introduce walk_ty
2011-04-15 13:01:31 -07:00
Graydon Hoare
232c450957
Work on destructors, not entirely functional yet (no tydesc integration).
2011-04-14 16:50:59 -07:00
Patrick Walton
0387b5a060
rustc: Use the unified result for the type of assignment expressions
2011-04-14 15:28:50 -07:00
Patrick Walton
55ab187c9c
rustc: Add a test case for previous commit
2011-04-14 12:51:27 -07:00
Patrick Walton
35e021ed53
rustc: Perform type substitutions when recording locals
2011-04-14 12:33:26 -07:00
Patrick Walton
fee88f79f5
rt: Remove half-baked, incomplete, commented-out print_stack_trace() stub
2011-04-14 11:35:22 -07:00
Patrick Walton
65b7578851
rustc: Remove generalize_ty. Instead, maintain an explicit type parameter substitution list.
2011-04-14 11:24:25 -07:00
Patrick Walton
ec5a60d5e2
rustc: Use union-find for variable substitution
2011-04-14 11:24:25 -07:00
Brian Anderson
99a697b56a
Add support for upper-case hex and binary output to #fmt.
...
Only works for uints at present. Necessitated the addition of _str.to_upper.
2011-04-13 22:14:54 -04:00
Brian Anderson
5c0f4c1939
Add more commentary about ExtFmt
2011-04-13 22:14:40 -04:00
Brian Anderson
4844e1c08a
Add support for printing uints as lower-case hex to ExtFmt.
...
Begin passing an ExtFmt.RT.conv parsed format description to each of the
ExtFmt.RT.conv* functions.
2011-04-13 22:14:24 -04:00
Brian Anderson
aebdef0cd6
Move #fmt conversion model into ExtFmt.CT namespace
2011-04-13 22:13:21 -04:00
Brian Anderson
44aed626bf
Add ExtFmt test for unsigned type
2011-04-13 22:13:04 -04:00
Brian Anderson
330fdd2b04
Fix a typo in test expr-alt-generic-box1.rs
2011-04-13 21:46:20 -04:00
Tim Chevalier
de50efebc2
rm unused import
2011-04-13 15:50:34 -07:00
Tim Chevalier
7c6e6fc5d4
Make expr_while work in typestate_check
...
Also did some refactoring in typestate_check. All test cases in
compile-fail that involve uninitialized vars now fail correctly!
(All eight of them, that is.)
2011-04-13 15:50:34 -07:00
Graydon Hoare
eb33a5307b
Remove gc() call from end of lib-map.rs, works on stage0 otherwise (stage0 produces no gc info)
2011-04-13 15:47:05 -07:00
Graydon Hoare
afeb3a417c
Fix temporary-spilling logic in trans_args, uncomment most of lib-deque.rs (which now passes on stage0).
2011-04-13 15:21:54 -07:00
Graydon Hoare
0910a7323c
Add generic-temporary.rs minimal test showing cause of lib-deque.rs failure on stage0.
2011-04-13 13:21:06 -07:00
Graydon Hoare
2c65e10a9f
Fix lib-deque.rs to pass typarams by alias.
2011-04-13 12:29:34 -07:00
Graydon Hoare
80a4b1ba53
Slight updates to match API drift in io, lib-io.rs passes.
2011-04-13 12:05:15 -07:00
Rafael Ávila de Espíndola
01b1d4110d
Remove code that is already in llvm for some time.
2011-04-13 14:55:44 -04:00
Graydon Hoare
8e0ecb4d1a
Lex numeric escapes, needed for lib-str.rs (which now passes).
2011-04-13 11:25:11 -07:00
Rafael Ávila de Espíndola
3e081d20e5
Typo.
2011-04-13 14:11:28 -04:00
Rafael Ávila de Espíndola
e7b8db2e63
Enable alias analysis and the function attributes pass.
...
The C API extension is already upstream, we can drop the local copy once
the bots are updated.
2011-04-13 13:54:08 -04:00
Tim Chevalier
63e87c102d
typestate_check can now handle expr_block, expr_if, and expr_binary
...
(caveat for the latter: it assumes that binary operations are strict;
a TODO is to detect or and and and correctly reflect that they're lazy
in the second argument). I had to add an ann field to ast.block,
resulting in the usual boilerplate changes.
Test cases that currently work (if you uncomment the typestate pass
in the driver) (all these are under test/compile-fail):
fru-typestate
ret-uninit
use-uninit
use-uninit-2
use-uninit-3
2011-04-12 19:03:52 -07:00
Patrick Walton
de0175abed
rustc: Switch to indices for type parameters
2011-04-12 15:10:40 -07:00
Patrick Walton
e11e8754de
rustc: Add "float" as a type to the pretty printer
2011-04-12 15:10:39 -07:00
Tim Chevalier
d7e8818414
Further work on typestate. Handles expr_rec and expr_assign now.
...
Also changed the ts_ann field on statements to be an ann instead,
which explains most of the changes.
As well, got rid of the "warning: no type for expression" error
by filling in annotations for local decls in typeck (not sure whether
this was my fault or not).
Finally, in bitv, added a clone() function to copy a bit vector,
and fixed is_true, is_false, and to_str to not be nonsense.
2011-04-12 14:31:46 -07:00
Rafael Ávila de Espíndola
87d17c3a2c
Add LLVMAddLoopIdiomPass.
2011-04-12 16:13:31 -04:00
Rafael Ávila de Espíndola
424d3e3837
Add LLVMAddCorrelatedValuePropagationPass.
2011-04-12 16:08:13 -04:00
Rafael Ávila de Espíndola
8e5109d4ed
Add LLVMAddScalarReplAggregatesPassSSA.
2011-04-12 15:59:38 -04:00
Graydon Hoare
5f6abdc0e8
Un-XFAIL generic-tag-corruption.rs.
2011-04-12 12:58:43 -07:00
Graydon Hoare
7c55938125
Make glue always pass-by-alias and rename "scalar_or_boxed" concept to "immediate"
2011-04-12 12:48:46 -07:00
Graydon Hoare
f374fa44b6
Tighten up condition on use of opaque_tag, remove blunt hammer of alias arg-casting in trans_args.
2011-04-12 12:48:46 -07:00
Rafael Ávila de Espíndola
832ad0e041
Add LLVMAddEarlyCSEPass to the .def file.
2011-04-12 15:48:11 -04:00
Rafael Ávila de Espíndola
dd6fc607a4
Enable more optimizations.
2011-04-12 15:33:39 -04:00
Brian Anderson
73eecbd0ca
Factor out creation of calls into ExtFmt.RT
2011-04-11 21:55:03 -04:00
Brian Anderson
bba245f3e6
Add support for bool, char to extfmt.
...
XFAIL syntax-extension-fmt in rustboot.
2011-04-11 21:54:03 -04:00
Brian Anderson
37f87161cc
Move ExtFmt compile-time functions into their own module
2011-04-11 21:51:23 -04:00
Brian Anderson
c41796f2ca
Use correct indentation for ExtFmt.rs
2011-04-11 21:51:23 -04:00
Brian Anderson
ce85b9eb7b
Make ExtFmt call its own functions instead of others defined in std
2011-04-11 21:51:23 -04:00
Brian Anderson
d4d0144bcf
Move extfmt parsing into standard library
2011-04-11 21:51:23 -04:00
Brian Anderson
5a36786634
Move the extfmt data model into the standard library.
2011-04-11 21:51:23 -04:00
Patrick Walton
9d9790c7f5
rustc: Add a uint hash function
2011-04-11 16:54:05 -07:00
Patrick Walton
e0faf57313
rustc: Factor out expr_ty() into expr_ann() and expr_ty()
2011-04-11 15:05:39 -07:00
Graydon Hoare
d218df02bf
Add new minimal testcase showing generic tag memory corruption.
2011-04-11 15:00:18 -07:00
Rafael Ávila de Espíndola
fcb344799a
Add a hack to force the linker to fetch Object.o
2011-04-11 15:49:45 -04:00
Rafael Ávila de Espíndola
cca6335c26
Implement the "attempted dynamic environment-capture" error in rustc.
2011-04-11 15:35:01 -04:00
Brian Anderson
1f04c3dcef
Un-XFAIL expr-block-fn.rs
...
It mysteriously works now.
2011-04-10 16:25:09 -04:00
Patrick Walton
3efb7f5459
rustc: Push down types for all expressions; add logic for recv and send
2011-04-08 18:14:31 -07:00
Graydon Hoare
35573144c5
Remove silly legacy glue-offset encoding, predicate runtime adjustments by ABI. LLVM should inline most glue now.
2011-04-09 00:54:46 +00:00
Marijn Haverbeke
c0d0b717ee
Fix codemap.lookup_pos
...
Previously, it would place every single location in the first
file of the crate that was parsed.
2011-04-09 01:57:48 +02:00
Patrick Walton
129c8392af
rustc: Rename "demand" to "pushdown" in the typechecker and explain more clearly what it's for
2011-04-08 16:22:03 -07:00
Marijn Haverbeke
1af3174fe3
Move to single-uint file-position representation.
...
This makes passing them around cheaper. There is now a table (see
front/codemap.rs) that is needed to transform such an uint into an
actual filename/line/col location.
Also cleans up the span building in the parser a bit.
2011-04-09 01:05:18 +02:00
Marijn Haverbeke
094d31f5e4
Make lexer buffer the whole file
...
This way, it won't have to go through a bunch of calls for each
byte fetched.
2011-04-09 01:05:18 +02:00
Patrick Walton
573bc5ad01
rustc: Resolve ty_locals
2011-04-08 15:41:08 -07:00
Patrick Walton
5355811859
rustc: Add the ability to fold over annotations
2011-04-08 15:21:49 -07:00
Rafael Ávila de Espíndola
ad7aff8203
Remove unused function.
2011-04-08 16:03:35 -04:00
Rafael Ávila de Espíndola
70bc63a3af
Remove unused function.
2011-04-08 15:14:26 -04:00
Tim Chevalier
97d0f76c63
fix long lines
2011-04-08 17:46:46 +00:00
Tim Chevalier
9c001af07c
Implemented computing prestates and poststates for a few expression forms.
...
The typestate checker (if it's uncommented) now correctly rejects a
trivial example program that has an uninitialized variable.
2011-04-08 17:46:46 +00:00
Marijn Haverbeke
6109dba305
Disable effect checking in rustboot
2011-04-08 18:44:58 +02:00
Brian Anderson
b883ec4c9d
Avoid some gotchas with logging macros
...
I think this is sufficient to eliminate multiple evaluation and the
possibility of accidental miscompilation from the logging macros.
2011-04-07 22:53:16 -04:00
Brian Anderson
0abccc6370
Add a test case for calling generic functions taking alias args with box types
2011-04-07 22:23:07 -04:00
Brian Anderson
a4f8de382a
Add an XFAILed test for blocks that result in functions
2011-04-07 22:13:39 -04:00
Brian Anderson
d2d42fd4c7
Make block results work for generic types
...
I think just about every type can be used as a block result now. There's quite
a proliferation of tests here, but they all test slightly different things and
some are split out to remain XFAILed. The tests of generic vectors are still
XFAILed because generic aliased boxes still don't work in general.
2011-04-07 21:58:36 -04:00
Patrick Walton
afa6d85d61
stdlib: Add a simple union-find data structure
2011-04-07 18:02:01 -07:00
Patrick Walton
f28a9d8f52
rustc: Pointer cast when crossing a box boundary for statically-sized elements in trans_index()
2011-04-07 18:02:01 -07:00
Marijn Haverbeke
009e01dbe7
add FIXME related to the -fno-strict-aliasing workaround
2011-04-08 02:23:33 +02:00
Marijn Haverbeke
53cc673db1
Re-add a read_byte() method to buf_reader objs
...
This was removed because of the repetition, but doing single-byte
reads in terms of read_bytes (which allocates a vec) is needlessly
slow. This change speeds up parsing by 22%.
(Eventually, we won't be able to escape handling the buffering in the
stdlib itself.)
2011-04-08 02:23:14 +02:00
Marijn Haverbeke
bb56253015
Initialize two more variables to keep darwin tinderbox happy
2011-04-08 00:59:45 +02:00
Marijn Haverbeke
32e62d0151
add a -parse-only option to rustc
...
(undocumented, only used for profiling the parser)
2011-04-08 00:46:41 +02:00
Marijn Haverbeke
973023030e
add -O2 when compiling rt, fix warnings triggered by optimizer
2011-04-08 00:41:52 +02:00
Lindsey Kuper
21b31a350a
Updated test to use 'check' rather than just logging results.
2011-04-07 15:22:34 -07:00
Marijn Haverbeke
9a7576fe2c
Move to macro-based logging checks in the C++ code
...
No functions should be called for log statements that turn out to be
inactive.
2011-04-07 15:15:30 -07:00
Patrick Walton
6dcf6218b1
rustc: Pointer cast when autodereferencing boxed tag types
2011-04-07 15:12:48 -07:00
Patrick Walton
9b35051143
rustc: Use the name "opaque_tag", not "tag", for opaque tags
2011-04-07 15:12:48 -07:00
Lindsey Kuper
1092bbfff0
Support for self-calls that take arguments.
...
Nicer parsing of self-calls (expr_self_method nodes inside expr_call
nodes, rather than a separate expr_call_self) makes typechecking
tractable. We can now write self-calls that take arguments and return
values (see: test/run-pass/obj-self-*.rs).
2011-04-07 14:26:34 -07:00
Marijn Haverbeke
39774e88b4
Add a very basic crate-dump utility
...
'rustc -ls [cratelib]' will now dump out a list of symbols defined by
the crate, as well as a short description of what they are.
2011-04-07 14:19:19 -07:00
Marijn Haverbeke
d678dad434
Fix problem in metadata writer
...
It was creating non-multiple-of-four section sizes, which, for some
reason, presumably by LLVM, were clipped, rather than padded, to be a
multiple of four.
2011-04-07 14:19:17 -07:00
Marijn Haverbeke
ac3026412b
Revise EBML reader API
...
New one is less stateful, easier to work with.
2011-04-07 14:19:16 -07:00
Patrick Walton
0f5f467dc0
rustc: Remove useless call to type_of() in trans_rec()
2011-04-07 13:55:02 -07:00
Patrick Walton
08bf4d1f19
"xfail-stage0", not "XFAIL-stage0"
2011-04-07 13:53:11 -07:00
Patrick Walton
3236e6008c
XFAIL lib-option.rs in stage0 due to crash on Darwin on tinderbox
2011-04-07 13:44:20 -07:00
Patrick Walton
a97a200413
Fix effect on deref-lval
2011-04-07 13:30:50 -07:00
Patrick Walton
015c0d0d59
rustc: Allow dereference expressions to be used as lvalues. Add a test case.
2011-04-07 12:51:27 -07:00
Rafael Ávila de Espíndola
b4422cca21
Add a -O option and change the Makefile to use it.
2011-04-07 15:42:06 -04:00
Patrick Walton
ddf96ac3a8
rustc: Reindent line. Puts out burning tinderbox.
2011-04-07 12:01:48 -07:00
Patrick Walton
cd6962f29d
rustc: Link to external tag discriminants. Un-XFAIL test/run-pass/lib-option.rs.
2011-04-07 11:42:40 -07:00
Patrick Walton
2a894cabc2
Merge branch 'master' of github.com:graydon/rust
2011-04-07 10:14:25 -07:00
Rafael Ávila de Espíndola
25320da099
Run optimizations.
...
It is always on for now just to make sure the bots are happy. If they
are, I will add a -O option and update the makefile.
2011-04-07 12:12:21 -04:00
Tim Chevalier
2e90bd94de
Continued sketching out code for checking states against preconditions.
...
It's still sketchy. I added a typestate annotation field to statements
tagged stmt_decl or stmt_expr, because a stmt_decl statement has a typestate
that's different from that of its child node. This necessitated trivial
changes to a bunch of other files all over to the compiler. I also added a
few small standard library functions, some of which I didn't actually end
up using but which I thought might be useful anyway.
2011-04-06 17:58:18 -07:00
Patrick Walton
d9da43984b
Merge branch 'master' of github.com:graydon/rust
2011-04-06 10:25:32 -07:00
Graydon Hoare
36d75d6391
Minimal testcase for next bootstrap blocker.
2011-04-06 08:33:24 -07:00
Graydon Hoare
5e98cd9472
Remove reference to nonexistent ast.module from typestate_check.rs, stage1 doesn't like it.
2011-04-06 04:18:12 +00:00
Graydon Hoare
52abd912c0
Brute force and ignorance workaround for tag-and-generic-obj; un-XFAIL it.
2011-04-05 21:08:13 -07:00
Graydon Hoare
8382990627
Add new minimal test for current blocker on bootstrapping.
2011-04-05 17:27:55 -07:00
Tim Chevalier
86d4601827
More work on typestate. Sketched out code for computing and checking prestates and poststates. Still a long ways away.
2011-04-06 00:17:06 +00:00
Lindsey Kuper
4fc8de1969
Last pieces of self-call support.
...
The last few pieces of the hack that lets us use trans.trans_call() to
translate self-calls, plus a fix for the parser buy that was
preventing self-call expressions from getting past parsing.
test/run-pass/obj-self.rs works now (as in it actually prints "hi!"
twice!).
2011-04-05 16:26:31 -07:00
Lindsey Kuper
b8bb2e118e
Further on the path toward self-awareness.
...
Mostly:
* Merciless refactoring of trans.rs so that trans_call can work for
self-calls as well as other kinds of calls
Also:
* Various changes to go with having idents, rather than exprs, in
expr_call_self AST nodes
* Added missing case for SELF token to token.to_str()
2011-04-05 14:54:48 -07:00
Graydon Hoare
8703c8067f
FIx native wrapper generation to handle more arg types.
2011-04-05 21:52:48 +00:00
Lindsey Kuper
361ee5a68b
Oops -- if we're going to use the pretty-printer, we need it to work.
2011-04-05 11:55:14 -07:00
Lindsey Kuper
ba537fa5f5
Knocking out a quick fixme: pretty-printing exprs in error messages.
2011-04-05 11:55:12 -07:00
Graydon Hoare
70e5457d7c
Make box prefix operator and box type carry mutability flag.
2011-04-04 15:44:15 -07:00
Patrick Walton
f10a5bbad0
rustc: Make type_of() return the type of the wrapper for native functions. lib-map now compiles, but fails to work properly.
2011-04-03 15:23:58 -07:00
Brian Anderson
bd9f45446a
Begin comparing vectors from the correct address
...
Start at the first element instead of the address of the vector.
2011-04-03 03:09:20 -04:00
Graydon Hoare
8e9c5b96fb
Change rust_vec to have a 16-byte header, to 16-byte-align vec-body data. Major perf win.
2011-04-02 19:05:12 -07:00
Brian Anderson
1326d424c9
Add more tests for alt expressions
2011-04-02 20:35:51 -04:00
Brian Anderson
99901bdbc4
Add FIXMEs around type handling in trans_if, trans_alt
2011-04-02 20:35:51 -04:00
Brian Anderson
21fb49ad95
Join the results of alt arms so alt can be used as an expression.
...
Un-XFAIL expr-alt.rs.
2011-04-02 20:35:50 -04:00
Brian Anderson
203e33b611
Make join_results branch into the join block even when only one edge is live.
...
I don't don't totally understand the implications of this but it makes the
behavior consistent for all live edges, which is going to make joining the
arms of an alt expression work correctly.
2011-04-02 20:35:50 -04:00
Brian Anderson
6e6acaa39a
Fail on non-exhaustive alt matches
2011-04-02 20:35:50 -04:00
Brian Anderson
9d0a505d61
Terminate fail blocks by making their ends unreachable.
...
This will make implementing default alt arms simpler.
2011-04-02 20:35:50 -04:00
Graydon Hoare
4f90c88b4d
Write typarams for variants. Typecheck gets as far as ty.rs now.
2011-04-01 18:53:08 -07:00
Graydon Hoare
5b7961b641
Encode ty_native ebml node for native types so typechecker has something to work with.
2011-04-01 18:34:13 -07:00
Graydon Hoare
c077da553d
Remove typestate_check reference to nonexistent ast.init node; rustc compiling itself notices what rustboot did not :)
2011-04-01 18:33:47 -07:00
Graydon Hoare
23f18a096f
Re-enable typestate_check in build, was lost during merge. Sorry.
2011-04-01 17:23:56 -07:00
Graydon Hoare
0397c05f42
Support for passing native types through metadata/creader.
2011-04-01 17:04:51 -07:00
Graydon Hoare
2a2ea6351d
Comment out import for not-yet-compiling typestate_check.
2011-04-01 17:04:07 -07:00
Graydon Hoare
3971110d7f
Guh. Actually commit the staged undo-of-indentation. Forgotten git staging wins again.
2011-04-01 16:04:22 -07:00
Graydon Hoare
7d88e63ec8
Switch private linkage to local, re-indent trans.rs.
2011-04-01 15:01:46 -07:00
Patrick Walton
3a8b0be1cb
rustc: Write symbols for native items into the crate metadata
2011-04-01 14:18:46 -07:00
Patrick Walton
a0eb9c814b
rustc: Don't try to write symbols into the metadata for nullary tags. Puts out burning tinderbox.
2011-04-01 14:14:10 -07:00
Patrick Walton
6dc452335a
rustc: Get tag variants from the crate metadata
2011-04-01 13:02:44 -07:00
Patrick Walton
ec9d7abf8c
rustc: Have tag_variants() return a new variant_info structure instead of an AST node
2011-04-01 11:37:31 -07:00
Tim Chevalier
3130348ee1
Started adding support for typestate checking.
...
I added a new field to the ast "ann" type for typestate information.
Currently, the field contains a record of a precondition bit vector and
postcondition vector, but I tried to structure things so as to make
it easy to change the representation of the typestate annotation type.
I also had to add annotations to some syntactic forms that didn't have
them before (fail, ret, be...), with all the boilerplate changes
that that would imply.
The main call to the typestate_check entry point is commented out and
the actual pre-postcondition algorithm only has a few cases
implemented, though the overall AST traversal is there. The rest of
the typestate algorithm isn't implemented yet.
2011-04-01 11:27:32 -07:00
Patrick Walton
69a34b992b
rustc: Remove useless call to tag_variant_with_id()
2011-04-01 10:59:59 -07:00
Brian Anderson
1bc06bc59b
Cleanup typos and newlines
2011-04-01 00:05:13 -04:00
Brian Anderson
efb738153c
Add an XFAILed test for treating alts as expressions
2011-03-31 23:23:27 -04:00
Brian Anderson
dcf04ffbad
Un-XFAIL expr-if-box.rs
2011-03-31 23:15:11 -04:00
Brian Anderson
f16e7242d2
Initialize the alloca used to retrieve boxed block results to null.
...
This allows blocks to be used in conditional constructs where the block may
not ever execute: the drop glue will notice that it was never used and ignore
it.
Also, beef up the comments.
2011-03-31 23:15:11 -04:00
Brian Anderson
524e803582
Only use allocas to hold expression results for boxed types
2011-03-31 23:15:11 -04:00
Brian Anderson
f05d3c516b
Add more comments to trans_block
2011-03-31 23:15:11 -04:00
Brian Anderson
cf16f4f7e5
Add a test for block expressions of generic types. XFAILed
2011-03-31 23:15:11 -04:00
Brian Anderson
c27b72e323
Add another test for blocks as expressions
2011-03-31 23:15:11 -04:00
Brian Anderson
19a949c15e
Un-XFAIL expr-block-box.rs
2011-03-31 23:15:11 -04:00
Brian Anderson
125bebbf60
Modify trans.rs to allow blocks to result in boxed values
2011-03-31 23:15:11 -04:00
Brian Anderson
bd1c61548e
Move str test from expr-if.rs to expr-if-box.rs in preperation for breaking that code path.
2011-03-31 23:15:11 -04:00