Commit Graph

18509 Commits

Author SHA1 Message Date
Matthijs Hofstra
6cc9a26a2d Replaced calls to external fmin/fmax by a Rust implementation. 2013-05-29 18:26:50 +02:00
bors
e3e55c5c04 auto merge of #6793 : graydon/rust/drop-ast-before-llvm, r=Aatch 2013-05-29 00:52:47 -07:00
bors
149960e0cf auto merge of #6789 : luqmana/rust/compiletest-fix, r=thestinger
Can be removed after a snapshot I believe.
2013-05-28 23:34:48 -07:00
bors
d80642b519 auto merge of #6784 : nikomatsakis/rust/moves-into-borrowck, r=pcwalton
Move the computation of what data is moved out of `liveness` and into `borrowck`. The resulting code is cleaner, since before we had a split distribution of responsibilities, and also this avoids having multiple implementations of the dataflow code. Liveness is still used to report warnings about useless writes. This will go away when we get the control-flow graph code landed (working on that).

Also adds borrow checker documentation.

Fixes #4384.
Required to support once fns and to properly fix closures (#2202).
First step to generalize our treatment of moves somewhat as well.
2013-05-28 22:16:50 -07:00
bors
e946b4fa3f auto merge of #6778 : Aatch/rust/pass-refactor, r=graydon
Refactor the optimization passes to explicitly use the passes. This commit just re-implements the same passes as were already being run.

It also adds an option (behind `-Z`) to run the LLVM lint pass on the unoptimized IR.

This should close #2812. It is also the first step towards #2396

----------------

This is pretty much just an initial "get it out there" PR. With finer control over the optimization passes coming later. I also just blindly copied the passes we were already doing, so there could almost certainly be some more work in paring it down.

The other thing is the addition of the `mergefunctions` pass, which is currently enabled at `--opt-level=3` and does have a small impact on the code size. However the fact that it is at the end of the optimization pipeline is probably not ideal, so some more experimentation is in order.
2013-05-28 21:01:53 -07:00
James Miller
4ad0b8ac58 Remove extraneous defs from export file 2013-05-29 15:15:42 +12:00
bors
e0d6486ed6 auto merge of #6780 : june0cho/rust/issue5984, r=brson
Fix #5984. Also, I found a problem on type inference and left a comment.
2013-05-28 19:58:52 -07:00
James Miller
6861d542a2 Remove now-unused import 2013-05-29 14:16:49 +12:00
James Miller
998e2ce4ff Remove passes that were causing bad optmizations 2013-05-29 14:16:49 +12:00
James Miller
4988c89e86 Move the initial dead prototype removal pass 2013-05-29 14:16:49 +12:00
James Miller
a5b87d71e0 Fix pass creation typo 2013-05-29 14:16:49 +12:00
James Miller
d694e283b3 Refactor optimization pass handling.
Refactor the optimization passes to explicitly use the passes. This commit
just re-implements the same passes as were already being run.

It also adds an option (behind `-Z`) to run the LLVM lint pass on the
unoptimized IR.
2013-05-29 14:16:49 +12:00
bors
c8c60f063f auto merge of #6740 : Aatch/rust/atomic-types, r=brson
This is a follow up to #6732. Makes everything a little more sound.

r? @brson
2013-05-28 18:34:51 -07:00
bors
e3d0c1eb0e auto merge of #6731 : thomaslee/rust/issue-6575, r=pcwalton
Fix for #6575. In the trans phase, rustc emits code for a function parameter that goes completely unused in the event the return type of the function in question happens to be an immediate.

This patch modifies rustc & parts of rustrt to ensure that the vestigial parameter is no longer present in compiled code.
2013-05-28 17:37:57 -07:00
Niko Matsakis
f30b538929 Update documentation for moves 2013-05-28 20:22:15 -04:00
Niko Matsakis
e35db1ab35 Reconcile treatment of &mut with the docs 2013-05-28 20:22:15 -04:00
Niko Matsakis
bf1647c92a Reconcile docs and code, adding examples and adding RESTR_CLAIM 2013-05-28 20:22:15 -04:00
Niko Matsakis
329f7a17e2 Update docs on the formal basis of the borrow checker. 2013-05-28 20:22:15 -04:00
Niko Matsakis
5851d3242c Move checking for moves and initialization of local variables and patterns into
borrow checker and generalize what moves are allowed. Fixes a nasty
bug or two in the pattern move checking code. Unifies dataflow code
used for initialization and other things. First step towards
once fns. Everybody wins.

Fixes #4384. Fixes #4715. cc once fns (#2202), optimizing local moves (#5016).
2013-05-28 20:22:14 -04:00
bors
5676056ae6 auto merge of #6775 : yjh0502/rust/issue_6696, r=catamorphism 2013-05-28 15:40:53 -07:00
Graydon Hoare
b4a3fe25c6 librustc: drop AST before running LLVM, frees 400mb on a librustc build 2013-05-28 15:31:32 -07:00
bors
9a06ff0590 auto merge of #6707 : catamorphism/rust/issue-5543, r=catamorphism 2013-05-28 14:35:00 -07:00
Tim Chevalier
7ad1cc71e3 testsuite: Add main function to issue-5554 test 2013-05-28 13:43:10 -07:00
bors
d7e1f08b21 auto merge of #6774 : alexcrichton/rust/silence-warnings, r=graydon
Also as a bonus this fixes #6767
2013-05-28 13:35:05 -07:00
Alex Crichton
b04c40bb1c Silence various warnings throughout test modules 2013-05-28 15:27:35 -05:00
Luqman Aden
c49e41c42f compiletest: Add #[no_core] to fix check-stage1. 2013-05-28 15:58:35 -04:00
bors
833ed21f87 auto merge of #6786 : thestinger/rust/revert-noalias-mut-rptr, r=nikomatsakis
it can alias `&const` and `@mut`
2013-05-28 10:11:05 -07:00
Daniel Micay
accc5272f8 noalias on all &mut parameters is too coarse
it can alias `&const` and `@mut`
2013-05-28 13:05:50 -04:00
Alex Crichton
8749cb59d8 Fix 'make check-stage1-std' by correcting dependencies 2013-05-28 09:37:38 -05:00
bors
05735a934a auto merge of #6783 : hoelzro/rust/master, r=bstrie
I think settings like this should be left up to the user.
2013-05-28 07:16:59 -07:00
Rob Hoelz
2505416408 Remove colorcolumn setting 2013-05-28 16:06:15 +02:00
bors
c33258bee1 auto merge of #6773 : lkuper/rust/alt-to-match, r=thestinger
RIP `alt`.
2013-05-28 05:07:59 -07:00
bors
24784e8030 auto merge of #6771 : thestinger/rust/highlight, r=luqmana
This works with pandoc linked against highlighting-kate >= 0.5.3.8. It seems to just be a no-op with earlier versions, because I successfully ran this through `try`.

This also fixes some consistency issues (like making `Example`/`Examples` always a header and always using three tildes).
2013-05-28 04:02:02 -07:00
bors
b738b5766e auto merge of #6754 : thestinger/rust/noalias, r=nikomatsakis
The compiler guarantees that there are no other references to a unique pointer when it's passed by-value to a function.

The existence of the header and annihilator don't matter since it's not relevant to the call:

> For a call to the parent function, dependencies between memory references from before or after the call and from those during the call are “irrelevant” to the noalias keyword for the arguments and return value used in that call.

@graydon's tracing garbage collector stores the metadata outside of the boxes, so that won't be a problem. I'm unsure if updating the header while inside a function where it's marked as `noalias` would be a problem anyway since you never actually read or write to the header.

@nikomatsakis: r?
2013-05-28 02:59:03 -07:00
bors
7ee329e97a auto merge of #6770 : lkuper/rust/6762, r=catamorphism 2013-05-28 01:50:03 -07:00
bors
fe7f528e5d auto merge of #6769 : catamorphism/rust/issue-4994, r=thestinger
r? @thestinger As called for in #4994
2013-05-28 00:44:05 -07:00
bors
f7f36a8373 auto merge of #6766 : fdr/rust/time-by-value, r=catamorphism
Per the recommendation of the now-removed FIXME.
2013-05-27 23:41:19 -07:00
bors
6264df5331 auto merge of #6777 : alexcrichton/rust/less-memory, r=graydon
Via my super-accurate timing (`/usr/bin/time -l`), I get 2431119360 => 1884430336 == ~520MB

Closes #6637.
2013-05-27 22:29:09 -07:00
bors
26fb16e36f auto merge of #6776 : graydon/rust/node-type-table-hashmap, r=thestinger
Smallintmap was being populated with sparse keys during ast deserialization.
2013-05-27 21:20:11 -07:00
Jihyun Yu
4521c34775 Fix #6696 2013-05-28 12:35:06 +09:00
bors
6d7d759129 auto merge of #6752 : osaut/rust/tutorial-tasks, r=graydon
* Add a short section and an example illustrating the use of ARC. 
* Header for the section of Future changed to be more descriptive: "Backgrounding computations: Futures".
2013-05-27 20:23:05 -07:00
Alex Crichton
ae7df57c5a Prevent refcount cycles during linting
Shaves off ~600MB of memory while compiling rustc
2013-05-27 22:22:09 -05:00
Graydon Hoare
3c4ce79518 rustc: Switch ty::node_type_table to smallintmap, cut 400mb memory use off a librustc build.
Smallintmap was being populated with sparse keys during ast deserialization.
2013-05-27 19:50:49 -07:00
Tom Lee
b7f71e1ee6 Implementing suggestions from @nikomatsakis 2013-05-27 19:34:25 -07:00
Junyoung Cho
56a2e5dc22 core::vec is missing methods for mutable slices 2013-05-28 10:29:35 +09:00
bors
2061ce9aff auto merge of #6741 : pcwalton/rust/intra-crate-start, r=graydon
r? @brson
2013-05-27 18:26:04 -07:00
Tim Chevalier
351f6033d6 testsuite: Update core to std 2013-05-27 17:32:32 -07:00
Tim Chevalier
403aee1082 testsuite: Test cases, one xfailed, one not 2013-05-27 17:32:32 -07:00
Tim Chevalier
58547d6488 testsuite: Add working test for #5550 2013-05-27 17:32:31 -07:00
Tim Chevalier
6c03fbfefd testsuite: Add passing test for #4735 2013-05-27 17:32:31 -07:00