Commit Graph

15419 Commits

Author SHA1 Message Date
Chris Peterson
665e900ede encapsulate isaac RNG in rust_rng struct 2013-02-14 22:31:08 -08:00
Chris Peterson
f4320b6195 move isaac RNG utility functions to new rust_rng.cpp file 2013-02-14 22:30:27 -08:00
Chris Peterson
c531506385 rt: rand.rs expects rust_next() to return uint32_t, not size_t 2013-02-14 22:29:21 -08:00
bors
172c29fe0a auto merge of #4941 : nickdesaulniers/rust/issue4524cleanup, r=catamorphism
review? @brson
Issue #4524
2013-02-14 21:12:06 -08:00
bors
e87e4eb0cb auto merge of #4940 : hansjorg/rust/manpage_06, r=catamorphism
Updated the rustc manpage based on the usage message for 0.6 (including -Z options). Also added an example showing how to compile with debug info.

This targets incoming rather than master. #4936 can be closed.
2013-02-14 20:24:32 -08:00
bors
5a9da65dc9 auto merge of #4937 : luqmana/rust/remove-mut-addr-of, r=catamorphism 2013-02-14 19:16:07 -08:00
Luqman Aden
206757f868 libcore: replace mut_addr_of properly on mac 2013-02-14 18:36:10 -08:00
Luqman Aden
cc89029942 libcore: Remove ptr::mut_addr_of since &mut is coerced to *mut 2013-02-14 18:36:10 -08:00
bors
20fd0c53ed auto merge of #4938 : thestinger/rust/no_zero, r=brson
I removed the unused wrappers methods named `calloc` because they relied on the malloc wrapper having a `bool zero = true` default parameter (which resulted in some accidental zeroing). Perhaps wrapping the actual calloc function would be useful, but I don't know of an existing use case that could use it so I just removed these.

This gives an ~1% performance improvement for TreeMap, which does a lot of small allocations. Vectors use `realloc` which didn't zero before these changes so there's no measurable change in performance.
2013-02-14 18:27:54 -08:00
Nick Desaulniers
13fe167dbb remove die definition and use in doc tests 2013-02-14 17:33:16 -08:00
bors
af2f0ef088 auto merge of #4927 : sanxiyn/rust/remove-dvec, r=catamorphism 2013-02-14 17:23:18 -08:00
bors
bf27352953 auto merge of #4911 : lifthrasiir/rust/comment-exemptions, r=catamorphism
This is a natural extension of #4887, and handles the following three cases:

~~~~
a line with only /s
////////////////////////////////////////////

a line with only /s followed by whitespace
////////////////////////////////////////////         

a block comment with only *s between two /s
/********************************/
~~~~
2013-02-14 16:34:38 -08:00
hansjorg
afe73ccad9 Update manpage based on current usage message 2013-02-15 01:29:14 +01:00
bors
3c07d037cd auto merge of #4934 : nickdesaulniers/rust/issue4524cleanup, r=brson
review? @brson
Issue #4524
2013-02-14 15:37:48 -08:00
Daniel Micay
1a41b484bf rm the unused calloc wrapper from memory_region
it doesn't actually call calloc, so it's fairly pointless
2013-02-14 18:28:04 -05:00
Daniel Micay
2e0614750c get rid of unused exchange_alloc calloc method
this isn't actually calloc - it calls the malloc wrapper which no
longer zeroes
2013-02-14 18:24:52 -05:00
Daniel Micay
f2f4edd8a7 fix bug in uv_ll tests uncovered by not zeroing 2013-02-14 17:47:15 -05:00
bors
03743ee449 auto merge of #4932 : pcwalton/rust/implflipping, r=pcwalton
...lflipping
2013-02-14 14:46:49 -08:00
Patrick Walton
9143688197 librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
Nick Desaulniers
4699ac67c6 Remove all final references to die! 2013-02-14 13:09:09 -08:00
Daniel Micay
7103ca95ac rm unused zero param in C++ exchange allocator 2013-02-14 16:04:30 -05:00
Daniel Micay
22e88d510f stop zeroing all exchange allocations 2013-02-14 15:59:15 -05:00
bors
8ec6f43d6c auto merge of #4931 : thestinger/rust/glue, r=pcwalton
Using `noinline` causes a 3-10% hit in performance for most compiled Rust code. For the TreeMap it's ~15% and that's where I first noticed it.

Removing the noinline attribute doesn't slow down unoptimized builds, but it does significantly increase the time spent in LLVM passes for optimized builds. The improved speed of the compiler actually improves compile-times when optimization is off.

However, the reason for the increase is because more optimization is being done - I'm sure it would speed up compiles to mark *everything* with noinline, but it wouldn't be a good idea.

LLVM is clever enough with the inlining heuristics that this doesn't cause a notable increase in code size - some code becomes a bit bigger, some becomes a bit smaller. There are some cases where it's able to strip out a ton of code thanks to inlining.

I tried out `optsize` for glue code instead but it caused the same hit for LLVM passes in the compile time and the compiled code was a bit slower than just trusting LLVM to make the decisions.

* [TIME_PASSES=1 benchmarks](http://ompldr.org/vaGdxaA) (showing the performance increase in `rustc` and also the extra time spent in LLVM passes for more optimization)
2013-02-14 12:06:27 -08:00
Daniel Micay
762ce323c0 stop applying noinline to glue code 2013-02-14 14:48:34 -05:00
Patrick Walton
e8f36d5ea0 librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 11:47:00 -08:00
bors
36edd25639 auto merge of #4925 : cpeterso/rust/docs-impl-trait-for-type, r=pcwalton
Replace `impl Type: Trait` with `impl Trait for Type` throughout tutorial and manual.
2013-02-14 10:22:34 -08:00
bors
f06f68d634 auto merge of #4915 : luqmana/rust/rt-cleanup, r=pcwalton
Closes #1190.

Also, got rid of `rust_ptr_eq` since it isn't used any as well the `RUST_REFCOUNTED` macros.

Fixes #2667: alignment & wrong structure.
2013-02-14 09:38:05 -08:00
bors
6366e74fe3 auto merge of #4910 : pcwalton/rust/num-simplification, r=pcwalton
Sadly I could not use trait inheritance due to a type parameter substitution
bug.

r? @brson
2013-02-14 08:59:41 -08:00
Patrick Walton
216e85fadf libcore: Move the numeric operations out of Num. r=brson
Sadly I could not use trait inheritance due to a type parameter substitution
bug.
2013-02-14 08:14:01 -08:00
Seo Sanghyeon
26697c371d Remove DVec from workcache 2013-02-14 23:12:12 +09:00
Seo Sanghyeon
9324f497b2 Remove DVec from json 2013-02-14 22:51:01 +09:00
Seo Sanghyeon
ae38935ff3 Remove DVec from check_const 2013-02-14 22:36:56 +09:00
Seo Sanghyeon
7a6db3f982 Remove DVec from syntax::parse 2013-02-14 22:14:59 +09:00
Chris Peterson
5a4695d407 update tutorial and manual to use new impl Trait for Type syntax 2013-02-13 23:19:27 -08:00
bors
6efa3543a8 auto merge of #4922 : jbclements/rust/add-deriving-eq-to-asts, r=catamorphism
r?

Apply deriving_eq to the data structures in ast.rs, and get rid of the custom definitions of eq that were everywhere. resulting ast.rs is about 400 lines shorter.

Also: add a few test cases and a bunch of comments.

Also: change ast_ty_to_ty_cache to use node ids rather than ast::ty's. I believe this was a suggestion related to my changes, and it appears to pass all tests.

Also: tiny doc fix, remove references to crate keywords.
2013-02-13 18:49:29 -08:00
Kang Seonghoon
5336bf6add made licenseck.py work for year substitutions 2013-02-14 11:20:40 +09:00
bors
0ae74bef18 auto merge of #4905 : brson/rust/issue4524, r=brson
Rebase of #4895
2013-02-13 17:11:08 -08:00
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -08:00
bors
c51ecc3223 auto merge of #4884 : pcwalton/rust/pretty-print-new-impl-syntax, r=pcwalton
r? @brson
2013-02-13 15:49:01 -08:00
John Clements
f9d789fa08 cleanup, fix test case 2013-02-13 15:38:42 -08:00
Patrick Walton
754718c910 libsyntax: Pretty print using the new impl syntax. r=brson 2013-02-13 15:23:48 -08:00
bors
d5bf3b85d1 auto merge of #4908 : bstrie/rust/rimov3, r=pcwalton
This patch finishes removing inner vector mutability from the vast majority of the compiler. Exceptions:

* core::dvec: ideally this entire type will be able to be replaced by `~[]`, but Niko asked me to hold off on removing Dvecs until he makes some fixes to borrowed pointers. 
* liveness: liveness.rs is an impenetrable neutron star of deprecated semantics.
* compile-fail: I'm not sure if a lot of these tests are testing inner mutability or mutability in general. I figure that RIMOVing this folder should wait until this syntax is removed from the parser.

I also took this chance to remove many of the inner-mutability-related functions from core::vec, or as many uses of those functions as possible where still necessary. consume_mut and append_mut have been axed. cast_to_mut and cast_from_mut are still needed in a few places.
2013-02-13 15:09:07 -08:00
John Clements
9d962d8466 add test case 2013-02-13 15:08:27 -08:00
John Clements
ded95d2c28 deriving_eq for tokens and binops
Note that the replaced definition of equality on tokens
contains a *huge* shortcut on INTERPOLATED tokens (those
that contain ASTs), whereby any two INTERPOLATED tokens
are considered equal. This seems like a really broken
notion of equality, but it appears that the existing
test cases and the compiler don't depend on it. Niko
noticed this, BTW.

Replace long definition of Eq on tokens and binops
w
2013-02-13 15:08:27 -08:00
John Clements
16da4e15af use node_id for indexing in ast_to_ty_cache 2013-02-13 15:08:27 -08:00
John Clements
0419e36b76 finish deriving_eq in ast 2013-02-13 15:08:27 -08:00
John Clements
819c6d1c04 deriving-eq all over ast 2013-02-13 15:08:27 -08:00
John Clements
17d3a55362 @mut fix 2013-02-13 15:08:27 -08:00
John Clements
25c4676dfa Commenting, test cases, cleanup 2013-02-13 15:08:27 -08:00
John Clements
6d09fc2cd8 removed reference to crate file keywords 2013-02-13 15:08:26 -08:00