summary refs log tree commit diff
path: root/src/librustc_session/session.rs
AgeCommit message (Collapse)AuthorLines
2020-05-30Rollup merge of #72669 - petrochenkov:smclean, r=Mark-SimulacrumRalf Jung-40/+15
rustc_session: Cleanup session creation Noticed while reviewing https://github.com/rust-lang/rust/pull/72618.
2020-05-28standardize limit comparisons with `Limit` typeDavid Wood-6/+48
This commit introduces a `Limit` type which is used to ensure that all comparisons against limits within the compiler are consistent (which can result in ICEs if they aren't). Signed-off-by: David Wood <david@davidtw.co>
2020-05-27rustc_session: Cleanup session creationVadim Petrochenkov-40/+15
2020-05-22Use `OnceCell` instead of `Once`Dylan MacKenzie-16/+39
2020-05-18Implement AST lowering for asm!Amanieu d'Antras-0/+16
2020-05-17Auto merge of #72248 - petrochenkov:codemodel, r=Amanieubors-1/+6
Cleanup and document `-C code-model` r? @Amanieu
2020-05-16rustc_target: Stop using "string typing" for code modelsVadim Petrochenkov-1/+6
Introduce `enum CodeModel` instead.
2020-05-14Consistently use LLVM lifetime markers during codegenTomasz Miąsko-0/+10
Ensure that inliner inserts lifetime markers if they have been emitted during codegen. Otherwise if allocas from inlined functions are merged together, lifetime markers from one function might invalidate load & stores performed by the other one.
2020-05-11Rollup merge of #72067 - jonas-schievink:fuel-warn, r=varkorDylan DPC-1/+1
Emit a warning when optimization fuel runs out `eprintln!` gets swallowed by Cargo too easily.
2020-05-10Emit a warning when optimization fuel runs outJonas Schievink-1/+1
`eprintln!` gets swallowed by Cargo too easily.
2020-05-10Auto merge of #71775 - petrochenkov:crtcfg, r=matthewjasperbors-8/+3
Enable `cfg` predicate for `target_feature = "crt-static"` only if the target supports it That's what all other `target_feature`s do.
2020-05-05Rollup merge of #69984 - lenary:lenary/force-uwtables, r=hanna-kruppeDylan DPC-0/+44
Add Option to Force Unwind Tables When panic != unwind, `nounwind` is added to all functions for a target. This can cause issues when a panic happens with RUST_BACKTRACE=1, as there needs to be a way to reconstruct the backtrace. There are three possible sources of this information: forcing frame pointers (for which an option exists already), debug info (for which an option exists), or unwind tables. Especially for embedded devices, forcing frame pointers can have code size overheads (RISC-V sees ~10% overheads, ARM sees ~2-3% overheads). In production code, it can be the case that debug info is not kept, so it is useful to provide this third option, unwind tables, that users can use to reconstruct the call stack. Reconstructing this stack is harder than with frame pointers, but it is still possible. --- This came up in discussion on #69890, and turned out to be a fairly simple addition. r? @hanna-kruppe
2020-05-04Add Option to Force Unwind TablesSam Elliott-0/+44
When panic != unwind, `nounwind` is added to all functions for a target. This can cause issues when a panic happens with RUST_BACKTRACE=1, as there needs to be a way to reconstruct the backtrace. There are three possible sources of this information: forcing frame pointers (for which an option exists already), debug info (for which an option exists), or unwind tables. Especially for embedded devices, forcing frame pointers can have code size overheads (RISC-V sees ~10% overheads, ARM sees ~2-3% overheads). In code, it can be the case that debug info is not kept, so it is useful to provide this third option, unwind tables, that users can use to reconstruct the call stack. Reconstructing this stack is harder than with frame pointers, but it is still possible. This commit adds a compiler option which allows a user to force the addition of unwind tables. Unwind tables cannot be disabled on targets that require them for correctness, or when using `-C panic=unwind`.
2020-05-03Auto merge of #71631 - RalfJung:miri-unleash-the-gates, r=oli-obkbors-1/+47
Miri: unleash all feature gates IMO it is silly to unleash features that do not even have a feature gate yet, but not unleash features that do. The only thing this achieves is making unleashed mode annoying to use as we have to figure out the feature flags to enable (and not always do the error messages say what that flag is). Given that the point of `-Z unleash-the-miri-inside-of-you` is to debug the Miri internals, I see no good reason for this extra hurdle. I cannot imagine a situation where we'd use that flag, realize the program also requires some feature gate, and then be like "oh I guess if this feature is unstable I will do something else". Instead, we'll always just add that flag to the code as well, so requiring the flag achieves nothing. r? @oli-obk @ecstatic-morse Fixes https://github.com/rust-lang/rust/issues/71630
2020-05-03fmtRalf Jung-1/+1
2020-05-03warn about each skipped feature gateRalf Jung-21/+27
2020-05-03Enable `cfg` predicate for `target_feature = "crt-static"` only if the ↵Vadim Petrochenkov-8/+3
target supports it
2020-05-02fix miri-unleash delayed sanity checkingRalf Jung-9/+14
2020-05-02make sure the miri-unleash-flag is not used to circumvent feature gatesRalf Jung-1/+36
2020-05-02cleanup: `config::CrateType` -> `CrateType`Vadim Petrochenkov-6/+6
2020-04-29Remove Session::no_landing_pads()Amanieu d'Antras-3/+0
2020-04-29Remove -Z no-landing-pads flagAmanieu d'Antras-1/+1
2020-04-26rustc_target: Stop using "string typing" for TLS modelsVadim Petrochenkov-1/+5
Introduce `enum TlsModel` instead.
2020-04-26rustc_target: Stop using "string typing" for relocation modelsVadim Petrochenkov-1/+5
Introduce `enum RelocModel` instead.
2020-04-19Replace uses of `parse_opt_*` with `parse_*` where possible.Nicholas Nethercote-4/+4
This lets us specify the default at the options declaration point, instead of using `.unwrap(default)` or `None | Some(default)` at some use point far away. It also makes the code more concise.
2020-04-04Auto merge of #69718 - arlosi:debughash, r=eddybbors-26/+30
Add hash of source files in debug info LLVM supports placing the hash of source files inside the debug info. This information can be used by a debugger to verify that the source code matches the executable. This change adds support for both hash algorithms supported by LLVM, MD5 and SHA1, controlled by a target option. * DWARF only supports MD5 * LLVM IR supports MD5 and SHA1 (and SHA256 in LLVM 11). * CodeView (.PDB) supports MD5, SHA1, and SHA256. Fixes #68980. Tracking issue: #70401 rustc dev guide PR with further details: https://github.com/rust-lang/rustc-dev-guide/pull/623
2020-04-03Auto merge of #70156 - michaelwoerister:incr-cgus, r=nikomatsakisbors-0/+7
Make the rustc respect the `-C codegen-units` flag in incremental mode. This PR implements (the as of yet unapproved) major change proposal at https://github.com/rust-lang/compiler-team/issues/245. See the description there for background and rationale. The changes are pretty straightforward and should be easy to rebase if the proposal gets accepted at some point. r? @nikomatsakis cc @pnkfelix
2020-04-02Add hash of source files in debug infoArlo Siemsen-26/+30
* Adds either an MD5 or SHA1 hash to the debug info. * Adds new unstable option `-Z src-hash-algorithm` to control the hashing algorithm.
2020-04-02Translate the virtual `/rustc/$hash` prefix back to a real directory.Eduard-Mihai Burtescu-0/+30
2020-03-31Make the rustc respect the `-C codegen-units` flag in incremental mode.Michael Woerister-0/+7
Before this commit `-C codegen-units` would just get silently be ignored if `-C incremental` was specified too. After this commit one can control the number of codegen units generated during incremental compilation. The default is rather high at 256, so most crates won't see a difference unless explicitly opting into a lower count.
2020-03-23query normalize_generic_arg_after_erasing_regionsBastian Kauschke-4/+4
2020-03-21move CrateDisambiguator -> rustc_astMazdak Farrokhzad-49/+10
2020-03-17Auto merge of #69519 - 12101111:remove-proc-macro-check, r=nagisabors-8/+17
Don't use static crt by default when build proc-macro Don't check value of `crt-static` when build proc-macro crates, since they are always built dynamically. For more information, see https://github.com/rust-lang/cargo/issues/7563#issuecomment-591965320 I hope this will fix issues about compiling `proc_macro` crates on musl host without bring more issues. Fix https://github.com/rust-lang/cargo/issues/7563
2020-03-14rustc_metadata: Remove `rmeta::MacroDef`Vadim Petrochenkov-6/+0
Use `ast::MacroDef` instead. Also remove `Session::imported_macro_spans`, external macros have spans now.
2020-03-10[Miri] Use a session variable instead of checking for an env var alwaysWesley Wiser-0/+24
In CTFE heavy code, checking the env var everytime is inefficient. We can do a lot better by using a `Session` variable instead.
2020-03-10When `crate_type` is `None`,check compiler options12101111-1/+1
2020-03-08Simplify checking of crt_static_feature()12101111-26/+10
2020-03-05Add a new test to reach const_limit setting, although with wrong WARNINGs yetChristoph Schmidler-2/+2
rename feature to const_eval_limit
2020-03-05Prepare const_limit feature gate and attributeChristoph Schmidler-0/+4
2020-03-03Run format.12101111-1/+1
2020-03-03Don't use static crt by default when build proc-macro.12101111-8/+33
2020-02-19Tune inliningJohn Kåre Alsaker-0/+1
2020-02-09Make issue references consistentMatthias Prechtl-1/+2
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-6/+6
2020-02-05Auto merge of #67429 - mati865:mingw-ultimate-fix, r=alexcrichtonbors-0/+5
windows-gnu: prefer system crt libraries if they are available The origin of the issue is the fact Rust ships mingw-w64 libraries but no headers and prefers own libraries over the system ones. This leads to situation when headers aren't compatible with libraries (mingw-w64 doesn't provide any forward compatibility and AFAIK backwards compatibility is guaranteed only within major release series). It's easier to understand how this PR works when looking at the linker invocation before and with this PR: https://www.diffchecker.com/GEuYFmzo It adds system libraries path before Rust libraries so the linker will prefer them. It has potential issue when system has files with the same names as Rust but that could be avoided by moving Rust shipped mingw-w64 libraries from `lib/rustlib/x86_64-pc-windows-gnu/lib` to say `lib/rustlib/x86_64-pc-windows-gnu/lib/mingw`. Then adding linker paths in this order: Rust libraries, system libraries, Rust shipped mingw-w64 libraries. Fixes #47048 Fixes #49078 Fixes #53454 Fixes #60912
2020-02-04Prefer system MinGW libs when availableMateusz Mikuła-0/+5
2020-02-04remove redundant imports (clippy::single_component_path_imports)Matthias Krüger-1/+0
2020-01-22Fix tidy warningsAaron Green-2/+6
2020-01-22Enable ASan on FuchsiaAaron Green-1/+1
This change adds the x86_64-fuchsia and aarch64-fuchsia LLVM targets to those allowed to invoke -Zsanitizer. Currently, the only overlap between compiler_rt sanitizers supported by both rustc and Fuchsia is ASan.
2020-01-09Link sanitizer runtimes instead of injecting crate dependenciesTomasz Miąsko-0/+26