Commit Graph

20107 Commits

Author SHA1 Message Date
Tim Chevalier 563172a73b rustpkg: Address review comments from cmr 2013-07-13 13:48:55 -07:00
Tim Chevalier 1a46afb3be rustpkg: Implement `uninstall` and `list` commands 2013-07-13 13:36:50 -07:00
Ted Horst f2ecf18a8e remove new man pages on make uninstall 2013-07-13 13:56:08 -05:00
bors 8d0feb58e7 auto merge of #7763 : dotdash/rust/empty_blocks, r=pcwalton
These commits remove a bunch of empty or otherwise unnecessary blocks, reducing the size of the pre-optimization IR and improving its readability. `librustc.ll` created with `--passes ""` shrinks by about 120k lines which equals about 5% of the total size.
2013-07-13 11:07:31 -07:00
Björn Steinbrink e56b3691c8 Use concrete types in glue functions
We used to have concrete types in glue functions, but the way we used
to implement that broke inlining of those functions. To fix that, we
converted all glue to just take an i8* and always casted to that type.

The problem with the old implementation was that we made a wrong
assumption about the glue functions, taking it for granted that they
always take an i8*, because that's the function type expected by the
TyDesc fields. Therefore, we always ended up with some kind of cast.

But actually, we can initially have the glue with concrete types and
only cast the functions to the generic type once we actually emit the
TyDesc data.

That means that for glue calls that can be statically resolved, we don't
need any casts, unless the glue uses a simplified type. In that case we
cast the argument. And for glue calls that are resolved at runtime, we
cast the argument to i8*, because that's what the glue function in the
TyDesc expects.

Since most of out glue calls are static, this saves a lot of bitcasts.
The size of the unoptimized librustc.ll goes down by 240k lines.
2013-07-13 18:23:08 +02:00
bors 48bfb90865 auto merge of #7775 : poiru/rust/issue-7653, r=huonw
This closes #7653.
2013-07-13 08:55:34 -07:00
Birunthan Mohanathas 9735f339fe Add CONTRIBUTING.md and RELEASES.txt to release tarball. Closes #7561. 2013-07-13 16:57:01 +03:00
Birunthan Mohanathas 948334f333 Add print! and println! macros. Closes #7653. 2013-07-13 16:30:31 +03:00
bors 403cdd84a4 auto merge of #7765 : blake2-ppc/rust/ord-default-methods, r=huonw
Rust will allow to supply default methods for all four methods, but we
don't have any nice error reporting for the case where at least one
method must be implemented, but it's arbitrary which.

So in this case, we require `lt`, but allow implementing the others if needed.
2013-07-13 06:01:31 -07:00
Björn Steinbrink 1d2e1a9ae5 Avoid empty "else" blocks
If an "if" expression has no "else", we don't have to create an LLVM
basic block either.
2013-07-13 13:33:48 +02:00
Björn Steinbrink 5df2bb1bcc Avoid empty "static_allocas" blocks
When there are no allocas, we don't need a block for them.
2013-07-13 13:33:48 +02:00
Björn Steinbrink dcd5d14e6c Avoid return blocks that have only a single predecessor
Currently, we always create a dedicated "return" basic block, but when
there's only a single predecessor for that block, it can be merged with
that predecessor. We can achieve that merge by only creating the return
block on demand, avoiding its creation when its not required.

Reduces the pre-optimization size of librustc.ll created with --passes ""
by about 90k lines which equals about 4%.
2013-07-13 13:33:48 +02:00
Daniel Micay a9eb868230 Merge pull request #7735 from blake2-ppc/dlist
dlist: Use DoubleEndedIterator
2013-07-13 01:24:36 -07:00
Alex Crichton 48aa18d26a Squirrel away the JIT contexts into TLS when done
This prevents attempting to run deallocated code (which is no longer present
always)
2013-07-12 23:16:50 -07:00
bors d582eeb1ec auto merge of #7734 : alexcrichton/rust/issue-3395, r=sanxiyn
Also ends up fixing one case in libstd. 

Closes #3395
2013-07-12 21:40:36 -07:00
blake2-ppc 36f20423c3 cmp: Use default methods in trait Ord, only require Ord::lt
It will be simpler to implement only one method for Ord, while we also
allow implementing all four Ord methods for semantics or performance
reasons.

We only supply three default methods (and not four), because don't have
any nice error reporting for the case where at least one method must be
implemented, but it's arbitrary which.
2013-07-13 06:23:38 +02:00
blake2-ppc c095a5c6cb dlist: Use a DoubleEndedIterator for .mut_iter() and .mut_rev_iter()
Unify the mutable iterators too. Switch the ListInsertion trait to use
method .insert_next() and .peek_next() for list mutation. .insert_next()
inserts an element into the list that will not appear in iteration, of
course; so the length of the iteration can not change during iteration.
2013-07-13 04:31:13 +02:00
blake2-ppc e1d5d1c049 dlist: Use DoubleEndedIterator for .consume_rev_iter() 2013-07-13 04:31:13 +02:00
blake2-ppc 89a0c99dbe dlist: Implement DoubleEndedIterator and use for .iter() and .rev_iter() 2013-07-13 04:31:05 +02:00
blake2-ppc c6e7890e13 dlist: Fix bug in DList::merge
Did not properly allow runs from the `other` list to be merged in. The
test case was using a wrong expected value.

Edited docs for merge so they explain more clearly what it does.

Also make sure insert_ordered is marked pub.
2013-07-13 04:30:15 +02:00
bors d2cf292594 auto merge of #7742 : chris-morgan/rust/delimitmate-support, r=cmr
When it's a lifetime, a single quotation mark shouldn't have a matching
single quotation mark inserted after it, as delimitMate does by default.

Note that this is not without problems; a char literal coming after an
odd number of lifetime markers will have its quotation marks behave a
little strangely. That, however, is not my fault, but delimitMate's:
https://github.com/Raimondi/delimitMate/issues/135
2013-07-12 19:17:01 -07:00
bors 1ee54a8617 auto merge of #7725 : msullivan/rust/default-methods, r=pcwalton
r?
2013-07-12 17:28:28 -07:00
bors 96453eb5c5 auto merge of #7736 : thestinger/rust/doc, r=thestinger
2b96408 r=sanxiyn

documents conversion, size hints and double-ended iterators and adds
more of the traits to the prelude
2013-07-12 13:34:29 -07:00
Alex Crichton 9b21bf45e9 Account for possible 0-sized elements in vector iterators
Closes #7733
2013-07-12 16:13:57 -04:00
Alex Crichton 1ec06e0124 Remove the global 'vec::to_owned' function 2013-07-12 16:13:51 -04:00
bors 5cc4e5145d auto merge of #7730 : chris-morgan/rust/bitv-eq_vec-bool, r=cmr
Fixes #7711.
2013-07-12 11:37:35 -07:00
bors 4e1292ad6b auto merge of #7728 : bcully/rust/largestack64, r=cmr
Just to get the ball rolling, this patch sets stacks to 4 MB on >32-bit architectures.
2013-07-12 09:40:36 -07:00
bors 96b3163c83 auto merge of #7717 : dotdash/rust/transmute, r=pcwalton
Currently, immediate values are copied into an alloca only to have an
addressable storage so that it can be used with memcpy. Obviously we
can skip the memcpy in this case.
2013-07-12 07:43:38 -07:00
Chris Morgan 5b656cfbcb Replace owned with borrowed pointer.
As pointed out by cmr, there's no need for it to be owned there.
That was also in the original scope of #7711.
2013-07-12 23:17:59 +10:00
bors ad708139fe auto merge of #7706 : sanxiyn/rust/qualification-lint, r=pcwalton
Fix #2551.

Lint is off by default because I didn't bother to fix all of std and extra.
2013-07-12 05:46:42 -07:00
bors f67935257b auto merge of #7696 : glinscott/rust/utf8_perf, r=cmr
Moves multibyte code to it's own function to make char_range_at
easier to inline, and faster for single and multibyte chars.

Benchmarked reading example.json 100 times, 1.18s before, 1.08s
after.

Also, optimize str::is_utf8 for the single and multibyte case
Before:
is_utf8_ascii:          272.355162 ms
is_utf8_multibyte:      167.337334 ms

After:
is_utf8_ascii:          218.088049 ms
is_utf8_multibyte:      134.836722 ms
2013-07-12 03:46:41 -07:00
bors d56c9762a3 auto merge of #7705 : sanxiyn/rust/simd-op, r=cmr
Fix #3499.

This is the other half of #5841 that was left out when I revised it to #6214.
2013-07-12 01:49:45 -07:00
bors 09394774df auto merge of #7695 : cmr/rust/assert_eq_msg, r=pnkfelix
This changes it from 

```
left: true does not equal right: false
```

to

```
assertion failed: `(left == right) && (right == left)` (left: `true`, right: `false`)
```
2013-07-11 23:43:45 -07:00
Daniel Micay cc4baac891 Merge pull request #7679 from alexcrichton/consume-smallintmap
Add a `consume` method to SmallIntMap
2013-07-11 23:40:51 -07:00
Chris Morgan 4f67ed535b Fix problem with switching between Rust buffers.
This was also causing trouble if one didn't have delimitMate installed.
2013-07-12 16:18:48 +10:00
Daniel Micay 2b96408600 extend the iterator tutorial
documents conversion, size hints and double-ended iterators and adds
more of the traits to the prelude
2013-07-12 01:53:50 -04:00
Chris Morgan 184fa42d33 Vim syntax: support lifetimes with delimitMate.
When it's a lifetime, a single quotation mark shouldn't have a matching
single quotation mark inserted after it, as delimitMate does by default.

Note that this is not without problems; a char literal coming after an
odd number of lifetime markers will have its quotation marks behave a
little strangely. That, however, is not my fault, but delimitMate's:
https://github.com/Raimondi/delimitMate/issues/135
2013-07-12 15:30:51 +10:00
bors 07183ea6e7 auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwalton
cc #6004 and #3273

This is a rewrite of TLS to get towards not requiring `@` when using task local storage. Most of the rewrite is straightforward, although there are two caveats:

1. Changing `local_set` to not require `@` is blocked on #7673
2. The code in `local_pop` is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it...

The public-facing interface currently hasn't changed, although it will have to change because `local_data::get` cannot return `Option<T>`, nor can it return `Option<&T>` (the lifetime isn't known). This will have to be changed to be given a closure which yield `&T` (or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when `@` is fully removed.

This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).
2013-07-11 19:52:37 -07:00
Alex Crichton 2cd9d7bc88 Expand ctypes warnings to warn about *int/*uint
Also ends up fixing one case in libstd
2013-07-11 19:45:25 -07:00
Alex Crichton 0af64ae315 Add a `consume` method to SmallIntMap 2013-07-11 19:20:46 -07:00
Alex Crichton a15c1b4464 Fix tests 2013-07-11 18:57:19 -07:00
bors 9a9c84fb83 auto merge of #7688 : nikomatsakis/rust/issue-6298-dataflow-graph, r=graydon
This patch is a step towards #6298. It extracts the graph abstraction from region inference into a library, and then ports the region inference to use it. It also adds a control-flow graph abstraction that will eventually be used by dataflow. The CFG code is not yet used, but I figured better to add it so as to make later rebasing etc easier.
2013-07-11 17:52:40 -07:00
Chris Morgan b8e95c4602 Make Bitv::eq_vec take ~[bool] rather than ~[uint]
Fixes #7711.
2013-07-12 09:52:49 +10:00
bors 4478ded57c auto merge of #7623 : graydon/rust/codegen-compiletests, r=pcwalton
This is some initial sketch-work for #7461 though it will depend on #7459 to be useful for anything. For the time being, just infrastructure.
2013-07-11 15:55:45 -07:00
Michael Sullivan 3fa5203273 Take default methods out from behind the flag. 2013-07-11 15:51:10 -07:00
Michael Sullivan 19446418bc Drop a now unnecessary argument from maybe_instantiate_inline. 2013-07-11 15:51:10 -07:00
Michael Sullivan 186f6faf1e Get cross crate static default methods working. Closes #7569. 2013-07-11 15:51:10 -07:00
Michael Sullivan 1bbb434880 Get static default methods working in the non-cross-crate case. Work on #7569. 2013-07-11 15:51:09 -07:00
Michael Sullivan 2b89b437fb Normalize self types for monomorphization. 2013-07-11 15:51:09 -07:00
Michael Sullivan 82ae2fa93a Clean up Repr impls a bit so we can add generic impls for @ and ~. 2013-07-11 15:51:09 -07:00