summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2016-11-03A way to remove otherwise unused locals from MIRSimonas Kazlauskas-15/+105
Replaces the hack where a similar thing is done within trans.
2016-10-28rustc: move the MIR map into TyCtxt.Eduard Burtescu-105/+74
2016-10-28rustc: move mir::repr::* to mir.Eduard Burtescu-15/+14
2016-10-06Rollup merge of #36959 - arielb1:simplify-cfg-fixes, r=eddybJonathan Turner-2/+13
fix pred_count accounting in SimplifyCfg r? @eddyb
2016-10-04Remove some unused methods from metadataVadim Petrochenkov-5/+1
Address comments + Fix rebase
2016-10-04Eliminate ty::VariantKind in favor of def::CtorKindVadim Petrochenkov-2/+2
2016-10-04SimplifyCfg: don't incref target when collapsing a goto with 1 predAriel Ben-Yehuda-2/+10
2016-10-04SimplifyCfg: simplify the start blockAriel Ben-Yehuda-0/+3
2016-09-26Fix tidyJonas Schievink-1/+4
2016-09-26promote_consts: make assign take a LocalJonas Schievink-4/+4
2016-09-26Rename MIR local iterators to match conventionJonas Schievink-2/+2
2016-09-26[WIP] Move MIR towards a single kind of localJonas Schievink-128/+141
2016-09-24librustc_mir: Propagate constants during copy propagation.Patrick Walton-59/+213
This optimization kicks in a lot when bootstrapping the compiler.
2016-09-21Auto merge of #36551 - eddyb:meta-games, r=nikomatsakisbors-1/+2
Refactor away RBML from rustc_metadata. RBML and `ty{en,de}code` have had their long-overdue purge. Summary of changes: * Metadata is now a tree encoded in post-order and with relative backward references pointing to children nodes. With auto-deriving and type safety, this makes maintenance and adding new information to metadata painless and bug-free by default. It's also more compact and cache-friendly (cache misses should be proportional to the depth of the node being accessed, not the number of siblings as in EBML/RBML). * Metadata sizes have been reduced, for `libcore` it went down 16% (`8.38MB` -> `7.05MB`) and for `libstd` 14% (`3.53MB` -> `3.03MB`), while encoding more or less the same information * Specialization is used in the bundled `libserialize` (crates.io `rustc_serialize` remains unaffected) to customize the encoding (and more importantly, decoding) of various types, most notably those interned in the `TyCtxt`. Some of this abuses a soundness hole pending a fix (cc @aturon), but when that fix arrives, we'll move to macros 1.1 `#[derive]` and custom `TyCtxt`-aware serialization traits. * Enumerating children of modules from other crates is now orthogonal to describing those items via `Def` - this is a step towards bridging crate-local HIR and cross-crate metadata * `CrateNum` has been moved to `rustc` and both it and `NodeId` are now newtypes instead of `u32` aliases, for specializing their decoding. This is `[syntax-breaking]` (cc @Manishearth ). cc @rust-lang/compiler
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-1/+2
2016-09-19librustc: Implement def-use chains and trivial copy propagation on MIR.Patrick Walton-3/+186
This only supports trivial cases in which there is exactly one def and one use.
2016-09-19librustc: Add a new nop statement to the MIR.Patrick Walton-1/+3
This is useful when passes want to remove statements without affecting `Location`s.
2016-09-16librustc_mir: Remove `&*x` when `x` has a reference type.Patrick Walton-0/+112
This introduces a new `InstCombine` pass for us to place such peephole optimizations.
2016-09-08Refactor `TyStruct`/`TyEnum`/`TyUnion` into `TyAdt`Vadim Petrochenkov-9/+7
2016-09-06Count and report time taken by MIR passesSimonas Kazlauskas-4/+4
2016-09-04Auto merge of #36203 - petrochenkov:uvsdot, r=nrcbors-7/+7
Replace `_, _` with `..` in patterns This is how https://github.com/rust-lang/rust/issues/33627 looks in action. Looks especially nice in leftmost/rightmost positions `(first, ..)`/`(.., last)`. I haven't touched libsyntax intentionally because the feature is still unstable.
2016-09-04Rollup merge of #36212 - razielgn:updated-e0493-to-new-format, r=jonathandturnerManish Goregaokar-0/+33
Updated e0493 to new format (+ bonus). Part of #35233. Fixes #35999. r? @jonathandturner I'm not satisfied with the bonus part, there has to be an easier way to reach into the `Drop`'s span implementation. I'm all ears. :)
2016-09-04Replace `_, _` with `..`Vadim Petrochenkov-6/+6
2016-09-04Replace `_, _, _` with `..`Vadim Petrochenkov-1/+1
2016-09-03Fix buggy field access translationVadim Petrochenkov-3/+3
2016-09-03Some better support for unions through the compilerVadim Petrochenkov-1/+3
2016-09-02E0493: showing a label where the destructor is defined.Federico Ravasio-0/+29
2016-09-01turn the RFC1592 warnings into hard errorsAriel Ben-Yehuda-4/+0
The warnings have already reached stable The test rfc1592_deprecated is covered by `bad_sized` and `unsized6`. Fixes #33242 Fixes #33243
2016-08-31Updated E0493 to new format.Federico Ravasio-0/+4
2016-08-27Auto merge of #36030 - Manishearth:rollup, r=Manishearthbors-1/+1
Rollup of 7 pull requests - Successful merges: #35124, #35877, #35953, #36002, #36004, #36005, #36014 - Failed merges:
2016-08-26Auto merge of #35542 - scottcarr:visitor_refactor, r=nikomatsakisbors-78/+77
[MIR] track Location in MirVisitor, combine Location All the users of MirVisitor::visit_statement implement their own statement index tracking. This PR move the tracking into MirVisitor itself. Also, there were 2 separate implementations of Location that were identical. This PR eliminates one of them.
2016-08-27rustc: use accessors for Substs::{types,regions}.Eduard Burtescu-1/+1
2016-08-26fix port for visit_statementScott A Carr-3/+14
2016-08-20Rollup merge of #35780 - clementmiao:E0396_new_err_format, r=jonathandturnerJonathan Turner-3/+7
updated E0396 to new error format Updated E0396 to new error format. Part of #35233 Fixes #35779 Thanks again for letting me help! r? @jonathandturner
2016-08-20Rollup merge of #35778 - clementmiao:E0395_new_error_format, r=jonathandturnerJonathan Turner-3/+8
updated E0395 to new error format Updated E0395 to new error format. Part of #35233 Fixes #35693 Thanks again for letting me help! r? @jonathandturner
2016-08-18track Location in visitor, combine LocationScott A Carr-88/+76
2016-08-17updated E0396 to new error formatclementmiao-3/+7
2016-08-17updated E0395 to new error formatclementmiao-3/+8
2016-08-17Updated E0394 to new error messageKnight-1/+4
2016-08-16Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakisbors-28/+18
Implement the `!` type This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.
2016-08-14[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}.Eduard Burtescu-19/+41
2016-08-13Rename empty/bang to neverAndrew Cann-1/+2
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Remove obsolete divergence related stuffAndrew Cann-28/+15
Replace FnOutput with Ty Replace FnConverging(ty) with ty Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-13Switch on TyEmptyAndrew Cann-3/+5
Parse -> ! as FnConverging(!) Add AdjustEmptyToAny coercion to all ! expressions Some fixes
2016-08-13Auto merge of #35348 - scottcarr:discriminant2, r=nikomatsakisbors-17/+73
[MIR] Add explicit SetDiscriminant StatementKind for deaggregating enums cc #35186 To deaggregate enums, we need to be able to explicitly set the discriminant. This PR implements a new StatementKind that does that. I think some of the places that have `panics!` now could maybe do something smarter.
2016-08-12rustc: rename ProjectionMode and its variant to be more memorable.Eduard Burtescu-4/+4
2016-08-11Auto merge of #35592 - jonathandturner:rollup, r=jonathandturnerbors-3/+6
Rollup of 23 pull requests - Successful merges: #35279, #35331, #35358, #35375, #35445, #35448, #35482, #35486, #35505, #35528, #35530, #35532, #35536, #35537, #35541, #35552, #35554, #35555, #35557, #35562, #35565, #35569, #35576 - Failed merges: #35395, #35415, #35563
2016-08-11add SetDiscriminant StatementKind to enable deaggregation of enumsScott A Carr-17/+73
2016-08-11Rollup merge of #35445 - pcn:update-E0017-to-new-format, r=arielb1Jonathan Turner-3/+6
Update e0017 to new format Updated `span_err!` to use `struct_span_err!` and provide a `span_label` that describes the error in context. Updated the test to look for the `span_label`s that are provided now.
2016-08-11Auto merge of #35403 - scottcarr:lvalue_refactor, r=nikomatsakisbors-28/+26
refactor lvalue_ty to be method of lvalue Currently `Mir` (and `MirContext`) implement a method `lvalue_ty` (and actually many more `foo_ty`). But this should be a method of `Lvalue`. If you have an `lvalue` and you want to get its type, the natural thing to write is: ``` lvalue.ty() ``` Of course it needs context, but still: ``` lvalue.ty(mir, tcx) ``` Makes more sense than ``` mir.lvalue_ty(lvalue, tcx) ``` I actually think we should go a step farther and have traits so we could get the type of some value generically, but that's up for debate. The thing I'm running into a lot in the compiler is I have a value of type `Foo` and I know that there is some related type `Bar` which I can get through some combination of method calls, but it's often not as direct as I would imagine. Unless you already know the code, its not clear why you would look in `Mir` for a method to get the type of an `Lvalue`.