about summary refs log tree commit diff
path: root/src/librustc/session/mod.rs
AgeCommit message (Collapse)AuthorLines
2019-04-19Rollup merge of #60045 - estebank:suggest-std, r=petrochenkovMazdak Farrokhzad-0/+5
Suggest appropriate path when calling associated item on bare types When looking at the documentation for `std::f32` or `std::str`, for example, it is easy to get confused and assume `std::f32` and `f32` are the same thing. Because of this, it is not uncommon to attempt writing `f32::consts::PI` instead of the correct `std::f32::consts::PI`. When encountering the former, which results in an access error due to it being an inexistent path, try to access the same path under `std`. If this succeeds, this information is stored for later tweaking of the final E0599 to provide an appropriate suggestion. Fix #26760, fix #46660.
2019-04-18Suggest appropriate path when calling associated item on bare typesEsteban Küber-0/+5
When looking at the documentation for `std::f32` or `std::str`, for example, it is easy to get confused and assume `std::f32` and `f32` are the same thing. Because of this, it is not uncommon to attempt writing `f32::consts::PI` instead of the correct `std::f32::consts::PI`. When encountering the former, which results in an access error due to it being an inexistent path, try to access the same path under `std`. If this succeeds, this information is stored for later tweaking of the final E0599 to provide an appropriate suggestion. This suggestion applies to both E0233 and E0599 and is only checked when the first ident of a path corresponds to a primitive type.
2019-04-18Implement event filtering for self-profiler.Michael Woerister-1/+1
2019-04-17Rollup merge of #59128 - oli-obk:colorful_json, r=mark-i-m,eddybMazdak Farrokhzad-32/+33
Emit ansi color codes in the `rendered` field of json diagnostics cc @ljedrz Implemented for https://github.com/rust-lang/rust/pull/56595#issuecomment-447645115 (x.py clippy)
2019-04-12Use measureme in self-profilerWesley Wiser-9/+17
Related to #58372 Related to #58967
2019-04-09Do not render ascii colors to buffersOliver Scherer-2/+2
2019-04-09Make trait_methods_not_found use a lockJohn Kåre Alsaker-2/+2
2019-04-02Rename `colorful-json` to `json-rendered` and make it a selection instead of ↵Oliver Scherer-39/+33
a bool
2019-04-02Emit ansi color codes in the `rendered` field of json diagnosticsOliver Scherer-7/+14
2019-04-01Rollup merge of #58507 - Zoxc:time-extended, r=michaelwoeristerMazdak Farrokhzad-0/+3
Add a -Z time option which prints only passes which runs once This ensures `-Z time-passes` fits on my screen =P r? @michaelwoerister
2019-03-20Add a -Z time option which prints only passes which runs onceJohn Kåre Alsaker-0/+3
2019-03-15Elide object safety errors on non-existent trait functionEsteban Küber-0/+4
Fix #58734.
2019-03-10Make the rustc driver and interface demand drivenJohn Kåre Alsaker-14/+4
2019-03-06Make `-Z treat-err-as-bug` take a number of errors to be emittedEsteban Küber-2/+2
`-Z treat-err-as-bug=0` will cause `rustc` to panic after the first error is reported. `-Z treat-err-as-bug=2` will cause `rustc` to panic after 3 errors have been reported.
2019-03-03Remove profiler output and replace with a raw event dumpWesley Wiser-4/+1
Related to #58372
2019-03-03Wrap the self-profiler in an `Arc<Mutex<>>`Wesley Wiser-24/+22
This will allow us to send it across threads and measure things like LLVM time.
2019-03-01Add support for using a jobserver with RayonJohn Kåre Alsaker-27/+3
2019-02-28Introduce rustc_interface and move some methods thereJohn Kåre Alsaker-43/+66
2019-02-14Rollup merge of #58378 - alexcrichton:incremental-lto, r=michaelwoeristerMazdak Farrokhzad-15/+1
rustc: Implement incremental "fat" LTO Currently the compiler will produce an error if both incremental compilation and full fat LTO is requested. With recent changes and the advent of incremental ThinLTO, however, all the hard work is already done for us and it's actually not too bad to remove this error! This commit updates the codegen backend to allow incremental full fat LTO. The semantics are that the input modules to LTO are all produce incrementally, but the final LTO step is always done unconditionally regardless of whether the inputs changed or not. The only real incremental win we could have here is if zero of the input modules changed, but that's so rare it's unlikely to be worthwhile to implement such a code path. cc #57968 cc rust-lang/cargo#6643
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-2/+2
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Rollup merge of #58057 - michaelwoerister:stabilize-xlto, r=alexcrichtonMazdak Farrokhzad-1/+1
Stabilize linker-plugin based LTO (aka cross-language LTO) This PR stabilizes [linker plugin based LTO](https://github.com/rust-lang/rust/issues/49879), also known as "cross-language LTO" because it allows for doing inlining and other optimizations across language boundaries in mixed Rust/C/C++ projects. As described in the tracking issue, it works by making `rustc` emit LLVM bitcode instead of machine code, the same as `clang` does. A linker with the proper plugin (like LLD) can then run (Thin)LTO across all modules. The feature has been implemented over a number of pull requests and there are various [codegen](https://github.com/rust-lang/rust/blob/master/src/test/codegen/no-dllimport-w-cross-lang-lto.rs) and [run](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-clang)-[make](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs) [tests](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto) that make sure that it keeps working. It also works for building big projects like [Firefox](https://treeherder.mozilla.org/#/jobs?repo=try&revision=2ce2d5ddcea6fbff790503eac406954e469b2f5d). The PR makes the feature available under the `-C linker-plugin-lto` flag. As discussed in the tracking issue it is not cross-language specific and also not LLD specific. `-C linker-plugin-lto` is descriptive of what it does. If someone has a better name, let me know `:)`
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-2/+2
2019-02-12Stabilize linker-plugin based LTO.Michael Woerister-1/+1
2019-02-12rustc: Implement incremental "fat" LTOAlex Crichton-15/+1
Currently the compiler will produce an error if both incremental compilation and full fat LTO is requested. With recent changes and the advent of incremental ThinLTO, however, all the hard work is already done for us and it's actually not too bad to remove this error! This commit updates the codegen backend to allow incremental full fat LTO. The semantics are that the input modules to LTO are all produce incrementally, but the final LTO step is always done unconditionally regardless of whether the inputs changed or not. The only real incremental win we could have here is if zero of the input modules changed, but that's so rare it's unlikely to be worthwhile to implement such a code path. cc #57968 cc rust-lang/cargo#6643
2019-02-10rustc: doc commentsAlexander Regueiro-15/+15
2019-02-07Auto merge of #58010 - Zoxc:parallel-passes, r=michaelwoeristerbors-2/+2
Move privacy checking later in the pipeline and make some passes run in parallel r? @michaelwoerister
2019-02-05move librustc to 2018Mark Mansi-14/+14
2019-01-30Move privacy checking later in the pipeline and make some passes run in parallelJohn Kåre Alsaker-2/+2
2019-01-28Use multiple threads by default. Limits tests to one thread. Do some renaming.John Kåre Alsaker-6/+6
2019-01-26remove `_with_applicability` from suggestion fnsAndy Russell-1/+1
2019-01-15Querify entry_fnIgor Matuszewski-4/+0
2019-01-14Rollup merge of #57570 - Xanewok:querify-some, r=ZoxcMazdak Farrokhzad-4/+0
Querify local `plugin_registrar_fn` and `proc_macro_decls_static` Instead of calculating them as part of the `Session`, we do that in the query system. It's also nice that these queries are already defined for external crates - here, we provide the queries for the local crate. r? @nikomatsakis
2019-01-14Parallelize and optimize parts of HIR map creationJohn Kåre Alsaker-0/+3
2019-01-13Querify local plugin_registrar_fnIgor Matuszewski-2/+0
2019-01-13Querify local proc_macro_decls_staticIgor Matuszewski-2/+0
2019-01-09Auto merge of #56614 - Zoxc:query-perf2, r=michaelwoeristerbors-19/+28
Replace LockCell with atomic types Split from https://github.com/rust-lang/rust/pull/56509 r? @michaelwoerister
2018-12-30Add `-Z instrument-mcount`Jun Wu-1/+8
This flag inserts `mcount` function call to the beginning of every function after inline processing. So tracing tools like uftrace [1] (or ftrace for Linux kernel modules) have a chance to examine function calls. It is similar to the `-pg` flag provided by gcc or clang, but without generating a `__gmon_start__` function for executables. If a program runs without being traced, no `gmon.out` will be written to disk. Under the hood, it simply adds `"instrument-function-entry-inlined"="mcount"` attribute to every function. The `post-inline-ee-instrument` LLVM pass does the actual job. [1]: https://github.com/namhyung/uftrace
2018-12-29Create a struct for optimization fuel dataJohn Kåre Alsaker-30/+26
2018-12-29Replace LockCell with atomic typesJohn Kåre Alsaker-16/+29
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-17Tweak query code for performanceJohn Kåre Alsaker-3/+17
2018-12-12Avoid regenerating the `Vec<PathBuf>` in `FileSearch::search()`.Nicholas Nethercote-1/+18
`FileSearch::search()` traverses one or more directories. For each directory it generates a `Vec<PathBuf>` containing one element per file in that directory. In some benchmarks this occurs enough that the allocations done for the `PathBuf`s are significant, and in practice a small number of directories are being traversed over and over again. For example, when compiling the `tokio-webpush-simple` benchmark, two directories are traversed 58 times each. Each of these directories have more than 100 files. This commit changes things so that all the `Vec<PathBuf>`s that will be needed by a `Session` are precomputed when that `Session` is created; they are stored in `SearchPath`. `FileSearch` gets a reference to the necessary `SearchPath`s. This reduces instruction counts on several benchmarks by 1--5%. The commit also removes the barely-used `visited_dirs` hash in `for_each_lib_searchPath`. It only detects if `tlib_path` is the same as one of the previously seen paths, which is unlikely.
2018-12-12Remove `Session::sysroot()`.Nicholas Nethercote-16/+8
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-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-05Don't print the profiling summary to stdout when -Zprofile-json is setWesley Wiser-1/+1
cc rust-lang-nursery/rustc-perf#299
2018-11-30proc_macro: introduce a "bridge" between clients (proc macros) and servers ↵Eduard-Mihai Burtescu-4/+4
(compiler front-ends).
2018-11-22Disable the self-profiler unless the `-Z self-profile` flag is setWesley Wiser-2/+4
Related to #51648
2018-11-21rustc: implement and use Default on more types.Eduard-Mihai Burtescu-1/+1
2018-11-12Make `NodeId` a `newtype_index` to enable niche optimizationsOliver Scherer-2/+2
2018-11-11rustc: Clean up allocator injection logicAlex Crichton-2/+0
This commit cleans up allocator injection logic found in the compiler around selecting the global allocator. It turns out that now that jemalloc is gone the compiler never actually injects anything! This means that basically everything around loading crates here and there can be easily pruned. This also removes the `exe_allocation_crate` option from custom target specs as it's no longer used by the compiler anywhere.