summary refs log tree commit diff
path: root/src/librustc_mir/build/expr
AgeCommit message (Collapse)AuthorLines
2019-06-25Use `Local`s instead of `Place`s in MIR drop generationMatthew Jasper-4/+4
2019-06-25Add StorageDead statements for `while` conditionsMatthew Jasper-13/+4
2019-06-25Unify `return`, `break` and `continue` handlingMatthew Jasper-61/+4
2019-06-25Use `as_temp` to evaluate statement expressionsMatthew Jasper-45/+35
2019-06-25Fix incorrect double assignment in MIR for while loopsMatthew Jasper-6/+14
2019-06-25Implement From<Local> for Place and PlaceBaseSantiago Pastorino-19/+19
2019-06-14Remove unnecessary lift callsJohn Kåre Alsaker-2/+2
2019-06-12Use a single lifetime for MIR constructionJohn Kåre Alsaker-7/+7
2019-06-04Move cached_block out of DropKindTyler Mandry-4/+2
2019-06-03Add `is_ref_for_guard` methodMatthew Jasper-7/+1
2019-05-28Rename Place::local to Place::local_or_deref_localSantiago Pastorino-1/+1
2019-05-27Use Place::localSantiago Pastorino-7/+3
2019-05-21Comment style fixesMazdak Farrokhzad-2/+2
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-05-21Schedule storage-dead of temporaries soonerMatthew Jasper-12/+28
This ensures that we will correctly generate a storage-dead if the initializing expression diverges.
2019-05-21Remove unused parameter from in(_opt)?_scopeMatthew Jasper-6/+6
2019-05-10Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match.Mazdak Farrokhzad-40/+0
2019-05-04Auto merge of #59897 - tmandry:variantful-generators, r=eddybbors-15/+3
Multi-variant layouts for generators This allows generators to overlap fields using variants, but doesn't do any such overlapping yet. It creates one variant for every state of the generator (unresumed, returned, panicked, plus one for every yield), and puts every stored local in each of the yield-point variants. Required for optimizing generator layouts (#52924). There was quite a lot of refactoring needed for this change. I've done my best in later commits to eliminate assumptions in the code that only certain kinds of types are multi-variant, and to centralize knowledge of the inner mechanics of generators in as few places as possible. This change also emits debuginfo about the fields contained in each variant, as well as preserving debuginfo about stored locals while running in the generator. Also, fixes #59972. Future work: - Use this change for an optimization pass that actually overlaps locals within the generator struct (#52924) - In the type layout fields, don't include locals that are uninitialized for a particular variant, so miri and UB sanitizers can check our memory (see https://github.com/rust-lang/rust/issues/59972#issuecomment-483058172) - Preserve debuginfo scopes across generator yield points
2019-04-25Update existing usagesvarkor-2/+2
2019-04-25Support variantful generatorsTyler Mandry-16/+3
This allows generators to overlap fields using variants.
2019-04-25Define generator discriminant type in only one placeTyler Mandry-2/+3
2019-04-24Evaluate hair::ExprKind::Use in intoMatthew Jasper-6/+5
This avoids some unnecessary moves
2019-04-23rustc: don't track var_hir_id or mutability in mir::UpvarDecl.Eduard-Mihai Burtescu-2/+2
2019-04-21Enable migrate mode by default on the 2015 editionMatthew Jasper-5/+1
This also fully stabilizes two-phase borrows on all editions
2019-04-16refactor ExprKind to use new PointerCast enumSaleem Jaffer-44/+5
2019-04-15basic refactor. Adding PointerCast enumSaleem Jaffer-5/+16
2019-04-03Shrink `mir::Statement`.Nicholas Nethercote-3/+3
The `InlineAsm` variant is extremely rare, and `mir::Statement` often contributes significantly to peak memory usage.
2019-04-02renames EvalErrorKind to InterpErrorkenta7777-6/+6
2019-04-01Allow closure to unsafe fn coercionTaiki Endo-2/+2
2019-03-23adding mir::StaticKind enum for static and promotedSaleem Jaffer-2/+1
2019-03-18promoted is still left in 2 placesSaleem Jaffer-0/+1
2019-03-16Revert the `LazyConst` PROliver Scherer-2/+2
2019-03-03Auto merge of #58673 - matthewjasper:typeck-ptr-coercions, r=pnkfelixbors-2/+7
[NLL] Type check operations with pointer types It seems these were forgotten about. Moving to `Rvalue::AddressOf` simplifies the coercions from references, but I want this to be fixed as soon as possible. r? @pnkfelix
2019-03-01Put Local, Static and Promoted as one Base variant of PlaceSantiago Pastorino-29/+43
2019-02-23Type check coercions to pointer typesMatthew Jasper-2/+7
2019-02-21Match discriminant -> scrutineeMatthew Jasper-2/+2
2019-02-09Auto merge of #58207 - nnethercote:intern_lazy_const, r=oli-obkbors-1/+1
Make `intern_lazy_const` actually intern its argument. Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
2019-02-08librustc_mir => 2018Taiki Endo-21/+21
2019-02-06Make `intern_lazy_const` actually intern its argument.Nicholas Nethercote-1/+1
Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
2019-01-19Handle lifetime annotations in unreachable codeMatthew Jasper-4/+15
We equate the type in the annotation with the inferred type first so that we have a fully inferred type to perform the well-formedness check on.
2019-01-19Use a struct for user type annotationsMatthew Jasper-6/+13
2019-01-05Remove `Region` from HAIRMatthew Jasper-6/+3
Use `ReErased` for any regions that need to be created in RValue::Ref in MIR generation.
2019-01-01Move the `Unevaluated` constant arm upwards in the type structureOliver Scherer-5/+7
2018-12-30Refactor `UserTypeAnnotation`.David Wood-7/+21
This commit refactors the `UserTypeAnnotation` type to be referred to by an index within `UserTypeProjection`. `UserTypeAnnotation` is instead kept in an `IndexVec` within the `Mir` struct. Further, instead of `UserTypeAnnotation` containing canonicalized types, it now contains normal types and the entire `UserTypeAnnotation` is canonicalized. To support this, the type was moved from the `rustc::mir` module to `rustc::ty` module.
2018-12-25Remove licensesMark Rousskov-90/+0
2018-12-23Rollup merge of #56917 - sinkuu:mir_build_logicop, r=davidtwcoMazdak Farrokhzad-30/+23
Simplify MIR generation for logical operations Reduces one block and one branch from MIR generated for a logical operator.
2018-12-17Simplify MIR generation for logical opsShotaro Yamada-30/+23
2018-12-11Add a FIXME for mir build unreachable destination checkingvarkor-6/+8
2018-12-11Consider privacy in more locationsvarkor-7/+7
2018-12-11Fix handling of divergent dicriminantsvarkor-1/+0
2018-12-11Make uninhabitedness checking more intelligentvarkor-1/+1