about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2013-05-27auto merge of #6724 : thestinger/rust/swap_fast, r=thestingerbors-80/+231
Passing higher alignment values gives the optimization passes more freedom since it can copy in larger chunks. This change results in rustc outputting the same post-optimization IR as clang for swaps and most copies excluding the lack of information about padding. Code snippet: ```rust #[inline(never)] fn swap<T>(x: &mut T, y: &mut T) { util::swap(x, y); } ``` Original IR (for `int`): ```llvm define internal fastcc void @_ZN9swap_283417_a71830ca3ed2d65d3_00E(i64*, i64*) #1 { static_allocas: %2 = icmp eq i64* %0, %1 br i1 %2, label %_ZN4util9swap_283717_a71830ca3ed2d65d3_00E.exit, label %3 ; <label>:3 ; preds = %static_allocas %4 = load i64* %0, align 1 %5 = load i64* %1, align 1 store i64 %5, i64* %0, align 1 store i64 %4, i64* %1, align 1 br label %_ZN4util9swap_283717_a71830ca3ed2d65d3_00E.exit _ZN4util9swap_283717_a71830ca3ed2d65d3_00E.exit: ; preds = %3, %static_allocas ret void } ``` After #6710: ```llvm define internal fastcc void @_ZN9swap_283017_a71830ca3ed2d65d3_00E(i64* nocapture, i64* nocapture) #1 { static_allocas: %2 = load i64* %0, align 1 %3 = load i64* %1, align 1 store i64 %3, i64* %0, align 1 store i64 %2, i64* %1, align 1 ret void } ``` After this change: ```llvm define internal fastcc void @_ZN9swap_283017_a71830ca3ed2d65d3_00E(i64* nocapture, i64* nocapture) #1 { static_allocas: %2 = load i64* %0, align 8 %3 = load i64* %1, align 8 store i64 %3, i64* %0, align 8 store i64 %2, i64* %1, align 8 ret void } ``` Another example: ```rust #[inline(never)] fn set<T>(x: &mut T, y: T) { *x = y; } ``` Before, with `(int, int)` (align 1): ```llvm define internal fastcc void @_ZN8set_282517_8fa972e3f9e451983_00E({ i64, i64 }* nocapture, { i64, i64 }* nocapture) #1 { static_allocas: %2 = bitcast { i64, i64 }* %1 to i8* %3 = bitcast { i64, i64 }* %0 to i8* tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %3, i8* %2, i64 16, i32 1, i1 false) ret void } ``` After, with `(int, int)` (align 8): ```llvm define internal fastcc void @_ZN8set_282617_8fa972e3f9e451983_00E({ i64, i64 }* nocapture, { i64, i64 }* nocapture) #1 { static_allocas: %2 = bitcast { i64, i64 }* %1 to i8* %3 = bitcast { i64, i64 }* %0 to i8* tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %3, i8* %2, i64 16, i32 8, i1 false) ret void } ```
2013-05-27fix casts on 32-bitDaniel Micay-2/+2
2013-05-27auto merge of #6715 : Xazax-hun/rust/incoming, r=graydonbors-0/+82
Preliminary implementation for: https://github.com/mozilla/rust/issues/6275 This is my first (non hello world) rust code, so it may not be idiomatic.
2013-05-27auto merge of #6703 : sanxiyn/rust/allocation-lint, r=sanxiynbors-189/+168
Fix #6145. In particular, handle operator overloading.
2013-05-28Remove unnecessary allocations flagged by lintSeo Sanghyeon-161/+161
2013-05-28Use adjustments table for allocation lintSeo Sanghyeon-28/+7
2013-05-27Get rid of no-longer-needed #[doc(hidden)] attributes.Lindsey Kuper-13/+4
There were several old `#[doc(hidden)]` attributes in libstd and libextra, left over from when rustdoc didn't hide private definitions, tagged with `FIXME #3538`. Since #3538 is now closed, I removed the `#[doc(hidden)]` attributes as well as the FIXMEs, but I left `#[doc(hidden)]` in libstd/task/spawn.rs and libstd/task/rt.rs since those two are apparently `pub`, as well as in libextra/std.rc since std/extra is `pub`.
2013-05-27auto merge of #6763 : steveklabnik/rust/core_to_std, r=thestingerbors-20/+20
When I submitted #6748 yesterday, I used the old name. r? @thestinger
2013-05-27Fix docs to use std instead of core.Steve Klabnik-20/+20
When I submitted #6748 yesterday, I used the old name.
2013-05-27Rename unwrap_input/unwrap_output as suggested bygareth-11/+11
@brson. Also fix a few documentation bugs.
2013-05-27Make test_change_working_directory change the currentgareth-3/+5
directory to be the parent of the current-current directory, instead of changing to the tmp directory, which was causing issues with OS X and its /tmp => /private/tmp symlink.
2013-05-27Refactor core::run in order to address many of the issuesgareth-483/+693
mentioned in #2625. This change makes the module more oriented around Process values instead of having to deal with process ids directly. Apart from issues mentioned in #2625, other changes include: - Changing the naming to be more consistent - Process/process is now used instead of a mixture of Program/program and Process/process. - More docs/tests. Some io/scheduler related issues remain (mentioned in #2625).
2013-05-27auto merge of #6688 : graydon/rust/issue-3396-mystery-bug-in-metadata, r=Aatchbors-11/+2
Whatever it was, it is no longer a problem here.
2013-05-27auto merge of #6761 : ILyoan/rust/ctags, r=thestingerbors-3/+1
2013-05-26auto merge of #6719 : kud1ing/rust/rustc_w, r=bstriebors-2/+7
Fixes #6697
2013-05-27update ctags defineILyoan-3/+1
2013-05-26auto merge of #6748 : steveklabnik/rust/bool_docs, r=thestingerbors-19/+194
There was some before, but now we have a big header, as well as lots of individual bits of documentation.
2013-05-26auto merge of #6700 : ben0x539/rust/nestvariantdocs, r=thestingerbors-1/+38
This indents all but the first line of multi-line annotations for individual enum variants with four spaces so that pandoc will recognize everything as belonging to the same list item. Since that introduces `<p>` tags for some list items, I've gone ahead and inserted blank lines after each list item so that consistently get `<p>` tags for all `<li>`s documenting variants. It's a bit less compact now but still tolerable, I think.
2013-05-26Add documentation for libstd/bool.rs.Steve Klabnik-19/+194
There was some before, but now we have a big header, as well as lots of individual bits of documentation.
2013-05-26inline bump_box_refcountDaniel Micay-0/+1
2013-05-26make transmute_copy use memcpy, and inline itDaniel Micay-0/+21
2013-05-26add an align parameter to call_memcpyDaniel Micay-14/+11
2013-05-26use uninit for cast::transmute_copyDaniel Micay-1/+1
2013-05-26add memset32/memset64Daniel Micay-1/+86
2013-05-26C++0x -> C++11Daniel Micay-1/+1
2013-05-26make the memcpy/memmove intrinsics higher-levelDaniel Micay-64/+111
This allows them to make use of the type's alignment, instead of being pessimistic and assuming it is only 1.
2013-05-26auto merge of #6742 : Aatch/rust/mut-noalias, r=thestingerbors-1/+14
This marks `&mut` function arguments with the `noalias` attribute. Since the borrow checker enforces this property, this is worth doing. I'm not sure if the place I'm doing it in is ideal, but it generates the correct code. Closes #6350
2013-05-26rustdoc: properly nest markup within enum variant lists (fixes #6605)Benjamin Herr-1/+38
This indents all but the first line of multi-line annotations for individual enum variants with four spaces so that pandoc will recognize everything as belonging to the same list item. Since that introduces `<p>` tags for some list items, I've gone ahead and inserted blank lines after each list item so that consistently get `<p>` tags for all `<li>`s documenting variants. It's a bit less compact now but still tolerable, I think.
2013-05-26Mark &mut parameters as noaliasJames Miller-1/+14
2013-05-25testsuite: Add a test for listing the root directory...Tim Chevalier-1/+15
...and don't treat Path("/") like Path("").
2013-05-25core: Fail with a better error message when list_dir gets an empty pathTim Chevalier-0/+11
(Yes, this did happen in real life...)
2013-05-25auto merge of #6722 : alexcrichton/rust/issue-4219-no-merge-hack, r=brsonbors-1201/+909
Changes the int/uint modules to all use macros instead of using the `merge` attribute. It would be nice to have #4375 resolved as well for this, but that can probably come at a later date. Closes #4219.
2013-05-25auto merge of #6732 : Aatch/rust/atomic-types, r=brsonbors-0/+344
This pull request is more of an RFC than a finished implementation. It adds some basic atomic types, with an interface modelled off of C++11's atomic types. It also adds free functions that provide a slightly nicer interface for atomic operations, though they are unsafe because there isn't a way to be generic over "word-sized" types. See also #5042
2013-05-25Use an enum for keywords and intern them to improve parser performanceBjörn Steinbrink-245/+280
Currently, keywords are stored in hashsets that are recreated for every Parser instance, which is quite expensive since macro expansion creates lots of them. Additionally, the parser functions that look for a keyword currently accept a string and have a runtime check to validate that they actually received a keyword. By creating an enum for the keywords and inserting them into the ident interner, we can avoid the creation of the hashsets and get static checks for the keywords. For libstd, this cuts the parse+expansion part from ~2.6s to ~1.6s.
2013-05-24auto merge of #6728 : alexcrichton/rust/update-linenoise, r=Aatchbors-19/+211
This updates the bundled linenoise library, and explicitly builds it with UTF8 support. This way rusti correctly handles utf8 characters when doing line operations. Closes #6681
2013-05-25Add basic atomic typesJames Miller-0/+344
2013-05-25Fix compilation errors with linenoiseAlex Crichton-2/+2
2013-05-24auto merge of #6730 : hjr3/rust/exit_code, r=z0w0bors-10/+14
Scripts need to know if the tests pass or the program ran correctly.
2013-05-24auto merge of #6726 : alexcrichton/rust/filter-blocks, r=z0w0bors-1/+18
Among other things, this suppresses a spurious unused import warning in the compiler right now.
2013-05-24Update the linenoise libraryAlex Crichton-19/+211
2013-05-24Actually filter view_items in blocksAlex Crichton-1/+18
2013-05-24Remove the clone function for the methodOlivier Saut-5/+2
2013-05-24Remove the get functionOlivier Saut-29/+22
Rust is now preferring methods over functions and there is no legacy with ARC
2013-05-24Make rust {test, run} exit with appropriate code.Herman J. Radtke III-10/+14
Scripts need to know if the tests pass or the program ran correctly.
2013-05-24Remove the #[merge] hack from the parserAlex Crichton-85/+1
2013-05-24Remove usage of the #[merge] hack with int modulesAlex Crichton-1149/+941
2013-05-24show options for -W help and -WLenny222-2/+7
2013-05-24auto merge of #6680 : ben0x539/rust/slashslashslash, r=graydonbors-2/+9
There's currently a function in the lexer that rejects a line comment that is all slashes from being a doc comment. I think the intention was that you could draw boxes, ///////////// // like so // ///////////// Since a line doc comment split up over multiple paragraphs will have a "blank" line that is just /// between the paragraphs, that would get mistaken for a box segment, lexed as a regular comment, and go missing from the sequence of doc comment attributes before they were reassembled by rustdoc into markdown input. I figure the best plan here is to just declare that a comment that is exactly `///` is a doc comment after all, and to only omit comments with four slashes or more, which is what this commit implements. Can't really draw boxes that narrow, anyway.
2013-05-24Only trigger missing documentation warnings to public functions and fields.Gábor Horváth-14/+25
2013-05-24auto merge of #6712 : thestinger/rust/derive, r=catamorphismbors-24/+2