Commit Graph

20239 Commits

Author SHA1 Message Date
bors
68a32aad1a auto merge of #7716 : kballard/rust/term-attr, r=cmr
Teach `extra::term` to support more terminal attributes than just color.

Fix the compiler diagnostic messages to print in bold instead of bright white. This matches Clang's output.

Cache the term::Terminal instead of re-parsing for every diagnostic (fixes #6827).
2013-07-14 15:55:20 -07:00
Kevin Ballard
1d4c3146f5 Don't re-parse terminfo (twice!) on every compiler diagnostic
Stuff the term::Terminal into TLS to avoid re-parsing for every single
message we want to color.

Fixes #6827.
2013-07-14 15:01:50 -07:00
Kevin Ballard
69da380844 Highlight rustc's warnings/errors in bold instead of bright white
Clang actually highlights using bold, not using bright white. Match
clang on this so our diagnostics are still readable on terminals with a
white background.
2013-07-14 14:37:29 -07:00
Kevin Ballard
690495de03 term: Add new function .attr() to toggle terminal attributes
Also add .supports_attr() to test for attribute support without writing
anything to output.

Update .reset() to use sgr0 instead of op.
2013-07-14 14:37:29 -07:00
Kevin Ballard
7d8a0fdb7d Give term.fg() and term.bg() a bool return value 2013-07-14 14:37:29 -07:00
bors
4f333023e9 auto merge of #7790 : blake2-ppc/rust/dlist-ringbuf-small-changes, r=thestinger
Implement size_hint for the ringbuf iterators.

Do small cleanups in dlist, use Option's .map and .map_mut properly, and put inline on all the small methods.
2013-07-14 14:13:21 -07:00
blake2-ppc
961184f852 dlist: Use inline on very small functions and iterator functions 2013-07-14 23:03:54 +02:00
blake2-ppc
7681cf62e3 dlist: Simplify by using Option::{map, map_mut}
These methods were fixed or just added so they can now be used.
2013-07-14 22:59:15 +02:00
blake2-ppc
9ccf443088 ringbuf: Implement .size_hint() for iterators 2013-07-14 22:30:22 +02:00
bors
0cb1ac0f9f auto merge of #7788 : MarkJr94/rust/from_iter, r=cmr
Added Iterators for HashMap/Set, TreeMap/Set, TrieMap/Set, and PriorityQueue as per Issue #7626
2013-07-14 12:01:22 -07:00
bors
1c35ab322f auto merge of #7751 : alexcrichton/rust/finish-tls, r=pcwalton
This changes the interface to `get`, and it also changes the keys to be static slices instead of static functions.

This allows the removal of the `unsafe` interface because while functions can monomorphize from different types to the same actual function, static slices cannot do this.

From at least what I can tell, we don't need to worry about LLVM coalescing these addresses. If we ever use the `unnamed_addr` it looks like there's cause for worry, but there doesn't appear to be any coalescing atm.
2013-07-14 10:19:21 -07:00
=Mark Sinclair
bbe03da9c6 Stripped trailing spaces; Implemented FromIterator for TreeMap and PriorityQueue 2013-07-14 13:18:50 -04:00
Alex Crichton
9fd2ac7428 Make TLS keys actually take up space
If the TLS key is 0-sized, then the linux linker is apparently smart enough to
put everything at the same pointer. OSX on the other hand, will reserve some
space for all of them. To get around this, the TLS key now actuall consumes
space to ensure that it gets a unique pointer
2013-07-14 10:15:07 -07:00
Alex Crichton
e3211fa1f1 Purge the last remnants of the old TLS api
Closes #3273
2013-07-14 09:29:12 -07:00
Alex Crichton
242606c793 Clean up various warnings throughout the codebase 2013-07-14 09:29:12 -07:00
Alex Crichton
23fbe936bf Allow non-uppercase-statics by default
I think of this as a stylistic opinion which shouldn't necessarily be enforced
by default on all users of rust, but that's just my opinion.
2013-07-14 09:29:12 -07:00
=Mark Sinclair
bb6615d43a Implemented FromIterator for TrieMap and TrieSet 2013-07-14 12:20:48 -04:00
=Mark Sinclair
4ff7ef434f Implemented FromIterator for std::hashmap 2013-07-14 11:26:03 -04:00
bors
66e2857253 auto merge of #7781 : dotdash/rust/glue, r=huonw
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-14 05:55:22 -07:00
bors
51cb98443c auto merge of #7779 : kballard/rust/print-macro-args, r=alexcrichton
The new names make it obvious that these generate formatted output.

Add a one-argument case that uses %? to format, just like the other
format-using macros (e.g. info!()).
2013-07-14 04:13:24 -07:00
bors
c3e3090ac2 auto merge of #7778 : tedhorst/rust/manuninstall, r=cmr
The new man pages: rust.1, rustdoc.1, rusti.1, and rustpkg.1 were not being removed with make uninstall.
2013-07-14 02:31:26 -07:00
bors
0ef837519d auto merge of #7768 : sfackler/rust/containers, r=huonw
See #4989. I didn't add Persistent{Set,Map} since the only
persistent data structure is fun_treemap and its functionality is
currently too limited to build a trait out of.
2013-07-14 00:49:29 -07:00
bors
247ad4515d auto merge of #7769 : alexcrichton/rust/issue-7732-fix-rusti-again, r=cmr
Turns out this was a more subtle bug than I originally thought. My analysis can be found in #7732, but I also tried to put descriptive info into the comments.

Closes #7732
2013-07-13 23:07:31 -07:00
Alex Crichton
21d7098427 Fix running code via '-Z jit' 2013-07-13 21:25:17 -07:00
Alex Crichton
6148c1c0c5 When running rusti, consume the JIT contexts and collect them in the parent task 2013-07-13 21:25:17 -07:00
bors
b937af17c9 auto merge of #7776 : poiru/rust/issue-7561, r=cmr
This closes #7561.
2013-07-13 21:22:32 -07:00
Steven Fackler
0e882f2bbd Un-broke benchmarks 2013-07-13 20:30:05 -07:00
Steven Fackler
6b37b5bab7 Split mutable methods out of Set and Map
Fixes most of #4989. I didn't add Persistent{Set,Map} since the only
persistent data structure is fun_treemap and its functionality is
currently too limited to build a trait out of.
2013-07-13 19:44:36 -07:00
Daniel Micay
a1f4843895 Merge pull request #7749 from catamorphism/rustpkg-list-uninstall
rustpkg: Implement `uninstall` and `list` commands
2013-07-13 19:18:22 -07:00
Kevin Ballard
3b0258916d Rename print!()/println!() to printf!()/printfln!()
The new names make it obvious that these generate formatted output.

Add a one-argument case that uses %? to format, just like the other
format-using macros (e.g. info!()).
2013-07-13 14:33:41 -07:00
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