summary refs log tree commit diff
path: root/src/librustc_driver/lib.rs
AgeCommit message (Collapse)AuthorLines
2019-02-12Stabilize slice_sort_by_cached_keyScott McMurray-1/+0
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-4/+4
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-10rustc: doc commentsAlexander Regueiro-4/+4
2019-02-10Rollup merge of #58345 - RalfJung:2nd-filename, r=matthewjasperGuillaume Gomez-1/+9
When there are multiple filenames, print what got interpreted as filenames I have written code that crafts command lines for rustc, and when I get "multiple input filenames provided" it can be quite hard to figure out where in this long list of arguments the mistake is hiding. Probably I passed an argument to a flag that does not expect an argument, but which flag would that be? This changes the error message to print the first two filenames, to make it easier to debug what is going on.
2019-02-10when there are multiple filenames, print what got interpreted as 2nd filenameRalf Jung-1/+9
2019-02-07Rollup merge of #58185 - GuillaumeGomez:images-url, r=SimonSapinGuillaume Gomez-3/+1
Remove images' url to make it work even without internet connection Needed for local std docs mainly. cc @SimonSapin r? @QuietMisdreavus
2019-02-07Remove images' url to make it work even without internet connectionGuillaume Gomez-3/+1
2019-02-07Auto merge of #58010 - Zoxc:parallel-passes, r=michaelwoeristerbors-0/+1
Move privacy checking later in the pipeline and make some passes run in parallel r? @michaelwoerister
2019-02-06Overhaul `syntax::fold::Folder`.Nicholas Nethercote-4/+5
This commit changes `syntax::fold::Folder` from a functional style (where most methods take a `T` and produce a new `T`) to a more imperative style (where most methods take and modify a `&mut T`), and renames it `syntax::mut_visit::MutVisitor`. The first benefit is speed. The functional style does not require any reallocations, due to the use of `P::map` and `MoveMap::move_{,flat_}map`. However, every field in the AST must be overwritten; even those fields that are unchanged are overwritten with the same value. This causes a lot of unnecessary memory writes. The imperative style reduces instruction counts by 1--3% across a wide range of workloads, particularly incremental workloads. The second benefit is conciseness; the imperative style is usually more concise. E.g. compare the old functional style: ``` fn fold_abc(&mut self, abc: ABC) { ABC { a: fold_a(abc.a), b: fold_b(abc.b), c: abc.c, } } ``` with the imperative style: ``` fn visit_abc(&mut self, ABC { a, b, c: _ }: &mut ABC) { visit_a(a); visit_b(b); } ``` (The reductions get larger in more complex examples.) Overall, the patch removes over 200 lines of code -- even though the new code has more comments -- and a lot of the remaining lines have fewer characters. Some notes: - The old style used methods called `fold_*`. The new style mostly uses methods called `visit_*`, but there are a few methods that map a `T` to something other than a `T`, which are called `flat_map_*` (`T` maps to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s). - `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed `map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to reflect their slightly changed signatures. - Although this commit renames the `fold` module as `mut_visit`, it keeps it in the `fold.rs` file, so as not to confuse git. The next commit will rename the file.
2019-01-30Move privacy checking later in the pipeline and make some passes run in parallelJohn Kåre Alsaker-0/+1
2019-01-26Replace deprecated ATOMIC_INIT constsMark Rousskov-2/+2
2019-01-24Remove quote_*! macros and associated APIsMark Simulacrum-1/+0
2019-01-17Querify glob map usage (last use of CrateAnalysis)Igor Matuszewski-2/+0
2019-01-13Always calculate glob map but only for glob usesIgor Matuszewski-2/+0
Previously calculating glob map was *opt-in*, however it did record node id -> ident use for every use directive. This aims to see if we can unconditionally calculate the glob map and not regress performance.
2019-01-09Auto merge of #56614 - Zoxc:query-perf2, r=michaelwoeristerbors-2/+3
Replace LockCell with atomic types Split from https://github.com/rust-lang/rust/pull/56509 r? @michaelwoerister
2019-01-07Revert "Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton"Matthias Krüger-19/+21
This reverts commit 68614265d312fc2cbe8a696f7dabb9416eb6f221, reversing changes made to cae623c5ce12df8f237264d8f2c31fdaa664c382. Should fix tools on windows. Reopens #57014
2019-01-06Auto merge of #57286 - alexcrichton:less-thin-2-2, r=nikomatsakisbors-8/+1
bootstrap: Link LLVM as a dylib with ThinLTO (take 2) When building a distributed compiler on Linux where we use ThinLTO to create the LLVM shared object this commit switches the compiler to dynamically linking that LLVM artifact instead of statically linking to LLVM. The primary goal here is to reduce CI compile times, avoiding two+ ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll reuse the one ThinLTO step done by LLVM's build itself. Lots of discussion about this change can be found [here] and down. A perf run will show whether this is worth it or not! [here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334 --- This PR previously landed in https://github.com/rust-lang/rust/pull/56944, caused https://github.com/rust-lang/rust/issues/57111, and was reverted in https://github.com/rust-lang/rust/pull/57116. I've added one more commit here which should fix the breakage that we saw.
2019-01-05Auto merge of #57101 - o01eg:fix-57014, r=alexcrichtonbors-21/+19
Search codegen backends based on target libdir instead of sysroot Fixes #57014 Fixes cases with custom libdir when it consists of two or more parts.
2019-01-02Remove now stray commentAlex Crichton-7/+0
2019-01-02Avoid using open_global_nowAlex Crichton-1/+1
2018-12-29Replace LockCell with atomic typesJohn Kåre Alsaker-2/+3
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-25Revert "Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister"kennytm-1/+8
This reverts commit f1051b574c26e20608ff26415a3dddd13f140925, reversing changes made to 833e0b3b8a9f1487a61152ca76f7f74a6b32cc0c.
2018-12-24Search codegen backends based on target libdir instead of sysroot.O01eg-21/+19
Fixes cases with custom libdir when it consists of two or more parts.
2018-12-24Rollup merge of #56986 - alexcrichton:move-jemalloc, r=Mark-SimulacrumMazdak Farrokhzad-8/+0
rustc: Move jemalloc from rustc_driver to rustc This commit moves jemalloc to just the rustc binary rather than the rustc_driver shared library, enusring that it's only used for binaries that opt-in to it like rustc rather than other binaries using librustc_driver like rustdoc/rls/etc. This will hopefully address #56980
2018-12-24Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoeristerMazdak Farrokhzad-8/+1
bootstrap: Link LLVM as a dylib with ThinLTO When building a distributed compiler on Linux where we use ThinLTO to create the LLVM shared object this commit switches the compiler to dynamically linking that LLVM artifact instead of statically linking to LLVM. The primary goal here is to reduce CI compile times, avoiding two+ ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll reuse the one ThinLTO step done by LLVM's build itself. Lots of discussion about this change can be found [here] and down. A perf run will show whether this is worth it or not! [here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334
2018-12-21Auto merge of #56813 - oli-obk:main_🧶, r=pnkfelixbors-62/+5
Always run rustc in a thread cc @ishitatsuyuki @eddyb r? @pnkfelix [Previously](https://github.com/rust-lang/rust/pull/48575) we moved to only producing threads when absolutely necessary. Even before we opted to only create threads in some cases, which [is unsound](https://github.com/rust-lang/rust/pull/48575#issuecomment-380635967) due to the way we use thread local storage.
2018-12-19rustc: Move jemalloc from rustc_driver to rustcAlex Crichton-8/+0
This commit moves jemalloc to just the rustc binary rather than the rustc_driver shared library, enusring that it's only used for binaries that opt-in to it like rustc rather than other binaries using librustc_driver like rustdoc/rls/etc. This will hopefully address #56980
2018-12-19Auto merge of #56601 - Zoxc:lifetime-killer, r=nikomatsakisbors-1/+0
Make the 'a lifetime on TyCtxt useless cc @rust-lang/compiler r? @nikomatsakis
2018-12-18Remove now stray commentAlex Crichton-7/+0
2018-12-18Avoid using open_global_nowAlex Crichton-1/+1
2018-12-14Remove dead codeOliver Scherer-1/+0
2018-12-14Always run rustc in a threadOliver Scherer-61/+5
2018-12-13Make the 'a lifetime on TyCtxt uselessJohn Kåre Alsaker-1/+0
2018-12-12Remove `Session::sysroot()`.Nicholas Nethercote-1/+1
Instead of maybe storing its own sysroot and maybe deferring to the one in `Session::opts`, just clone the latter when necessary so one is always directly available. This removes the need for the getter.
2018-12-06codegen_utils, driver: fix clippy errorsljedrz-2/+2
2018-12-04updates all Filename variants to take a fingerprintMatthew Russo-1/+1
2018-12-03Bump stack size to 32MBOliver Scherer-3/+5
2018-12-02Auto merge of #56198 - bjorn3:cg_ssa_refactor, r=eddybbors-1/+0
Refactor rustc_codegen_ssa cc #56108 (not all things are done yet) This removes an unsafe method from cg_ssa. r? @eddyb cc @sunfishcode
2018-11-30proc_macro: introduce a "bridge" between clients (proc macros) and servers ↵Eduard-Mihai Burtescu-1/+1
(compiler front-ends).
2018-11-29Remove __build_diagnostic_array! from cg_utilsbjorn3-1/+0
2018-11-13fix various typos in doc commentsAndy Russell-2/+2
2018-11-07Rollup merge of #55495 - wesleywiser:opt_fuel_rustbuild, r=nikomatsakiskennytm-1/+1
Don't print opt fuel messages to stdout because it breaks Rustbuild Rustbuild passes `--message-format json` to the compiler invocations which causes JSON to be emitted on stdout. Printing optimization fuel messages to stdout breaks the json and causes Rustbuild to fail. Work around this by emitting optimization fuel related messages on stderr instead.
2018-11-02Use `jemalloc-sys` on Linux and OSX compilersAlex Crichton-0/+8
This commit adds opt-in support to the compiler to link to `jemalloc` in the compiler. When activated the compiler will depend on `jemalloc-sys`, instruct jemalloc to unprefix its symbols, and then link to it. The feature is activated by default on Linux/OSX compilers for x86_64/i686 platforms, and it's not enabled anywhere else for now. We may be able to opt-in other platforms in the future! Also note that the opt-in only happens on CI, it's otherwise unconditionally turned off by default. Closes #36963
2018-10-29Don't print opt fuel messages to stdout because it breaks RustbuildWesley Wiser-1/+1
Rustbuild passes `--message-format json` to the compiler invocations which causes JSON to be emitted on stdout. Printing optimization fuel messages to stdout breaks the json and causes Rustbuild to fail. Work around this by emitting optimization fuel related messages on stderr instead.
2018-10-15Auto merge of #55008 - ljedrz:cleanup_rustc_driver, r=estebankbors-101/+73
Cleanup rustc/driver - improve/remove allocations - simplify `profile::trace::cons*` - don't sort `base` if it only has one element - use `Cow<str>` where applicable - use `unwrap_or_else` with function calls - remove an explicit `return`, add an explicit `None` - remove lifetimes from `const`s - improve common patterns - improve macro calls - whitespace & formatting fixes
2018-10-13rustc/driver: whitespace & formatting fixesljedrz-24/+20
2018-10-13rustc/driver: remove explicit return, add explicit Noneljedrz-1/+1
2018-10-13rustc/driver: remove lifetimes from constsljedrz-15/+8
2018-10-13rustc/driver: improve common patternsljedrz-38/+23