Commit Graph

2003 Commits

Author SHA1 Message Date
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
Tim Chevalier
d64b72f6ec More statement-to-expression edits 2011-04-04 17:35:10 -07:00
Lindsey Kuper
5de3f441d0 A trivial documentation commit. 2011-04-04 17:29:49 -07:00
Tim Chevalier
512bba264e Change 'statement' to 'expression' in a bunch of places 2011-04-04 17:02:31 -07:00
Graydon Hoare
70e5457d7c Make box prefix operator and box type carry mutability flag. 2011-04-04 15:44:15 -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
f6763efb02 Gitignore the recommended build directory 2011-04-02 21:31:55 -04: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
8b211f4782 added Mac .DS_Store directory to .gitignore 2011-04-01 11:27:32 -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