summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2019-07-18Only error about MSVC + PGO + unwind if we're generating codeWesley Wiser-2/+5
When `rustc` is invoked with the `--print` argument, we don't actually generate any code (unless it's the `native-static-libs` option). So we don't need to error our in this case since there's no risk of generating either LLVM assertions or corrupted binaries.
2019-07-02Auto merge of #61268 - michaelwoerister:stabilize-pgo, r=alexcrichtonbors-18/+17
Stabilize support for Profile-guided Optimization This PR makes profile-guided optimization available via the `-C profile-generate` / `-C profile-use` pair of commandline flags and adds end-user documentation for the feature to the [rustc book](https://doc.rust-lang.org/rustc/). The PR thus ticks the last two remaining checkboxes of the [stabilization tracking issue](https://github.com/rust-lang/rust/issues/59913). From the tracking issue: > Profile-guided optimization (PGO) is a common optimization technique for ahead-of-time compilers. It works by collecting data about a program's typical execution (e.g. probability of branches taken, typical runtime values of variables, etc) and then uses this information during program optimization for things like inlining decisions, machine code layout, or indirect call promotion. If you are curious about how this can be used, there is a rendered version of the documentation this PR adds available [here]( https://github.com/michaelwoerister/rust/blob/stabilize-pgo/src/doc/rustc/src/profile-guided-optimization.md). r? @alexcrichton cc @rust-lang/compiler
2019-06-25Rollup merge of #62055 - matthewjasper:fix-error-counting, r=pnkfelixMazdak Farrokhzad-9/+6
Fix error counting Count duplicate errors for `track_errors` and other error counting checks. Add FIXMEs to make it clear that we should be moving away from this kind of logic. Closes #61663
2019-06-22Prefer to use `has_errors` to `err_count`Matthew Jasper-9/+6
2019-06-21Remove warnings about incr. comp. generating less debugging output.Michael Woerister-18/+2
2019-06-21Stabilize profile-guided optimization.Michael Woerister-18/+17
2019-06-16Fix tidyVadim Petrochenkov-2/+0
2019-06-16Separate librustc modulechansuke-708/+707
2019-06-11Auto merge of #61741 - Centril:rollup-fgro5kz, r=Centrilbors-2/+6
Rollup of 11 pull requests Successful merges: - #61518 (Add loops to doc list of things not stable in const fn) - #61526 (move some tests into subfolders) - #61550 (Windows 10 SDK is also required now.) - #61606 (Remove some legacy proc macro flavors) - #61652 (Mention slice patterns in array) - #61686 (librustc_errors: Add some more documentation) - #61698 (typeck: Fix const generic in repeat param ICE.) - #61707 (Azure: retry failed awscli installs) - #61715 (make sure make_ascii_lowercase actually leaves upper-case non-ASCII characters alone) - #61724 (core: use memcmp optimization for 128 bit integer slices) - #61726 (Use `for_each` in `Iterator::partition`) Failed merges: r? @ghost
2019-06-11rustc: deny(unused_lifetimes).Eduard-Mihai Burtescu-1/+1
2019-06-10Address review commentsPhilipp Hansch-2/+2
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-06-10librustc_errors: Add some more documentationPhilipp Hansch-2/+6
2019-06-05librustc_errors: Rename AnnotateRs -> AnnotateSnippetPhilipp Hansch-5/+5
The proper name of the library is `annotate-snippet`, not `annotate-rs`, this commit should get rid of any confusing `AnnotateRs` names. 1. Renames `annotate_rs_emitter.rs` to `annotate_snippet_emitter_writer.rs` so that the difference between the `Emitter` trait and the implementers is more clear. 2. Renames `AnnotateRsEmitterWriter` to `AnnotateSnippetEmitterWriter` 3. Renames `HumanReadableErrorType::AnnotateRs` to `HumanReadableErrorType::AnnotateSnippet`
2019-06-04Add new error-format value to use annotate-snippet outputPhilipp Hansch-14/+35
2019-05-31rustc_codegen_utils: add new mangling scheme implementation.Eduard-Mihai Burtescu-3/+35
2019-05-30Auto merge of #61005 - michaelwoerister:error-pgo-windows-unwind, r=zackmdavisbors-0/+12
Emit error when trying to use PGO in conjunction with unwinding on Windows. This PR makes `rustc` emit an error when trying use PGO in conjunction with `-Cpanic=unwind` on Windows, isn't supported by LLVM yet. The error messages points to https://github.com/rust-lang/rust/issues/61002, which documents this known limitation.
2019-05-29rustc_codegen_llvm: remove LLVM instruction count stats.Eduard-Mihai Burtescu-19/+0
2019-05-28Rename PgoGenerate to something more general.Michael Woerister-17/+19
2019-05-28Allow to specify profiling data output directory as -Zself-profile argument.Michael Woerister-4/+14
2019-05-28Emit error when trying to use PGO in conjunction with unwinding on Windows.Michael Woerister-0/+12
2019-05-27Fix unit test after pgo-use change.Michael Woerister-1/+1
2019-05-27PGO: Check that pgo-use file actually exists. LLVM seems to only emit an ↵Michael Woerister-0/+9
easy-to-overlook warning otherwise.
2019-05-27Use a PathBuf instead of String for representing the pgo-use path internally.Michael Woerister-2/+2
2019-05-27Avoid unnecessary internings.Nicholas Nethercote-10/+9
Most involving `Symbol::intern` on string literals.
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-6/+6
2019-05-16Rollup merge of #60769 - ehuss:rustc-cli-docs, r=steveklabnikMazdak Farrokhzad-2/+1
Update rustc book CLI docs. This adds a little detail (and missing flags) to the rustc book. There is still a lot of information missing, but this seemed like a good step to expanding it.
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-1/+2
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-1/+2
2019-05-12Update rustc book CLI docs.Eric Huss-2/+1
2019-05-08Optimize HIR mapJohn Kåre Alsaker-3/+0
2019-05-07rustc: rename -Z emit-directives to -Z emit-artifact-notifications and ↵Eduard-Mihai Burtescu-2/+2
simplify the output.
2019-05-05Add commentsvarkor-0/+9
2019-05-05Fix argument alias handling for -g and -C debuginfovarkor-3/+8
2019-05-05Fix argument alias handling for -O and -C opt-levelvarkor-3/+8
2019-05-03Update help messageChristopher Vittal-1/+1
2019-05-02Remove BorrowckMode::CompareChristopher Vittal-4/+0
2019-04-29Auto merge of #60006 - nnethercote:json-for-pipelining, r=alexcrichtonbors-3/+3
In JSON output, emit a directive after metadata is generated. To implement pipelining, Cargo needs to know when metadata generation is finished. This is done via a new JSON "directive". Unfortunately, metadata file writing currently occurs very late during compilation, so pipelining won't produce a speed-up. Moving metadata file writing earlier will be a follow-up. r? @alexcrichton
2019-04-30In JSON output, emit a directive after metadata is generated.Nicholas Nethercote-0/+2
To implement pipelining, Cargo needs to know when metadata generation is finished. This commit adds code to do that. Unfortunately, metadata file writing currently occurs very late during compilation, so pipelining won't produce a speed-up. Moving metadata file writing earlier will be a follow-up. The change involves splitting the existing `Emitter::emit` method in two: `Emitter::emit_diagnostic` and `Emitter::emit_directive`. The JSON directives look like this: ``` {"directive":"metadata file written: liba.rmeta"} ``` The functionality is behind the `-Z emit-directives` option, and also requires `--error-format=json`.
2019-04-28Rollup merge of #60347 - JohnTitor:remove-flags, r=matthewjasperMazdak Farrokhzad-4/+0
Remove `-Z two-phase-borrows` and `-Z two-phase-beyond-autoref` fixes #60331
2019-04-28Rollup merge of #60270 - alexcrichton:metadata-multi-cgu, r=oli-obkMazdak Farrokhzad-3/+2
rustc: Flag metadata compatible with multiple CGUs It looks like the `OutputType::Metadata` kind in the compiler was misclassified in #38571 long ago by accident as incompatible with codegen units and a single output file. This means that if you emit both a linkable artifact and metadata it silently turns off multiple codegen units unintentionally! This commit corrects the situation to ensure that if `--emit metadata` is used it doesn't implicitly disable multiple codegen units. This will ensure we don't accidentally regress compiler performance when striving to implement pipelined compilation!
2019-04-28Remove two-phase-beyond-autorefYuki OKUSHI-2/+0
2019-04-28Remove two-phase-borrowsYuki OKUSHI-2/+0
2019-04-26Remove unused `DiagnosticOutput::Emitter` variant.Nicholas Nethercote-3/+1
2019-04-25ignore-tidy-filelength on all files with greater than 3000 linesvarkor-0/+2
2019-04-25rustc: Flag metadata compatible with multiple CGUsAlex Crichton-3/+2
It looks like the `OutputType::Metadata` kind in the compiler was misclassified in #38571 long ago by accident as incompatible with codegen units and a single output file. This means that if you emit both a linkable artifact and metadata it silently turns off multiple codegen units unintentionally! This commit corrects the situation to ensure that if `--emit metadata` is used it doesn't implicitly disable multiple codegen units. This will ensure we don't accidentally regress compiler performance when striving to implement pipelined compilation!
2019-04-22Remove double trailing newlinesvarkor-1/+0
2019-04-21Enable migrate mode by default on the 2015 editionMatthew Jasper-15/+2
This also fully stabilizes two-phase borrows on all editions
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/+3