about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
2020-03-03Don't use static crt by default when build proc-macro.12101111-5/+5
2020-03-02Make PlaceRef lifetimes of LocalAnalyzer::process_place be both 'tcxSantiago Pastorino-1/+1
2020-03-03Use .nth(x) instead of .skip(x).next() on iterators.Matthias Krüger-1/+1
2020-03-01Rollup merge of #69569 - matthiaskrgr:nonminimal_bool, r=mark-SimulacrumDylan DPC-2/+2
simplify boolean expressions
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-5/+5
2020-02-29Make it build againVadim Petrochenkov-1/+1
2020-02-29simplify boolean expressionsMatthias Krüger-2/+2
2020-02-29move panic intrinsic codegen to helper functionRalf Jung-66/+92
2020-02-29fmtRalf Jung-6/+10
2020-02-29make it even more conservative, and note some FIXMEsRalf Jung-0/+2
2020-02-29mem::zeroed/uninit: panic on types that do not permit zero-initializationRalf Jung-3/+28
2020-02-28simplify condition in start_executing_work()Matthias Krüger-5/+5
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-8/+8
2020-02-28Rollup merge of #69529 - matthiaskrgr:clippy_identity_conversion, ↵Dylan DPC-3/+2
r=Mark-Simulacrum don't use .into() to convert types into identical types. This removes redundant `.into()` calls. example: `let s: String = format!("hello").into();`
2020-02-28Rollup merge of #69379 - jumbatm:llvm-sigsegv, r=pnkfelixDylan DPC-2/+2
Fail on multiple declarations of `main`. Closes #67946. Previously, when inserting the entry function, we only checked for duplicate _definitions_ of `main`. However, it's possible to cause problems even only having a duplicate _declaration_. For example, shadowing `main` using an extern block isn't caught by the current check, and causes an assertion failure down the line in in LLVM code. r? @pnkfelix
2020-02-27don't use .into() to convert types into identical types.Matthias Krüger-3/+2
example: let s: String = format!("hello").into();
2020-02-26Rollup merge of #69429 - matthiaskrgr:clippy_, r=estebankDylan DPC-1/+1
remove redundant clones and import
2020-02-24no more codegen for miri_start_panicRalf Jung-5/+2
2020-02-24librustc{, codegen_ssa,infer,mir_build}: don't clone types that are copyMatthias Krüger-1/+1
2020-02-23Auto merge of #69351 - mati865:mingw-ultimate-fix, r=cramertjbors-9/+15
Improve external MinGW detection Fixes #68872
2020-02-23Fail on multiple declarations of `main`.jumbatm-2/+2
Previously, when inserting the entry function, we only checked for duplicate _definitions_ of `main`. However, it's possible to cause problems even only having a duplicate _declaration_. For example, shadowing `main` using an extern block isn't caught by the current check, and causes an assertion failure down the line in in LLVM code.
2020-02-21Detect Chocolatey MinGW installationMateusz Mikuła-3/+10
2020-02-21Fix MinGW detection for CygwinMateusz Mikuła-8/+7
2020-02-16Code review changes.Ben Lewis-2/+2
2020-02-15Monomorphize const type during codegen.Ben Lewis-1/+2
2020-02-15Change `const_field` and `const_caller_location` to return `ConstValue` ↵Ben Lewis-26/+25
instead of `Const` as the type in the returned const isn't needed.
2020-02-15Change const eval to return `ConstValue`, instead of `Const` as the type ↵Ben Lewis-2/+8
inside it shouldn't be used.
2020-02-13rename PanicInfo -> AssertKindRalf Jung-3/+3
2020-02-13move PanicInfo to mir moduleRalf Jung-1/+1
2020-02-12Rollup merge of #67954 - nikic:new-pm, r=nagisaDylan DPC-0/+3
Support new LLVM pass manager Add support for the new LLVM pass manager behind a `-Z new-llvm-pass-manager=on` option. Both the pre-link optimization and LTO pipelines use the new pass manager. There's some bits that are not supported yet: * `-C passes`. NewPM requires an entirely different way of specifying custom pass pipelines. We should probably expose that functionality, but it doesn't directly map to what `-C passes` does. * NewPM has no support for custom inline parameters right now. We'd have to add upstream support for that first. * NewPM does not support PGO at O0 in LLVM 9 (which is why those tests fail with NewPM enabled). This is supported in LLVM 10. * NewPM does not support MergeFunctions in LLVM 9. I've landed this upstream just before the cut, so we'll be able to re-enable that with LLVM 10. Closes #64289. r? @ghost
2020-02-12Add support for new pass managerNikita Popov-0/+3
The new pass manager can be enabled using -Z new-llvm-pass-manager=on.
2020-02-12Rollup merge of #68994 - Keruspe:sanitizers-conflict, r=Mark-SimulacrumDylan DPC-2/+9
rustbuild: include channel in sanitizers installed name Allows parallel install of different rust channels. I'm not sure if the channel is the right thing to use there, but currently both beta and nightly try to install e.g. `/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_rt.asan.a` when before (and in current stable) it used to be `/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_asan-45a4390180e83d28.rlib` which contained a hash, making it unique. With this patch, `/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-nightly_rt.asan.a` gets installed
2020-02-11Merge rustc::middle::*lang_items.Camille GILLOT-6/+3
2020-02-11Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPCDylan DPC-4/+0
Remove unused feature gates I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-11rustbuild: include channel in sanitizers installed nameMarc-Antoine Perennou-2/+9
Allows parallel install of different rust channels Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-02-11Auto merge of #68961 - eddyb:dbg-stack-dunk, r=nagisabors-32/+37
rustc_codegen_ssa: only "spill" SSA-like values to the stack for debuginfo. This is an implementation of the idea described in https://github.com/rust-lang/rust/issues/68817#issuecomment-583719182. In short, instead of debuginfo forcing otherwise-SSA-like MIR locals into `alloca`s, and requiring a `load` for each use (or two, for scalar pairs), the `alloca` is now *only* used for attaching debuginfo with `llvm.dbg.declare`: the `OperandRef` is stored to the `alloca`, but *never loaded* from it. Outside of `debug_introduce_local`, nothing cares about the debuginfo-only `alloca`, and instead works with `OperandRef` the same as MIR locals without debuginfo before this PR. This should have some of the benefits of `llvm.dbg.value`, while working today. cc @nagisa @nikomatsakis
2020-02-10Rollup merge of #68932 - ↵Dylan DPC-7/+14
michaelwoerister:self-profile-generic-activity-args, r=wesleywiser self-profile: Support arguments for generic_activities. This PR adds support for recording arguments of "generic activities". The most notable use case is LLVM module names, which should be very interesting for `crox` profiles. In the future it might be interesting to add more fine-grained events for pre-query passes like macro expansion. I tried to judiciously de-duplicate existing self-profile events with `extra_verbose_generic_activity`, now that the latter also generates self-profile events. r? @wesleywiser
2020-02-10self-profile: Support arguments for generic_activities.Michael Woerister-7/+14
2020-02-09rustc_codegen_ssa: only "spill" SSA-like values to the stack for debuginfo.Eduard-Mihai Burtescu-32/+34
2020-02-09rustc_codegen_ssa: use `debug_introduce_local` on Operand call results.Eduard-Mihai Burtescu-0/+3
2020-02-09Auto merge of #68975 - Dylan-DPC:rollup-jzab8oh, r=Dylan-DPCbors-25/+4
Rollup of 7 pull requests Successful merges: - #68718 (Move `rustc_hir::def_id` to `rustc_span::def_id`) - #68834 (Fix and test implementation of BTreeMap's first/last_entry, pop_first/last) - #68857 (perf: Reduce Vec allocations in normalization by passing &mut Vec) - #68918 (Don't use the word "unwrap" to describe "unwrap" methods) - #68946 (Mark several functions and methods in core::cmp as #[must_use]) - #68958 (Clean up E0277 and E0282 explanations) - #68960 (codegen: misc cleanups around debuginfo scopes and locations.) Failed merges: r? @ghost
2020-02-08Auto merge of #68802 - eddyb:debuginfo-there-can-only-be-one-arg, r=nagisabors-4/+1
rustc_codegen_ssa: don't treat inlined variables as debuginfo arguments. Fixes #67586 by limiting `ArgumentVariable` special-casing to `VarDebugInfo` entries that are in `OUTERMOST_SOURCE_SCOPE`, i.e. the function's own argument scope. That excludes `VarDebugInfo` from inlined callees, which can also point to the caller's argument locals. This is a snippet from the optimized MIR (including inlining) of the testcase: ```rust fn foo(_1: usize) -> usize { debug bar => _1; // in scope 0 at ./example.rs:2:12: 2:15 let mut _0: usize; // return place in scope 0 at ./example.rs:2:27: 2:32 scope 1 { debug x => _1; // in scope 1 at /rustc/9ed29b6ff6aa2e048b09c27af8f62ee3040bdb37/src/libcore/convert/mod.rs:106:26: 106:27 } ``` `scope 1` is from inlining the `identity` call, and `debug x => _1;` comes from the body of `core::convert::identity`, so they are now ignored for the purposes of determining the `ArgumentVariable` debuginfo associated to `_1`.
2020-02-08rustc_codegen_ssa: remove unnecessary source_locations_enabled.Eduard-Mihai Burtescu-18/+4
2020-02-08rustc_codegen_llvm: remove InternalDebugLocation and simplify dbg_var_addr.Eduard-Mihai Burtescu-7/+0
2020-02-07Rollup merge of #68164 - tmiasko:no-sanitize, r=nikomatsakisDylan DPC-10/+12
Selectively disable sanitizer instrumentation Add `no_sanitize` attribute that allows to opt out from sanitizer instrumentation in an annotated function.
2020-02-05Apply LLVM sanitize attributes to generated entry wrapperTomasz Miąsko-10/+12
2020-02-05Auto merge of #67429 - mati865:mingw-ultimate-fix, r=alexcrichtonbors-0/+78
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/+78
2020-02-04Remove unused feature gates from cg_ssa and cg_utilsbjorn3-4/+0
2020-02-04Auto merge of #68708 - Mark-Simulacrum:stage0-step, r=pietroalbinibors-1/+0
Step stage0 to bootstrap from 1.42 This also includes a commit which fixes the rustfmt downloading logic to redownload when the rustfmt channel changes, and bumps rustfmt to a more recent version.