about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/mir
AgeCommit message (Collapse)AuthorLines
2020-04-05Stop importing int/float modules in librustc_*Linus Färnstrand-2/+0
2020-04-02direct imports for langitem stuffMazdak Farrokhzad-2/+2
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-40/+38
2020-04-01Rollup merge of #70616 - anyska:fieldplacement-rename, r=oli-obkDylan DPC-1/+1
rustc_target::abi: rename FieldPlacement to FieldsShape. Originally suggested by @eddyb.
2020-03-31Use Place directly in codegen_place_to_pointer, it's CopySantiago Pastorino-3/+3
2020-03-31Use Place directly in evaluate_array_len, it's CopySantiago Pastorino-2/+2
2020-03-31Use Place directly in codegen_transmute, it's CopySantiago Pastorino-2/+2
2020-03-31Use Place directly on make_return_dest, it's CopySantiago Pastorino-2/+2
2020-03-31Use Place directly on codegen_drop_terminator, it's CopySantiago Pastorino-2/+2
2020-03-31rustc_target::abi: rename FieldPlacement to FieldsShape.Ana-Maria Mihalache-1/+1
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-9/+9
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-35/+35
2020-03-30Auto merge of #70449 - ecstatic-morse:visit-body, r=oli-obkbors-1/+1
Make `Visitor::visit_body` take a plain `&Body` `ReadOnlyBodyAndCache` has replaced `&Body` in many parts of the code base that don't care about basic block predecessors. This includes the MIR `Visitor` trait, which I suspect resulted in many unnecessary changes in #64736. This reverts part of that PR to reduce the number of places where we need to pass a `ReadOnlyBodyAndCache`. In the long term, we should either give `ReadOnlyBodyAndCache` more ergonomic name and replace all uses of `&mir::Body` with it at the cost of carrying an extra pointer everywhere, or use it only in places that actually need access to the predecessor cache. Perhaps there is an even nicer alternative. r? @Nashenas88
2020-03-29Use `&` to do deref coercion for `ReadOnlyBodyAndCache`Dylan MacKenzie-1/+1
2020-03-29Make `Visitor::visit_body` take a simple `Body`Dylan MacKenzie-1/+1
2020-03-27Rename TyLayout to TyAndLayout.Ana-Maria Mihalache-12/+16
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-2/+2
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-25make Size::from* methods generic in the integer type they acceptRalf Jung-1/+1
2020-03-23Evaluate repeat expression lengths as late as possibleOliver Scherer-0/+3
2020-03-23Rollup merge of #70249 - lcnr:issue70125, r=eddybMazdak Farrokhzad-24/+19
handle ConstKind::Unresolved after monomorphizing fixes #70125 r? @bjorn3
2020-03-22simplify eval_mir_constantBastian Kauschke-13/+3
2020-03-22handle unevaluated consts after monomophizeBastian Kauschke-21/+26
2020-03-21Rollup merge of #70126 - wesleywiser:fix_miri_ice_neg_zst_enum_discr, ↵Dylan DPC-1/+6
r=RalfJung,eddyb Fix ICE caused by truncating a negative ZST enum discriminant Fixes #70114 r? @oli-obk or @RalfJung
2020-03-21Fix ICE caused by truncating a negative ZST enum discriminantWesley Wiser-1/+6
2020-03-20Rollup merge of #69935 - davidtwco:issue-69925, r=eddybYuki Okushi-6/+11
codegen/mir: support polymorphic `InstanceDef`s cc #69925 This PR modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s. r? @eddyb cc @nikomatsakis
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+1
2020-03-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-9/+4
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-13adjust enum namingRalf Jung-12/+12
2020-03-12rename panic_if_ intrinsics to assert_Ralf Jung-4/+4
2020-03-12codegen/mir: support polymorphic `InstanceDef`sDavid Wood-6/+11
This commit modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s. Signed-off-by: David Wood <david@davidtw.co>
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-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-06mir::Local is Copy we can pass it by value in these casesSantiago Pastorino-1/+1
2020-03-05Remove eh_unwind_resume lang itemAmanieu d'Antras-9/+4
2020-03-04PlaceRef<'a, 'tcx> -> PlaceRef<'tcx>Santiago Pastorino-5/+5
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-02Make PlaceRef lifetimes of LocalAnalyzer::process_place be both 'tcxSantiago Pastorino-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-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