summary refs log tree commit diff
path: root/src/librustc/driver
AgeCommit message (Collapse)AuthorLines
2014-01-08auto merge of #11370 : alexcrichton/rust/issue-10465, r=pwaltonbors-0/+1
Turned out to be a 2-line fix, but the compiler fallout was huge.
2014-01-07Fixup the rest of the tests in the compilerAlex Crichton-0/+1
2014-01-07Inline reexports in rustdocAlex Crichton-3/+6
If a reexport comes from a non-public module, then the documentation for the reexport will be inlined into the module that exports it, but if the reexport is targeted at a public type (like the prelude), then it is not inlined but rather hyperlinked.
2014-01-06Don't attempt duplicate outputsAlex Crichton-1/+3
This ends up causing weird errors like those seen in #11346 Closes #11346
2014-01-06Disowned the Visitor.Eduard Burtescu-17/+15
2014-01-03auto merge of #11251 : pcwalton/rust/remove-at-mut, r=pcwaltonbors-21/+30
r? @nikomatsakis for the borrow checker changes. Write guards are now eliminated.
2014-01-03librustc: Remove `@mut` support from the typechecker and borrow checkerPatrick Walton-2/+1
2014-01-03librustc: Eliminate an unnecessary `@mut` in pretty printing.Patrick Walton-2/+2
This removes all `@mut` from `librustc` and `libsyntax`.
2014-01-03libsyntax: De-`@mut` `CodeMap::files`Patrick Walton-3/+13
2014-01-03librustc: De-`@mut` all writersPatrick Walton-1/+1
2014-01-03librustc: De-`@mut` (and de-`@`) the pretty printerPatrick Walton-9/+9
2014-01-03librustc: De-`@mut` the span handlerPatrick Walton-3/+3
2014-01-03librustc: De-`@mut` the parse sessionPatrick Walton-1/+1
2014-01-01Add linting for `crate_type` attribute values.a_m0d-5/+14
This ensures that the `crate_type` attribute always contains a value, and does not contain an invalid value.
2014-01-01syntax::diagnostic: Remove unnecessary traitsklutzy-3/+3
This removes trait `handler` and `span_handler`, and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2014-01-01rustc::driver: Remove two @sklutzy-6/+6
2013-12-31Add a --no-analysis command line switchSiegeLord-0/+17
2013-12-31Generate --dep-info earlier in the compillation.SiegeLord-30/+44
2013-12-29Rename pkgid variablesLuis de Bethencourt-5/+5
2013-12-26librustc: De-`@mut` `outputs` in the sessionPatrick Walton-3/+3
2013-12-26librustc: De-`@mut` `building_library` in the sessionPatrick Walton-5/+5
2013-12-26librustc: De-`@mut` `node_id` in the sessionPatrick Walton-4/+4
2013-12-26librustc: De-`@mut` the entry function and entry type in the sessionPatrick Walton-6/+6
2013-12-26librustc: De-`@mut` several instances of `io::Writer`.Patrick Walton-2/+3
There are a few more related to pretty printing.
2013-12-26librustc: De-`@mut` the additional library search pathsPatrick Walton-5/+5
2013-12-26librustc: De-`@mut` the export mapPatrick Walton-2/+1
2013-12-26librustc: De-`@mut` the `reachable` mapPatrick Walton-4/+11
2013-12-26librustc: De-`@mut` `lints` in the sessionPatrick Walton-4/+8
2013-12-26librustc: De-`@mut` `cstore::CStore`Patrick Walton-2/+2
2013-12-25Method-ify CStoreSteven Fackler-2/+3
2013-12-22Allow optional filename argument for --dep-infoAndreas Neuhaus-22/+32
2013-12-20auto merge of #11077 : alexcrichton/rust/crate-id, r=cmrbors-39/+4
Right now the --crate-id and related flags are all process *after* the entire crate is parsed. This is less than desirable when used with makefiles because it means that just to learn the output name of the crate you have to parse the entire crate (unnecessary). This commit changes the behavior to lift the handling of these flags much sooner in the compilation process. This allows us to not have to parse the entire crate and only have to worry about parsing the crate attributes themselves. The related methods have all been updated to take an array of attributes rather than a crate. Additionally, this ceases duplication of the "what output are we producing" logic in order to correctly handle things in the case of --test. Finally, this adds tests for all of this functionality to ensure that it does not regress.
2013-12-20rustc: Improve crate id extractionAlex Crichton-39/+4
Right now the --crate-id and related flags are all process *after* the entire crate is parsed. This is less than desirable when used with makefiles because it means that just to learn the output name of the crate you have to parse the entire crate (unnecessary). This commit changes the behavior to lift the handling of these flags much sooner in the compilation process. This allows us to not have to parse the entire crate and only have to worry about parsing the crate attributes themselves. The related methods have all been updated to take an array of attributes rather than a crate. Additionally, this ceases duplication of the "what output are we producing" logic in order to correctly handle things in the case of --test. Finally, this adds tests for all of this functionality to ensure that it does not regress.
2013-12-19rustc: Optimize reading metadata by 4xAlex Crichton-1/+0
We were previously reading metadata via `ar p`, but as learned from rustdoc awhile back, spawning a process to do something is pretty slow. Turns out LLVM has an Archive class to read archives, but it cannot write archives. This commits adds bindings to the read-only version of the LLVM archive class (with a new type that only has a read() method), and then it uses this class when reading the metadata out of rlibs. When you put this in tandem of not compressing the metadata, reading the metadata is 4x faster than it used to be The timings I got for reading metadata from the respective libraries was: libstd-04ff901e-0.9-pre.dylib => 100ms libstd-04ff901e-0.9-pre.rlib => 23ms librustuv-7945354c-0.9-pre.dylib => 4ms librustuv-7945354c-0.9-pre.rlib => 1ms librustc-5b94a16f-0.9-pre.dylib => 87ms librustc-5b94a16f-0.9-pre.rlib => 35ms libextra-a6ebb16f-0.9-pre.dylib => 63ms libextra-a6ebb16f-0.9-pre.rlib => 15ms libsyntax-2e4c0458-0.9-pre.dylib => 86ms libsyntax-2e4c0458-0.9-pre.rlib => 22ms In order to always take advantage of these faster metadata read-times, I sort the files in filesearch based on whether they have an rlib extension or not (prefer all rlib files first). Overall, this halved the compile time for a `fn main() {}` crate from 0.185s to 0.095s on my system (when preferring dynamic linking). Reading metadata is still the slowest pass of the compiler at 0.035s, but it's getting pretty close to linking at 0.021s! The next best optimization is to just not copy the metadata from LLVM because that's the most expensive part of reading metadata right now.
2013-12-19Add some things to inspect crate-id'sCorey Richardson-3/+50
2013-12-17auto merge of #10979 : alexcrichton/rust/less-bc, r=cmrbors-1/+6
By performing this logic very late in the build process, it ended up leading to bugs like those found in #10973 where certain stages of the build process expected a particular output format which didn't end up being the case. In order to fix this, the build output generation is moved very early in the build process to the absolute first thing in phase 2. Closes #10973
2013-12-16Detect stability attributes on methods.Kiet Tran-1/+1
If it's a trait method, this checks the stability attribute of the method inside the trait definition. Otherwise, it checks the method implementation itself.
2013-12-15Move logic for test output generation forwardAlex Crichton-1/+6
By performing this logic very late in the build process, it ended up leading to bugs like those found in #10973 where certain stages of the build process expected a particular output format which didn't end up being the case. In order to fix this, the build output generation is moved very early in the build process to the absolute first thing in phase 2. Closes #10973
2013-12-13auto merge of #10916 : alexcrichton/rust/nounwind, r=pcwaltonbors-0/+3
When performing LTO, the rust compiler has an opportunity to completely strip all landing pads in all dependent libraries. I've modified the LTO pass to recognize the -Z no-landing-pads option when also running an LTO pass to flag everything in LLVM as nothrow. I've verified that this prevents any and all invoke instructions from being emitted. I believe that this is one of our best options for moving forward with accomodating use-cases where unwinding doesn't really make sense. This will allow libraries to be built with landing pads by default but allow usage of them in contexts where landing pads aren't necessary.
2013-12-13auto merge of #10909 : sanxiyn/rust/coherence, r=alexcrichtonbors-26/+23
Now coherence checking is always done.
2013-12-12Add --dep-info to write Makefile-compatible dependency info.Jack Moffitt-3/+31
When --dep-info is given, rustc will write out a `$input_base.d` file in the output directory that contains Makefile compatible dependency information for use with tools like make and ninja.
2013-12-11Disable all unwinding on -Z no-landing-pads LTOAlex Crichton-0/+3
When performing LTO, the rust compiler has an opportunity to completely strip all landing pads in all dependent libraries. I've modified the LTO pass to recognize the -Z no-landing-pads option when also running an LTO pass to flag everything in LLVM as nothrow. I've verified that this prevents any and all invoke instructions from being emitted. I believe that this is one of our best options for moving forward with accomodating use-cases where unwinding doesn't really make sense. This will allow libraries to be built with landing pads by default but allow usage of them in contexts where landing pads aren't necessary. cc #10780
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-11/+8
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-12-11Remove -Z coherenceSeo Sanghyeon-26/+23
2013-12-09Implement LTOAlex Crichton-6/+34
This commit implements LTO for rust leveraging LLVM's passes. What this means is: * When compiling an rlib, in addition to insdering foo.o into the archive, also insert foo.bc (the LLVM bytecode) of the optimized module. * When the compiler detects the -Z lto option, it will attempt to perform LTO on a staticlib or binary output. The compiler will emit an error if a dylib or rlib output is being generated. * The actual act of performing LTO is as follows: 1. Force all upstream libraries to have an rlib version available. 2. Load the bytecode of each upstream library from the rlib. 3. Link all this bytecode into the current LLVM module (just using llvm apis) 4. Run an internalization pass which internalizes all symbols except those found reachable for the local crate of compilation. 5. Run the LLVM LTO pass manager over this entire module 6a. If assembling an archive, then add all upstream rlibs into the output archive. This ignores all of the object/bitcode/metadata files rust generated and placed inside the rlibs. 6b. If linking a binary, create copies of all upstream rlibs, remove the rust-generated object-file, and then link everything as usual. As I have explained in #10741, this process is excruciatingly slow, so this is *not* turned on by default, and it is also why I have decided to hide it behind a -Z flag for now. The good news is that the binary sizes are about as small as they can be as a result of LTO, so it's definitely working. Closes #10741 Closes #10740
2013-12-09Store metadata separately in rlib filesAlex Crichton-7/+6
Right now whenever an rlib file is linked against, all of the metadata from the rlib is pulled in to the final staticlib or binary. The reason for this is that the metadata is currently stored in a section of the object file. Note that this is intentional for dynamic libraries in order to distribute metadata bundled with static libraries. This commit alters the situation for rlib libraries to instead store the metadata in a separate file in the archive. In doing so, when the archive is passed to the linker, none of the metadata will get pulled into the result executable. Furthermore, the metadata file is skipped when assembling rlibs into an archive. The snag in this implementation comes with multiple output formats. When generating a dylib, the metadata needs to be in the object file, but when generating an rlib this needs to be separate. In order to accomplish this, the metadata variable is inserted into an entirely separate LLVM Module which is then codegen'd into a different location (foo.metadata.o). This is then linked into dynamic libraries and silently ignored for rlib files. While changing how metadata is inserted into archives, I have also stopped compressing metadata when inserted into rlib files. We have wanted to stop compressing metadata, but the sections it creates in object file sections are apparently too large. Thankfully if it's just an arbitrary file it doesn't matter how large it is. I have seen massive reductions in executable sizes, as well as staticlib output sizes (to confirm that this is all working).
2013-12-09auto merge of #10874 : vadimcn/rust/integrated-as, r=alexcrichtonbors-8/+8
Last LLVM update seems to have fixed whatever prevented LLVM integrated assembler from generating correct unwind tables on Windows. This PR switches Windows builds to use internal assembler by default. Compilation via external assembler can still be requested via the newly added `-Z no-integrated-as` option. Closes #8809
2013-12-08Use LLVM integrated assembler on Windows too.Vadim Chugunov-8/+8
2013-12-08Add dead-code warning passKiet Tran-13/+4
2013-12-05Remove unused upcallsAlex Crichton-25/+22
The main one removed is rust_upcall_reset_stack_limit (continuation of #10156), and this also removes the upcall_trace function. The was hidden behind a `-Z trace` flag, but if you attempt to use this now you'll get a linker error because there is no implementation of the 'upcall_trace' function. Due to this no longer working, I decided to remove it entirely from the compiler (I'm also a little unsure on what it did in the first place).