about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
2020-03-18Rollup merge of #69920 - Centril:hir-cleanup, r=ZoxcMazdak Farrokhzad-22/+22
Remove some imports to the rustc crate - When we have `NestedVisitorMap::None`, we use `type Map = dyn intravisit::Map<'v>;` instead of the actual map. This doesn't actually result in dynamic dispatch (in the future we may want to use an associated type default to simplify the code). - Use `rustc_session::` imports instead of `rustc::{session, lint}`. r? @Zoxc
2020-03-17Auto merge of #69519 - 12101111:remove-proc-macro-check, r=nagisabors-5/+6
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-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-22/+22
2020-03-15More Method->Fn renamingMark Mansi-1/+1
2020-03-14Update `krate_attrs` and `get_module`John Kåre Alsaker-2/+2
2020-03-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-10/+18
Optimize catch_unwind to match C++ try/catch This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown. https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great. This PR, on the other hand, generates the following assembly: ```asm # -Cpanic=unwind: push rbx mov ebx,0x2a call QWORD PTR [rip+0x1c53c] # <happy> mov eax,ebx pop rbx ret mov rdi,rax call QWORD PTR [rip+0x1c537] # cleanup function call call QWORD PTR [rip+0x1c539] # <unfortunate> mov ebx,0xd mov eax,ebx pop rbx ret # -Cpanic=abort: push rax call QWORD PTR [rip+0x20a1] # <happy> mov eax,0x2a pop rcx ret ``` Fixes #64224, and resolves #64222.
2020-03-14Rollup merge of #69954 - RalfJung:panic_if-assert, r=Centril,eddybYuki Okushi-13/+13
rename panic_if_ intrinsics to assert_ [Suggested by @eddyb](https://github.com/rust-lang/miri/issues/1222#issuecomment-598087523)
2020-03-13adjust enum namingRalf Jung-12/+12
2020-03-12rename panic_if_ intrinsics to assert_Ralf Jung-4/+4
2020-03-12Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbiniMazdak Farrokhzad-2/+2
Rename rustc guide This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470 Needs to be merged after we actually rename the guide. Have used this to rename: `git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'` `git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'` `git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
2020-03-11Rollup merge of #69850 - RalfJung:panic-bounds-check, r=eddybMazdak Farrokhzad-1/+5
panic_bounds_check: use caller_location, like PanicFnLangItem The `PanicFnLangItem` got switched to using `#[caller_location]` at some point, but `PanicBoundsCheckFnLangItem` was kept in the old style. For consistency, switch that one over to use `#[caller_location]` as well. This is also helpful for Miri as it means the `assert_panic` machine hook never needs to know the current `Span`.
2020-03-11Rollup merge of #66059 - RalfJung:panic-on-non-zero, r=eddybMazdak Farrokhzad-35/+92
mem::zeroed/uninit: panic on types that do not permit zero-initialization r? @eddyb @oli-obk Cc https://github.com/rust-lang/rust/issues/62825 Also see [this summary comment](https://github.com/rust-lang/rust/pull/66059#issuecomment-586734747)
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-1/+1
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-2/+2
2020-03-10Rollup merge of #69714 - spastorino:place-ref-lifetime, r=oli-obkMazdak Farrokhzad-5/+5
Make PlaceRef take just one lifetime r? @eddyb
2020-03-09Improve readabilityRalf Jung-2/+2
2020-03-09panic_bounds_check: use caller_location, like PanicFnLangItemRalf Jung-1/+5
2020-03-07Rollup merge of #69787 - spastorino:use-local-directly-its-copy, r=oli-obkMazdak Farrokhzad-1/+1
mir::Local is Copy we can pass it by value in these cases r? @oli-obk
2020-03-06mir::Local is Copy we can pass it by value in these casesSantiago Pastorino-1/+1
2020-03-06fix various typosMatthias Krüger-2/+2
2020-03-05Link to libgcc dynamically on windows-gnu when using dylib cratesAmanieu d'Antras-0/+14
2020-03-05Remove eh_unwind_resume lang itemAmanieu d'Antras-10/+4
2020-03-04PlaceRef<'a, 'tcx> -> PlaceRef<'tcx>Santiago Pastorino-5/+5
2020-03-04Don't use "if let" bindings to only check a value and not actually bind ↵Matthias Krüger-1/+1
anything. For example: `if let Some(_) = foo() {}` can be reduced to `if foo().is_some() {}` (clippy::redundant_pattern_matching)
2020-03-03Rollup merge of #69650 - matthiaskrgr:clnp, r=varkorDylan DPC-1/+1
cleanup more iterator usages (and other things) * Improve weird formatting by moving comment inside else-code block. * Use .any(x) instead of .find(x).is_some() on iterators. * Use .nth(x) instead of .skip(x).next() on iterators. * Simplify conditions like x + 1 <= y to x < y * Use let instead of match to get value of enum with single variant.
2020-03-03Make PlaceRef lifetimes of monomorphized_place_ty be both 'tcxSantiago Pastorino-1/+1
2020-03-03Make PlaceRef lifetimes of codegen_place be both 'tcxSantiago Pastorino-3/+3
2020-03-03Improve linking of crates with circular dependenciesTomasz Miąsko-7/+15
Previously, the code responsible for handling the cycles between crates introduces through weak lang items, would keep a set of missing language items: * extending it with items missing from the current crate, * removing items provided by the current crate, * grouping the crates when the set changed from non-empty back to empty. This could produce incorrect results, if a lang item was missing from a crate that comes after the crate that provides it (in the loop iteration order). In that case the grouping would not take place. The changes here address this specific failure scenario by keeping track of two separate sets of crates. Those that are required to link successfully, and those that are available for linking. Verified using test case from 69368.
2020-03-03Run format.12101111-1/+2
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.