summary refs log tree commit diff
path: root/src/librustc/driver/driver.rs
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-06Disowned the Visitor.Eduard Burtescu-17/+15
2014-01-03auto merge of #11251 : pcwalton/rust/remove-at-mut, r=pcwaltonbors-18/+27
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-1/+1
2014-01-01Add linting for `crate_type` attribute values.a_m0d-1/+1
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-1/+1
This removes trait `handler` and `span_handler`, and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2014-01-01rustc::driver: Remove two @sklutzy-4/+4
2013-12-31Add a --no-analysis command line switchSiegeLord-0/+15
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-2/+2
2013-12-26librustc: De-`@mut` `building_library` in the sessionPatrick Walton-4/+4
2013-12-26librustc: De-`@mut` `node_id` in the sessionPatrick Walton-1/+1
2013-12-26librustc: De-`@mut` the entry function and entry type in the sessionPatrick Walton-3/+3
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-1/+1
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-1/+2
2013-12-26librustc: De-`@mut` `cstore::CStore`Patrick Walton-1/+1
2013-12-25Method-ify CStoreSteven Fackler-2/+3
2013-12-22Allow optional filename argument for --dep-infoAndreas Neuhaus-19/+29
2013-12-20auto merge of #11077 : alexcrichton/rust/crate-id, r=cmrbors-37/+1
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-37/+1
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-2/+46
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-12Add --dep-info to write Makefile-compatible dependency info.Jack Moffitt-3/+28
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-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-09Implement LTOAlex Crichton-6/+4
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/+2
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/+2
2013-12-08Add dead-code warning passKiet Tran-13/+4
2013-12-05Update LLVM and jettison jit supportAlex Crichton-7/+0
LLVM's JIT has been updated numerous times, and we haven't been tracking it at all. The existing LLVM glue code no longer compiles, and the JIT isn't used for anything currently. This also rebases out the FixedStackSegment support which we have added to LLVM. None of this is still in use by the compiler, and there's no need to keep this functionality around inside of LLVM. This is needed to unblock #10708 (where we're tripping an LLVM assertion).
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-2/+2
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-01rustc: filter out empty linker argsPhilipp Brüschweiler-1/+7
This is inspired by a mystifying linker failure when using `pkg-config` to generate the linker args: `pkg-config` produces output that ends in a space, thus resulting in an empty linker argument. Also added some updates to the concerning error messages that helped spotting this bug.
2013-11-29Add generation of static libraries to rustcAlex Crichton-39/+46
This commit implements the support necessary for generating both intermediate and result static rust libraries. This is an implementation of my thoughts in https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html. When compiling a library, we still retain the "lib" option, although now there are "rlib", "staticlib", and "dylib" as options for crate_type (and these are stackable). The idea of "lib" is to generate the "compiler default" instead of having too choose (although all are interchangeable). For now I have left the "complier default" to be a dynamic library for size reasons. Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a dynamic object. I chose this for size reasons, but also because you're probably not going to be embedding the rustc compiler anywhere any time soon. Other than the options outlined above, there are a few defaults/preferences that are now opinionated in the compiler: * If both a .dylib and .rlib are found for a rust library, the compiler will prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option * If generating a "lib", the compiler will generate a dynamic library. This is overridable by explicitly saying what flavor you'd like (rlib, staticlib, dylib). * If no options are passed to the command line, and no crate_type is found in the destination crate, then an executable is generated With this change, you can successfully build a rust program with 0 dynamic dependencies on rust libraries. There is still a dynamic dependency on librustrt, but I plan on removing that in a subsequent commit. This change includes no tests just yet. Our current testing infrastructure/harnesses aren't very amenable to doing flavorful things with linking, so I'm planning on adding a new mode of testing which I believe belongs as a separate commit. Closes #552
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-2/+2
2013-11-26librustc: Remove non-procedure uses of `do` from librustc, librustdoc,Patrick Walton-2/+2
and librustpkg.
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-3/+3
2013-11-22Fix up mingw64 target.Luqman Aden-2/+7
2013-11-13auto merge of #10277 : dcrewi/rust/missing-doc-and-visibility-rules, ↵bors-3/+2
r=alexcrichton Now the privacy pass returns enough information that other passes do not need to duplicate the visibility rules, and the missing_doc implementation is more consistent with other lint checks.