about summary refs log tree commit diff
path: root/src/librustc/mir
AgeCommit message (Collapse)AuthorLines
2019-04-28Fix lint findings in librustcflip1995-4/+4
2019-04-26Update handling of Tuplevarkor-1/+1
2019-04-26Auto merge of #60167 - varkor:tidy-filelength, r=matthewjasperbors-0/+2
Add a tidy check for files with over 3,000 lines Files with a large number of lines can cause issues in GitHub (e.g. https://github.com/rust-lang/rust/issues/60015) and also tend to be indicative of opportunities to refactor into less monolithic structures. This adds a new check to tidy to warn against files that have more than 3,000 lines, as suggested in https://github.com/rust-lang/rust/issues/60015#issuecomment-483868594. (This number was chosen fairly arbitrarily as a reasonable indicator of size.) This check can be ignored with `// ignore-tidy-filelength`. Existing files with greater than 3,000 lines currently ignore the check, but this helps us spot when files are getting too large. (We might try to split up all files larger than this in the future, as in https://github.com/rust-lang/rust/issues/60015).
2019-04-25ignore-tidy-filelength on all files with greater than 3000 linesvarkor-0/+2
2019-04-25Implement Debug for Place using Place::iterateSantiago Pastorino-52/+86
2019-04-23rustc: dissuade compiler developers from misusing upvar debuginfo.Eduard-Mihai Burtescu-7/+11
2019-04-23rustc: don't track var_hir_id or mutability in mir::UpvarDecl.Eduard-Mihai Burtescu-10/+5
2019-04-23rustc_mir: don't rely on mir::UpvarDecl in the MIR borrowck.Eduard-Mihai Burtescu-35/+0
2019-04-21Auto merge of #60116 - RalfJung:miri-exit, r=oli-obkbors-0/+8
add Miri error variant for process exit This is to support https://github.com/rust-lang/miri/pull/702 r? @oli-obk
2019-04-20improve docsRalf Jung-2/+2
2019-04-20Auto merge of #59987 - saleemjaffer:refactor_adjust_castkinds, r=oli-obkbors-20/+3
Refactor Adjust and CastKind fixes rust-lang#59588
2019-04-19add Miri error variant for process exitRalf Jung-0/+8
2019-04-18Make PlaceProjectionsIter a proper iteratorSantiago Pastorino-4/+18
2019-04-17Make iterate take a FnOnce with PlaceBase and PlaceProjectionIterSantiago Pastorino-36/+34
2019-04-17Place::iterate do not take an accumulator anymore, hide that in a private fnSantiago Pastorino-1/+8
2019-04-17Place::unroll -> Place::iterateSantiago Pastorino-4/+4
2019-04-17Move unroll_place to Place::unrollSantiago Pastorino-0/+75
2019-04-17Rollup merge of #59986 - RalfJung:miri-new-alloc, r=oli-obkMazdak Farrokhzad-70/+45
Miri: refactor new allocation tagging Tagging and initializing `AllocExtra` now go hand-in-hand so one cannot forget to do one when doing the other. In particular, `memory.allocate` is now much easier to use correctly (because it will already return a tagged pointer). r? @oli-obk
2019-04-16Miri: refactor new allocation taggingRalf Jung-70/+45
2019-04-15basic refactor. Adding PointerCast enumSaleem Jaffer-20/+3
2019-04-14Rollup merge of #59877 - Zoxc:hiridify_def_id, r=eddybMazdak Farrokhzad-2/+2
HirIdify hir::Def cc @ljedrz r? @oli-obk
2019-04-14Auto merge of #59693 - nnethercote:64-bit-Spans, r=petrochenkovbors-1/+1
Increase `Span` from 4 bytes to 8 bytes. This increases the size of some important types, such as `ast::Expr` and `mir::Statement`. However, it drastically reduces how much the interner is used, and the fields are more natural sizes that don't require bit operations to extract. As a result, instruction counts drop across a range of workloads, by as much as 10% for `script-servo` incremental builds. Peak memory usage goes up a little for some cases, but down by more for some other cases -- as much as 18% for non-incremental builds of `packed-simd`. The commit also: - removes the `repr(packed)`, because it has negligible effect, but can cause undefined behaviour; - replaces explicit impls of common traits (`Copy`, `PartialEq`, etc.) with derived ones. r? @petrochenkov
2019-04-14HirIdify hir::Defljedrz-2/+2
2019-04-05remove lookup_char_pos_adjAleksey Kladov-2/+2
It is now exactly equivalent to lookup_char_pos.
2019-04-05Increase `Span` from 4 bytes to 8 bytes.Nicholas Nethercote-1/+1
This increases the size of some important types, such as `ast::Expr` and `mir::Statement`. However, it drastically reduces how much the interner is used, and the fields are more natural sizes that don't require bit operations to extract. As a result, instruction counts drop across a range of workloads, by as much as 12% for incremental "check" builds of `script-servo`. Peak memory usage goes up a little for some cases, but down by more for some other cases -- as much as 18% for non-incremental builds of `packed-simd`. The commit also: - removes the `repr(packed)`, because it has negligible effect, but can cause undefined behaviour; - replaces explicit impls of common traits (`Copy`, `PartialEq`, etc.) with derived ones.
2019-04-03Deny internal lints in librustcflip1995-1/+1
2019-04-03Rollup merge of #59630 - nnethercote:shrink-mir-Statement, r=pnkfelixMazdak Farrokhzad-17/+26
Shrink `mir::Statement`. The `InlineAsm` variant is extremely rare, and `mir::Statement` often contributes significantly to peak memory usage.
2019-04-03Rollup merge of #59514 - tmandry:remove-adt-def-from-projection-elem, r=eddybMazdak Farrokhzad-111/+87
Remove adt_def from projections and downcasts in MIR As part of optimizing generator layouts in MIR, we'd like to allow downcasting generators to variants which do not have a corresponding `def_id`, since they are created by the compiler. This refactor hopes to allow that, without regressing perf. r? @eddyb
2019-04-03Shrink `mir::Statement`.Nicholas Nethercote-17/+26
The `InlineAsm` variant is extremely rare, and `mir::Statement` often contributes significantly to peak memory usage.
2019-04-02Remove adt_def from PlaceTy and make it a structTyler Mandry-74/+42
2019-04-02Replace adt_def with name in mir::ProjectionElem::DowncastTyler Mandry-38/+46
2019-04-02renames EvalErrorKind to InterpErrorkenta7777-22/+22
2019-04-01Allow closure to unsafe fn coercionTaiki Endo-2/+3
2019-03-27Rollup merge of #59430 - kenta7777:rename-evalcontext-to-interpretcx, r=oli-obkJosh Stone-1/+1
Renames `EvalContext` to `InterpretCx` This PR renames `EvalContext` to `InterpretCx` in `src/librustc_mir`. This PR is related to #54395 .
2019-03-27renames EvalContext to InterpretCx in docs and comments.kenta7777-1/+1
2019-03-26Rollup merge of #59232 - saleemjaffer:mir_place_refactor, r=oli-obkMazdak Farrokhzad-43/+34
Merge `Promoted` and `Static` in `mir::Place` fixes #53848
2019-03-24Remove `VariantDef::parent_did`Vadim Petrochenkov-2/+1
2019-03-24Separate variant id and variant constructor id.David Wood-1/+2
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-24code review fixesSaleem Jaffer-7/+4
2019-03-23Deduplicate const eval error spans for better outputEsteban Küber-1/+3
2019-03-23Swap const evaluation lint spans to point at problem in primary spanEsteban Küber-0/+11
2019-03-23adding mir::StaticKind enum for static and promotedSaleem Jaffer-26/+34
2019-03-20remove visit_static from librustc::mirSaleem Jaffer-17/+4
2019-03-18cleaner code as per reviewSaleem Jaffer-10/+0
2019-03-18promoted is still left in 2 placesSaleem Jaffer-22/+31
2019-03-16Revert the `LazyConst` PROliver Scherer-17/+14
2019-03-15Auto merge of #58556 - oli-obk:imperative_recursion, r=pnkfelixbors-13/+63
Optimize copying large ranges of undefmask blocks Hopefully fixes #58523
2019-03-15rustc: slice substs in ty::print instead of passing the full ones.Eduard-Mihai Burtescu-1/+1
2019-03-15rustc: remove PrintCx from ty::Print and rely on printers carrying TyCtxt.Eduard-Mihai Burtescu-4/+5
2019-03-15rustc: don't thread existential projections through path_generic_args.Eduard-Mihai Burtescu-1/+1