Commit Graph

2098 Commits

Author SHA1 Message Date
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
Brian Anderson
d631f29d47 Add block_to_str and expr_to_str methods to the pprust module.
Since pprust is authed impure these can be used for debug logging.
2011-03-31 23:15:11 -04:00
Brian Anderson
2490cd3275 Add a test for block expressions that have results. XFAILed. 2011-03-31 23:15:11 -04:00
Patrick Walton
c66edca83d rustc: Add a type annotation to tag items 2011-03-31 19:12:40 -07:00
Patrick Walton
1eeedbd008 rustc: Make tag_ty_params() and substitute_ty_params() take def ids instead of ty_params, and to check in external crates 2011-03-31 18:45:24 -07:00
Patrick Walton
bdea343879 rustc: Use the path index. Speeds up compilation a lot. 2011-03-31 18:28:59 -07:00
Patrick Walton
fffc5d3b3d rustc: Write out a path index as well 2011-03-31 18:28:59 -07:00
Graydon Hoare
1b65a61cad Couple minor bug fixes in creader, lib-bitv, int, rand, sort, sha1, uint and vec all work. 2011-03-31 15:57:36 -07:00
Patrick Walton
3c1de96cda rustc: Use the crate index to look up defs 2011-03-31 14:37:44 -07:00
Lindsey Kuper
ef0c903f6a More stuff to go with the new expr_call_self AST node 2011-03-31 14:16:02 -07:00
Lindsey Kuper
e939d6f17c More machinery for adding an expr_call_self AST node. 2011-03-31 14:04:53 -07:00
Patrick Walton
6c383bbd7b rustc: Index only the local part of definition IDs 2011-03-31 12:24:59 -07:00
Patrick Walton
3945ace520 rustc: Write out an index of definition info in crate metadata 2011-03-31 11:56:02 -07:00
Patrick Walton
6a60cb1e0c rustc: Mix the bits more when hashing def ids 2011-03-31 11:55:28 -07:00
Patrick Walton
dec92d392e stdlib: Add a write_be_uint() function to writers 2011-03-31 11:54:52 -07:00
Patrick Walton
7f3f66df7b rustc: Use the scaled index, not the raw index, if a vector has generic size. lib-vec.rs works now. 2011-03-31 10:10:21 -07:00
Brian Anderson
607fa14960 Rename incr_all_refcnts to take_ty, to match drop_ty 2011-03-31 14:52:30 +00:00
Brian Anderson
b0b72ab472 Restore scope block contexts to the translation of expr_block.
I removed this previously but that was wrong because it caused
block expressions to not create a new scope.
2011-03-31 14:52:29 +00:00
Brian Anderson
50e354611f Remove redundant parser logic.
These cases are all dealt with in parse_expr_inner.
2011-03-31 14:52:29 +00:00
Marijn Haverbeke
6a75740e96 handle unterminated block comments and line comment at eof 2011-03-31 14:41:40 +00:00
Marijn Haverbeke
39f0656b4f Improve line comment positioning
This involved making ast.variant spanned.
2011-03-31 14:41:40 +00:00
Marijn Haverbeke
8a7ea941bb Support break and cont in pretty-printer 2011-03-31 14:41:40 +00:00
Marijn Haverbeke
f8393cc572 Add effect field to ast.ty_fn.
Still not used, except by the pretty-printer.
2011-03-31 14:41:40 +00:00
Marijn Haverbeke
e7e6f396d8 Preserve comments when pretty-printing.
The patch also includes a number of smaller fixes to the
pretty-printer that were encountered on the way.
2011-03-31 14:41:39 +00:00
Graydon Hoare
ffc188a4dd Tweak build command on rustc. 2011-03-31 14:41:35 +00:00
Patrick Walton
ab8d200fb0 rustc: Read 'y' tags from external crates 2011-03-30 18:28:33 -07:00
Patrick Walton
ae5ba62b24 rustc: Use the type cache to construct external item references 2011-03-30 18:15:29 -07:00
Patrick Walton
cc59cea8b0 rustc: Thread an item-to-type mapping throughout the typechecking and translation phases 2011-03-30 17:28:06 -07:00
Graydon Hoare
a154c5b656 Um, that'd be, align the word *before* retpc. Addresses point to the low part of a word. Un-XFAIL nbody on Darwin. 2011-03-30 14:10:06 -07:00
Graydon Hoare
3e7b991d49 Ensure task stacks start out with a 16-byte aligned entry frame. Should make OSX behave a bit better. 2011-03-30 13:04:18 -07:00
Graydon Hoare
b5a4336487 Re-XFAIL lib-int.rs and lib-uint.rs. 2011-03-29 23:10:28 -07:00
Graydon Hoare
61e5587eab Re-XFAIL lib-bitv.rs harder 2011-03-29 22:58:50 -07:00
Graydon Hoare
51807ad628 Re-XFAIL lib-bitv.rs 2011-03-29 22:08:35 -07:00
Patrick Walton
301cfe1354 rustc: Add all items to the item table during translation. lib-vec now compiles, but asserts and then segfaults. 2011-03-29 18:16:53 -07:00
Patrick Walton
b09e09c673 rustc: Un-XFAIL lib-uint.rs 2011-03-29 18:16:53 -07:00
Patrick Walton
601cf8c97f rustc: Un-XFAIL lib-int.rs. 2011-03-29 17:31:48 -07:00
Patrick Walton
626bdaaa1f rustc: Parse parameter IDs in external crate metadata. Un-XFAIL lib-bitv.rs. 2011-03-29 17:25:55 -07:00
Patrick Walton
c67eb1a575 rustc: Partially resolve external module imports 2011-03-29 17:01:27 -07:00
Patrick Walton
6a5feffd6c rustc: Tolerate def id tags inside module tags. Fixes metadata reading. 2011-03-29 16:43:27 -07:00
Lindsey Kuper
55fbed3d8d Beginnings of support for magical self prefix; nothing profound happening yet. 2011-03-29 15:59:15 -07:00
Graydon Hoare
f6490a6f03 Ignore 'mutable foo' in plain field contexts. 2011-03-29 15:40:21 -07:00
Patrick Walton
94c061729b rustc: Resolve external modules and native modules to definition IDs as well 2011-03-29 14:46:42 -07:00
Graydon Hoare
77f85460e6 Rename trans_native to trans_native_call, for clarity. 2011-03-29 13:23:51 -07:00
Graydon Hoare
734abe593d Teach trans to emit undefined references to 'use'd symbols. Can compile and run a simple 'use std;' example now. 2011-03-29 13:23:51 -07:00
Brian Anderson
8f2a97a562 Add partial support for if expressions resulting in generic types 2011-03-28 21:14:08 -07:00
Brian Anderson
38d5453584 Add an XFAILed test for if expressions resulting in boxes 2011-03-28 21:14:06 -07:00
Brian Anderson
aced4ce145 Handle structural types as the result of if expressions 2011-03-28 21:14:04 -07:00
Brian Anderson
a5a319fa04 Teach rustc to use the result of if expressions 2011-03-28 21:14:03 -07:00
Brian Anderson
2b27d12ce1 Add expr_spawn, spawn parsing, folding, typechecking, ty_task 2011-03-28 21:13:53 -07:00
Graydon Hoare
268b2140dc Add long-while.rs to check on frame growth. 2011-03-28 18:07:29 -07:00
Graydon Hoare
540d29f641 Move all allocas to dedicated basic block at top of function, to keep frames finite. Un-comment next size in nbody.rs. 2011-03-28 18:07:29 -07:00
Patrick Walton
2809e30d1d rustc: Parse types in external metadata 2011-03-28 16:49:26 -07:00
Patrick Walton
ace2c92a96 rustc: Populate the item types table with types of items from external crates; remove the redundant typeck.ty_and_params type on the way 2011-03-28 14:42:01 -07:00
Patrick Walton
621ab34410 rustc: Remove commented out "encode_tag_variant_info" call that sneaked in 2011-03-28 13:31:13 -07:00
Patrick Walton
62f4709953 rustc: Resolve def ids in external crates 2011-03-28 13:29:59 -07:00
Patrick Walton
cc221c472a rustc: Don't include a trailing null when writing out metadata; it corrupts the EBML 2011-03-28 13:15:03 -07:00
Graydon Hoare
8b5968165f Fix get_tydesc to alloca enough room for root; remove hack that was attempting to paper over it. Fix from espindola. 2011-03-28 11:11:03 -07:00
Patrick Walton
1cb3ce89dd shootout: Hoist out the movement too; switch square root to an LLVM intrinsic 2011-03-28 08:24:58 -07:00
Patrick Walton
81695a19f8 rustc: Add support for calling LLVM intrinsics as native functions 2011-03-28 08:24:58 -07:00
Marijn Haverbeke
6ecdc04788 Add support for break and cont to rustc
Testing proper cleanup is hampered by
https://github.com/graydon/rust/issues/293
2011-03-27 14:11:23 +02:00
Patrick Walton
9c5affda1a shootout: Hoist out the vector indexing on nbody; don't rely on LICM, which isn't working for some reason (insufficient alias info?) Speeds up nbody a bit. 2011-03-26 23:10:28 -07:00
Graydon Hoare
f59e49c9a6 Twiddle visibility, start exposing only type-mangled names (64 bit truncated sha1 prefixes). 2011-03-26 19:14:07 -07:00
Lindsey Kuper
2650487120 Got the nbody demo working, and hopefully faster, too! 2011-03-26 17:51:54 -07:00
Lindsey Kuper
1c1c67229a Updates to the nbody demo. 2011-03-26 17:51:42 -07:00
Graydon Hoare
dbc7289a4d Start refactoring name-mangling in trans. 2011-03-26 17:36:47 -07:00
Graydon Hoare
643a75b86e Add visibility enum values to lib.llvm. 2011-03-26 17:36:26 -07:00
Graydon Hoare
e99feabf47 Add a result_str method to std.sha1.sha1. 2011-03-26 17:36:08 -07:00
Graydon Hoare
ac6e1131e9 Teach creader and metadata writer how to do ty.ty_type. 2011-03-26 17:35:51 -07:00
Patrick Walton
bea41aa7d8 rustc: Add a function to look up external item info in the item info table 2011-03-25 19:02:19 -07:00
Graydon Hoare
027368b885 Janitorial: move llvmext back to llvm module, as they're the same thing now. 2011-03-25 18:45:00 -07:00
Graydon Hoare
fb08ef44b4 Tweak rustllvm bindings to work on linux, where bool != LLVMBool. 2011-03-25 18:45:00 -07:00
Patrick Walton
24a75eeccc rustc: Parse definition IDs from crates; add a function to parse unsigned ints to the standard library 2011-03-25 18:35:30 -07:00
Graydon Hoare
ee686dacb8 Add get_extern_const, factor get_extern into get_extern_fn and get_simple_extern_fn. 2011-03-25 17:59:56 -07:00
Patrick Walton
94c19a18ae rustc: Look up names in "use"d crates 2011-03-25 17:54:48 -07:00
Graydon Hoare
661f1c541e Trans nomenclature tidy-up: upcall vs. native vs. extern. 2011-03-25 15:48:00 -07:00
Graydon Hoare
b2427509e2 Another go at changing compile-command, this time using RBUILD env var. 2011-03-25 15:07:27 -07:00
Patrick Walton
864e2ab24e stdlib: Implement a memory buffer reader, untested at the moment 2011-03-25 15:01:21 -07:00
Graydon Hoare
3712ee68ad Sketch of wiring typeck up to creader. 2011-03-25 14:34:32 -07:00
Patrick Walton
739c4aedf1 stdlib: Separate basic I/O reading functionality into a separate buf_reader object, like writing 2011-03-25 14:06:18 -07:00
Graydon Hoare
91c2b82b09 Revert "Bulk-edit compile commands in emacs chatter to point to assumed build/ dir off src root."
This reverts commit 846f2e2ba9.
2011-03-25 14:05:38 -07:00
Graydon Hoare
846f2e2ba9 Bulk-edit compile commands in emacs chatter to point to assumed build/ dir off src root. 2011-03-25 13:48:37 -07:00
Graydon Hoare
49d9d5688e Switch xfail system to use comments embedded in source files. 2011-03-25 12:19:20 -07:00
Tim Chevalier
a47cd50dfb Parse FP literals without coercing to int. This allows parsing 64-bit
floats. However, if someone writes a literal that can't be represented
precisely in 64 bits, the front-end will accept it while the back-end
will (presumably) complain.
2011-03-25 11:20:30 -07:00
Patrick Walton
e2d6475308 rustc: Store cached crate metadata in the session 2011-03-25 11:11:21 -07:00
Brian Anderson
9ca7acb1f3 Update pretty printer for ports, channels, send and receive 2011-03-25 11:01:52 -07:00
Brian Anderson
ebc4df3c7a Implement local declarations with receive. Un-XFAIL decl-with-recv.rs. 2011-03-25 11:01:52 -07:00
Brian Anderson
71f058499a Refactor ast.local to make room for initialization via recv 2011-03-25 11:01:52 -07:00
Brian Anderson
ef1bcdea70 Add test for local declarations with receive. XFAIL in rustc. 2011-03-25 11:01:52 -07:00
Patrick Walton
77a3373d53 rustc: Create a crate metadata cache 2011-03-25 10:44:24 -07:00
Marijn Haverbeke
d4c3059e1e make lexer unicode-aware for strings and char literals 2011-03-25 08:23:00 -07:00
Marijn Haverbeke
a045514477 Start making the standard-lib utf-8 aware
Finally implements _str.is_utf8, adds from_chars, from_char, to_chars,
char_at, char_len, (push|pop|shift|unshift)_char. Also, proper
character I/O for streams.
2011-03-25 08:22:52 -07:00
Marijn Haverbeke
d3b49f5aab fix pretty-printer
A change in 54587bdccb (the vec
appending overhaul) had broken it. (Apparently modifying a vec while
iterating over it can corrupt memory.)
2011-03-25 07:59:13 -07:00
Graydon Hoare
0f9d460e24 Placate win32 build; no idea how it can be working currently on tinderbox. 2011-03-25 00:16:04 -07:00
Lindsey Kuper
bcc104ce79 A first stab at the 'nbody' demo, with support for calling C sqrt(). 2011-03-25 00:15:56 -07:00
Patrick Walton
0b9cf7902c build: Generate an object file for stage0/libstd.dylib 2011-03-24 18:43:32 -07:00
Graydon Hoare
4e49ca8abd Start hooking resolve into creater. 2011-03-24 17:37:32 -07:00
Patrick Walton
af3d0d1848 rustc: Open "use"d crates; add a _vec.vec_from_buf() method along the way; XFAIL use-import-export.rs in rustc 2011-03-24 17:22:07 -07:00
Graydon Hoare
29d853dd19 Remove obsolete Makefiles. 2011-03-24 14:56:51 -07:00
Tim Chevalier
2bd78c176d Improve error message when the lexer sees a bad character 2011-03-24 12:37:12 -07:00
Patrick Walton
c0f66a5240 Add .def.in files that I forgot to stage. Should put out burning tinderboxes on Windows and Darwin. 2011-03-24 12:36:14 -07:00
Patrick Walton
f284c5c1eb Generate the platform-specific .def files at build time 2011-03-24 12:24:22 -07:00
Graydon Hoare
99682db53c Make symbol resolution failures log under rust_log::ERR flag as well. 2011-03-24 12:20:48 -07:00
Graydon Hoare
86f1ace55b Teach creader about reading ty_float, and trim trailing whitespace. 2011-03-24 11:50:45 -07:00
Patrick Walton
f0706d8932 Add trailing semicolons to Linux .def files 2011-03-24 11:50:02 -07:00
Patrick Walton
8c9f5ffc77 Add a Linux .def file. Might put out burning tinderbox. 2011-03-24 11:43:51 -07:00
Patrick Walton
a2b9a7ce8f rustc: Use a .def file for Darwin. Puts out burning Darwin tinderbox. 2011-03-24 11:26:46 -07:00
Patrick Walton
2c21195b21 rustc: Emit a better error message when a type is used where a value was expected 2011-03-24 10:29:15 -07:00
Patrick Walton
8d8a48cfc4 rustc: Don't try to export symbols for crazy architectures from rustllvm.dll. Should unburn the tree on Windows. 2011-03-24 10:29:15 -07:00
Patrick Walton
4c5ab05741 rustc: Switch over to using rustllvm.dll exclusively, ending the "Franken-LLVM" problem 2011-03-23 17:48:53 -07:00
Patrick Walton
41be79acf3 rustllvm: Update rustllvm.def. The old one was missing a lot. 2011-03-23 17:48:01 -07:00
Graydon Hoare
08bea1d9a2 Revert "Change the type of the second argument of upcalls to be a %task*.", breaks win32 build.
This reverts commit dcf122ede0.
2011-03-23 16:31:30 -07:00
Lindsey Kuper
0b63512f4c Support for 'float' in type signatures. 2011-03-23 16:01:29 -07:00
Patrick Walton
c669f20231 rustc: Write out crate metadata 2011-03-23 15:44:17 -07:00
Patrick Walton
c1bc0101ca stdlib: Provide a function to extract the underlying buf_writer from a writer 2011-03-22 17:53:43 -07:00
Tim Chevalier
23e23bd762 Further support for floating-point. Literals with exponents work
and literals with the 'f32' or 'f64' suffixes work as well. In
addition, logging things with the f32 or f64 type works. (float is
still assumed to be a synonym for f64).
2011-03-22 17:31:27 -07:00
Patrick Walton
d56971d5b4 stdlib: Add EBML writing functionality 2011-03-22 17:29:23 -07:00
Patrick Walton
e890383db1 stdlib: Add a convenience method for opening paths as a FILE 2011-03-22 17:29:23 -07:00
Patrick Walton
804771510e Add a test case for empty mutable vector literals, XFAIL'd in rustboot 2011-03-22 16:48:00 -07:00
Patrick Walton
b33f0df152 stdlib: Make writers seekable; switch file writers to the C FILE interface to make this work 2011-03-22 16:40:22 -07:00
Rafael Ávila de Espíndola
dcf122ede0 Change the type of the second argument of upcalls to be a %task*. 2011-03-22 17:50:18 -04:00
Lindsey Kuper
0ce0c4c41a Support for shorter error messages that are aware of objects' cnames. 2011-03-22 14:23:43 -07:00
Patrick Walton
bcf04e253f Revert "Remove usages of case(_) { fail; } since the compiler does this automatically". When we have exhaustiveness checking, "case(_) { fail; }" will be useful to silence warnings.
This reverts commit 92a716d862.
2011-03-22 14:02:52 -07:00
Patrick Walton
6623597c18 lib: Add an EBML reader module 2011-03-22 14:00:27 -07:00
Tim Chevalier
8556b2c1ad Added test case for floats 2011-03-22 09:42:31 -07:00
Brian Anderson
1689d99965 Add some nesting to the else-if test case 2011-03-22 08:11:38 -07:00
Brian Anderson
92a716d862 Remove usages of case(_) { fail; } since the compiler does this automatically 2011-03-22 08:11:34 -07:00
Brian Anderson
530fe1daea Add a cleanup to trans_send. Express further confusion about cleanups in trans_recv 2011-03-22 08:04:53 -07:00
Brian Anderson
0bcf49305c Add test for sending strings over channels 2011-03-22 08:04:51 -07:00
Brian Anderson
cddd8094da Remove a todo from trans_chan that doesn't appear necessary 2011-03-22 08:04:49 -07:00
Brian Anderson
3dcb79dac9 Add a regression test for channels of nil, which happens to work in rustc, but not in rustboot 2011-03-22 08:04:47 -07:00
Brian Anderson
c02cdc32a8 Generalize send/recv to work for more types 2011-03-22 08:04:45 -07:00
Brian Anderson
e20e7995ac Un-XFAIL task-comm-4, 5 & 6 2011-03-22 08:04:43 -07:00
Brian Anderson
39c01c97ba Fix trans_recv 2011-03-22 08:04:41 -07:00
Brian Anderson
b2ee569c23 Implement trans_send and a broken trans_recv 2011-03-22 08:04:39 -07:00
Brian Anderson
261d1e4c61 Add codegen for ports and chans 2011-03-22 08:04:38 -07:00
Graydon Hoare
7ac885ee8c Repair some fallout from pcwalton's last few build changes. 2011-03-21 23:06:42 -07:00
Tim Chevalier
1e1ff638a3 Make floating-point operations work (neg, add, sub, mul, div, rem,
and comparison ops.)
2011-03-21 18:10:34 -07:00
Tim Chevalier
caa22c9341 Started adding support for floating-point type, floating-point literals, and logging of floats. Other operations on float probably don't work yet. 2011-03-21 18:10:34 -07:00
Patrick Walton
0943475f37 Add a suitable .def file for rustrt.dll on Windows 2011-03-21 18:01:25 -07:00
Patrick Walton
e56a1720e4 Add a "last" function to return the last element of a vector to the standard library 2011-03-21 17:21:35 -07:00
Patrick Walton
71de17d38e Add a binding to ftell() 2011-03-21 16:41:18 -07:00
Rafael Ávila de Espíndola
933c01bd15 Every upcall needs a task pointer to find the C stack. It is just that when
handling cdecl call they should skip it when calling the final function.

There is some cleanup to be done on the generated IL, but this gets us
running Hello World for real.
2011-03-21 17:53:11 -04:00
Rafael Ávila de Espíndola
f3057244a6 Make the wrapper function of native functions private. 2011-03-21 16:02:00 -04:00
Rafael Ávila de Espíndola
12e7feb71c The T_taskptr is already included in the n_args, don't add it twice. 2011-03-21 15:15:22 -04:00
Patrick Walton
3dec5b5e50 rustc: Remove uses of Unicode in type deserialization and fix vector-push operations 2011-03-21 12:03:34 -07:00
Patrick Walton
84c0d8638e rustc: Update type serialization and deserialization for the "mutable?" change 2011-03-21 11:44:08 -07:00
Marijn Haverbeke
86d05655b4 rustc: Merge in type serialization and deserialization
Signed-off-by: Patrick Walton <pcwalton@mimiga.net>
2011-03-21 11:35:04 -07:00
Patrick Walton
0366f5ae23 Add some C99 and C++ compatibility headers for MSVC 2011-03-21 10:24:00 -07:00
Rafael Ávila de Espíndola
e687dd5ce7 Make lltaskptr a regular argument element in args in calls to trans_upcall2. 2011-03-21 11:59:14 -04:00
Rafael Ávila de Espíndola
770a49520c Move calls to PtrToInt out of trans_upcall2. 2011-03-21 11:11:22 -04:00
Graydon Hoare
4b946cea35 Modify native_item_fn to handle trailing linkage names that differ from the item name (used in win32 build of std.dll) 2011-03-20 20:18:19 -07:00
Graydon Hoare
0c7545c1ce Switch win32 path_sep to '/', add comment explaining a bit. 2011-03-20 19:43:43 -07:00
Graydon Hoare
460d89156f Add slightly nicer failure message to io.rs when it can't open a file. 2011-03-20 19:43:41 -07:00
Patrick Walton
d31bfc8692 rustc: Internalize glue. Cuts libstd size by 8% or so. 2011-03-20 15:05:13 -07:00
Graydon Hoare
ff22bdfb6e Fix indentation in tidy. 2011-03-19 18:34:46 -07:00
Patrick Walton
277d42f589 rustc: Only declare each native function once. std.rc now links. 2011-03-19 17:33:46 -07:00
Patrick Walton
a1aad28690 rustc: Use the right block context to generate unary operands. std.rc compiles now. For realz. 2011-03-19 15:03:21 -07:00
Patrick Walton
8e597b295f rustc: Allow arguments to be captured as upvars. std.rc compiles now, except for the lack of a main fn. 2011-03-19 14:26:12 -07:00
Patrick Walton
c710c9a1b8 rustc: Do argument casts before loading aggregates, not after 2011-03-19 13:58:48 -07:00
Patrick Walton
3f2bae4449 rustc: Implement int-to-native casts 2011-03-18 18:49:59 -07:00
Patrick Walton
e6b6d1b645 rustc: Make trans_path() generic-safe wrt nullary tags 2011-03-18 18:45:49 -07:00
Patrick Walton
95dc89f012 rustc: Make iter_structural_ty_full() generic-safe wrt tags 2011-03-18 18:34:06 -07:00
Patrick Walton
8c48fae726 rustc: Do pointer casts when casting native types 2011-03-18 18:12:58 -07:00
Patrick Walton
9c0c0af1b2 rustc: Fix inference for auto slots (forgot to stage changes before) 2011-03-18 17:45:47 -07:00
Patrick Walton
082e5a5e5d rustc: Fix inference for auto slots. Add a test case. 2011-03-18 17:43:56 -07:00
Patrick Walton
f3b58947c0 rustc: Don't always build a constant multiply instruction when translating literal vectors; the size of the referent isn't always constant 2011-03-18 16:41:56 -07:00
Patrick Walton
533dea772f rustc: Move type_of() behind the check for dynamic size in trans_vec() 2011-03-18 16:34:22 -07:00
Patrick Walton
78bcfe28f2 rustc: Create global variable constants during the collection phase 2011-03-18 16:24:01 -07:00
Patrick Walton
8ff77b14a9 rustc: Make iter_sequence() work with generic vectors 2011-03-18 16:04:16 -07:00
Patrick Walton
9ad9d3783d rustc: Fix list.foldl() to pass its second argument by alias 2011-03-18 15:19:32 -07:00
Patrick Walton
47d650e25b rustc: Box the tuples returned by hashmap.items() for now since we don't have alias iterators yet 2011-03-18 15:18:45 -07:00
Patrick Walton
ebee49314b rustc: Get type params from the item when translating native items 2011-03-18 15:01:45 -07:00