about summary refs log tree commit diff
path: root/src/librustc_session
AgeCommit message (Collapse)AuthorLines
2020-05-25Add a small MIR validation passJonas Schievink-0/+2
2020-05-25rename lintRalf Jung-2/+2
2020-05-25add a lint against references to packed fieldsRalf Jung-1/+8
2020-05-22Use `OnceCell` instead of `Once`Dylan MacKenzie-19/+42
2020-05-22Rollup merge of #72309 - petrochenkov:linkunspec, r=matthewjasperRalf Jung-34/+30
Some renaming and minor refactoring for `NativeLibraryKind`
2020-05-20Eliminate some `Option<NativeLibKind>`sVadim Petrochenkov-10/+9
2020-05-20Factor out `NativeLibKind::Dylib` from `NativeLibKind::Unspecified`Vadim Petrochenkov-3/+6
2020-05-20Rename some types describing native librariesVadim Petrochenkov-33/+27
NativeLibrary(Kind) -> NativeLib(Kind) NativeStatic -> StaticBundle NativeStaticNobundle -> StaticNoBundle NativeFramework -> Framework NativeRawDylib -> RawDylib NativeUnknown -> Unspecified
2020-05-20Rollup merge of #72364 - jsgf:remove-unused-deps, r=Mark-SimulacrumDylan DPC-1/+0
Remove unused dependencies Remove some unused dependencies found while while working on https://github.com/rust-lang/rust/pull/72342.
2020-05-19Remove unused dependenciesJeremy Fitzhardinge-1/+0
2020-05-18HIR passes for asm!Amanieu d'Antras-0/+7
2020-05-18Implement AST lowering for asm!Amanieu d'Antras-0/+16
2020-05-17Auto merge of #72248 - petrochenkov:codemodel, r=Amanieubors-10/+21
Cleanup and document `-C code-model` r? @Amanieu
2020-05-16Auto merge of #72178 - tmiasko:inliner-lifetimes, r=nikicbors-0/+10
Consistently use LLVM lifetime markers during codegen 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. Fixes #72154.
2020-05-16Rollup merge of #72094 - petrochenkov:overfeature, r=nikicRalf Jung-1/+15
cmdline: Make target features individually overridable Fixes https://github.com/rust-lang/rust/issues/56527 Previously `-C target-feature=+avx2 -C target-feature=+fma` was equivalent to `-C target-feature=+fma` because the later `-C target-feature` option fully overridden previous `-C target-feature`. With this PR `-C target-feature=+avx2 -C target-feature=+fma` is equivalent to `-C target-feature=+avx2,+fma` and the options are combined. I'm not sure where the comma-separated features in a single option came from (clang uses a scheme with single feature per-option), but logically these features are entirely independent options. So they should be overridable individually as well to be more useful in hierarchical build system, and more consistent with other rustc options and clang behavior as well. Target feature options have a few other issues (https://github.com/rust-lang/rust/issues/44815), but fixing those is going to be a bit more invasive.
2020-05-16rustc_target: Stop using "string typing" for code modelsVadim Petrochenkov-10/+21
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-11cmdline: Make target features individually overridableVadim Petrochenkov-1/+15
2020-05-10Auto merge of #71825 - contrun:cg-option-strip, r=petrochenkovbors-3/+26
add codegen option strip closes https://github.com/rust-lang/rust/issues/71757 I don't know if the flags added here works for all linkers. I only tested on my Linux pc. I also don't know what is the best for emlinker, PtxLinker, MsvcLinker. The option for WasmLd is copied from https://aransentin.github.io/cwasm/.
2020-05-10Emit a warning when optimization fuel runs outJonas Schievink-1/+1
`eprintln!` gets swallowed by Cargo too easily.
2020-05-10add linking option stripYI-3/+26
move strip option to "Z" add more strip options, remove strip-debuginfo-if-disabled merge strip and debuginfo
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-09Rollup merge of #71234 - maurer:init-array, r=cuviperRalf Jung-0/+2
rustllvm: Use .init_array rather than .ctors LLVM TargetMachines default to using the (now-legacy) .ctors representation of init functions. Mixing .ctors and .init_array representations can cause issues when linking with lld. This happens in practice for: * Our profiling runtime which is currently implicitly built with .init_array since it is built by clang, which sets this field. * External C/C++ code that may be linked into the same process. Fixes: #71233
2020-05-07Reintegrate chalk using chalk-solveJack Huey-0/+2
2020-05-06Rollup merge of #71269 - Mark-Simulacrum:sat-float-casts, r=nikicDylan DPC-2/+2
Define UB in float-to-int casts to saturate This closes #10184 by defining the behavior there to saturate infinities and values exceeding the integral range (on the lower or upper end). `NaN` is sent to zero.
2020-05-06Define UB in float-to-int casts to saturateMark Rousskov-2/+2
- Round to zero, and representable values cast directly. - `NaN` goes to 0 - Values beyond the limits of the type are saturated to the "nearest value" (essentially rounding to zero, in some sense) in the integral type, so e.g. `f32::INFINITY` would go to `{u,i}N::MAX.`
2020-05-05Rollup merge of #69984 - lenary:lenary/force-uwtables, r=hanna-kruppeDylan DPC-0/+46
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/+46
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-03Rollup merge of #71542 - crlf0710:confusable_idents, r=petrochenkovDylan DPC-0/+16
Implement `confusable_idents` lint. This collects all identifier symbols into `ParseSession` and examines them within the non-ascii-idents lint. The skeleton generation part needs to be added to `unicode-security` crate. Will update this PR when the crate is updated. r? @petrochenkov EDIT: also included the `concat_idents` part.
2020-05-03Enable `cfg` predicate for `target_feature = "crt-static"` only if the ↵Vadim Petrochenkov-8/+3
target supports it
2020-05-03Implement `confusable_idents` lint.Charles Lew-0/+16
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-20/+20
2020-05-01Rename `bitcode-in-rlib` option to `embed-bitcode`Alex Crichton-6/+4
This commit finishes work first pioneered in #70458 and started in #71528. The `-C bitcode-in-rlib` option, which has not yet reached stable, is renamed to `-C embed-bitcode` since that more accurately reflects what it does now anyway. Various tests and such are updated along the way as well. This'll also need to be backported to the beta channel to ensure we don't accidentally stabilize `-Cbitcode-in-rlib` as well.
2020-04-29Use .init_array rather than .ctorsMatthew Maurer-0/+2
LLVM TargetMachines default to using the (now-legacy) .ctors representation of init functions. Mixing .ctors and .init_array representations can cause issues when linking with lld. This happens in practice for: * Our profiling runtime which is currently implicitly built with .init_array since it is built by clang, which sets this field. * External C/C++ code that may be linked into the same process. To support legacy systems which may use .ctors, targets may now specify that they use .ctors via the use_ctors attribute which defaults to false. For debugging and manual control, -Z use-ctors-section=yes/no will allow manual override. Fixes: #71233
2020-04-29Remove Session::no_landing_pads()Amanieu d'Antras-3/+0
2020-04-29Remove -Z no-landing-pads flagAmanieu d'Antras-3/+1
2020-04-26rustc_target: Stop using "string typing" for TLS modelsVadim Petrochenkov-8/+21
Introduce `enum TlsModel` instead.
2020-04-26rustc-book: Document `-C relocation-model`Vadim Petrochenkov-1/+2
2020-04-26rustc_target: Stop using "string typing" for relocation modelsVadim Petrochenkov-12/+21
Introduce `enum RelocModel` instead.
2020-04-23Rollup merge of #71408 - GuillaumeGomez:check-code-blocks-tags, r=kinnisonDylan DPC-0/+7
Check code blocks tags Fixes #71347. Explanations here: I realized recently that it was a common issue to confuse/misspell tags on code blocks. This is actually quite a big issue since it generally ends up in a code blocks being ignored since it's not being considered as a rust one. With this new warning, users will at least be notified about it. PS: some improvements can be done on the error rendering but considering how big the PR already is, I think it's better to do it afterwards. r? @ollie27 cc @rust-lang/rustdoc
2020-04-23Create new rustdoc lint to check for code blocks tagsGuillaume Gomez-0/+7
2020-04-22Alphabetize the `-C` and `-Z` options.Nicholas Nethercote-270/+294
In the code, test, and docs, because it makes it much easier to find things. Other than adding the comments about alphabetical order, this commit only moves things around.
2020-04-22Add a new option `-Cbitcode-in-rlib`.Nicholas Nethercote-0/+12
It defaults to true, but Cargo will set this to false whenever it can to reduce compile times.
2020-04-20Auto merge of #70729 - nnethercote:a-big-options-clean-up, r=petrochenkovbors-248/+232
A big options clean-up Lots of improvements here. r? @Centril