summary refs log tree commit diff
path: root/src/librustc_mir/build/expr
AgeCommit message (Collapse)AuthorLines
2018-03-14remove defaulting to unitAndrew Cann-1/+1
Types will no longer default to `()`, instead always defaulting to `!`. This disables the associated warning and removes the flag from TyTuple
2018-03-08Use clearer name for integer bit width helper functionOliver Schneider-2/+2
2018-03-08Don't use the undefined bytes of PrimVal::BytesOliver Schneider-27/+11
2018-03-08Nuke ConstInt and Const*sizeOliver Schneider-47/+16
2018-03-08Nuke the entire ctfe from orbit, it's the only way to be sureOliver Schneider-17/+5
2018-03-08Produce instead of pointersOliver Schneider-3/+18
2018-02-07[ci skip] Generate false edges from loop_blockbobtwinkles-24/+22
As opposed to using weirdness involving pretending the body block is the loop block. This does not pass tests This commit is [ci skip] because I know it doesn't pass tests yet. Somehow this commit introduces nondeterminism into the handling of loops.
2018-02-05mir: Add false edge cleanup out of infinite loopsbobtwinkles-5/+17
Fixes #46036
2018-02-05Fix comment in ExprKind::LogicalOpbobtwinkles-2/+2
The comment previously implied that the true branch would result in the false block. Fortunately the implementation is correct.
2018-01-25Fix never-type rvalue ICEvarkor-1/+1
2018-01-04rustc: use {U,I}size instead of {U,I}s shorthands.Eduard-Mihai Burtescu-2/+2
2017-12-21fix debuginfo scoping of let-statementsAriel Ben-Yehuda-1/+1
2017-12-05rustc_mir: don't move temporaries that are still used later.Eduard-Mihai Burtescu-4/+4
2017-12-03funnel all unwind paths through a single Resume blockAriel Ben-Yehuda-1/+1
This simplifies analysis and borrow-checking because liveness at the resume point can always be simply propagated. Later on, the "dead" Resumes are removed.
2017-12-03initialize the destination in unit statementsAriel Ben-Yehuda-1/+3
Fixes #46159.
2017-12-01MIR: s/lv(al(ue)?)?/place in function/variable/module names.Eduard-Mihai Burtescu-37/+37
2017-12-01MIR: s/Lvalue/Place in type names.Eduard-Mihai Burtescu-25/+25
2017-11-28MIR: split Operand::Consume into Copy and Move.Eduard-Mihai Burtescu-17/+17
2017-11-17MIR: hide .rodata constants vs by-ref ABI clash in trans.Eduard-Mihai Burtescu-7/+1
2017-10-26Add comments to clarify function argument ownershipBjörn Steinbrink-0/+2
2017-10-26Avoid unnecessary copies of arguments that are simple bindingsBjörn Steinbrink-1/+5
Initially MIR differentiated between arguments and locals, which introduced a need to add extra copies assigning the argument to a local, even for simple bindings. This differentiation no longer exists, but we're still creating those copies, bloating the MIR and LLVM IR we emit. Additionally, the current approach means that we create debug info for both the incoming argument (marking it as an argument), and then immediately shadow it a local that goes by the same name. This can be confusing when using e.g. "info args" in gdb, or when e.g. a debugger with a GUI displays the function arguments separately from the local variables, especially when the binding is mutable, because the argument doesn't change, while the local variable does.
2017-09-24move unsafety checking to MIRAriel Ben-Yehuda-3/+16
No functional changes intended.
2017-09-24add lint levels to VisibilityScopeAriel Ben-Yehuda-13/+15
2017-09-20address review commentsAriel Ben-Yehuda-1/+5
2017-09-14bring Ty into scopeDouglas Campos-4/+4
2017-09-11rustc: replace usize with u64 and ConstUsize.Eduard-Mihai Burtescu-2/+2
2017-09-11rustc: introduce ty::Const { ConstVal, Ty }.Eduard-Mihai Burtescu-3/+12
2017-09-11rustc: intern ConstVal's in TyCtxt.Eduard-Mihai Burtescu-3/+7
2017-09-05rustc: Store InternedString in `DefPathData`Alex Crichton-1/+1
Previously a `Symbol` was stored there, but this ended up causing hash collisions in situations that otherwise shouldn't have a hash collision. Only the symbol's string value was hashed, but it was possible for distinct symbols to have the same string value, fooling various calcuations into thinking that these paths *didn't* need disambiguating data when in fact they did! By storing `InternedString` instead we're hopefully triggering all the exising logic to disambiguate paths with same-name `Symbol` but actually distinct locations.
2017-09-04rustc_mir: use Local instead of Lvalue in Storage{Live,Dead}.Eduard-Mihai Burtescu-7/+7
2017-09-03rustc_mir: use Local in ProjectionElem::Index.Eduard-Mihai Burtescu-14/+15
2017-09-03Auto merge of #44253 - eddyb:nice-scope, r=nikomatsakisbors-34/+38
rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree. r? @nikomatsakis
2017-09-02rustc_mir: always emit StorageLive even without a matching StorageDead.Eduard-Mihai Burtescu-5/+5
2017-09-01rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree.Eduard-Mihai Burtescu-34/+38
2017-08-25Add some comments and fix a typoJohn Kåre Alsaker-1/+2
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-9/+15
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-7/+7
Like #43008 (f668999), but _much more aggressive_.
2017-08-14emit StorageLive for box temporariesAriel Ben-Yehuda-3/+9
We started emitting StorageDead, so we better emit the corrseponding StorageLive to avoid problems.
2017-08-12Merge branch 'master' of https://github.com/rust-lang/rust into genJohn Kåre Alsaker-7/+7
# Conflicts: # src/librustc_mir/build/scope.rs
2017-08-11Store generator interior in MIR literalsJohn Kåre Alsaker-3/+3
2017-08-10For box expressions, use NZ drop instead of a free blockAriel Ben-Yehuda-7/+7
This falls naturally out of making drop elaboration work with `box` expressions, which is probably required for sane MIR borrow-checking. This is a pure refactoring with no intentional functional effects.
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-2/+2
2017-08-01remove the span field from `diverge_cleanup`Ariel Ben-Yehuda-1/+1
2017-07-28Remove support for `gen arg`Alex Crichton-12/+1
2017-07-28Rename suspend to yieldJohn Kåre Alsaker-5/+5
2017-07-28Generator literal supportJohn Kåre Alsaker-4/+42
2017-06-27rustc: move the PolyFnSig out of TyFnDef.Eduard-Mihai Burtescu-5/+8
2017-06-12Add `EndRegion` statement kind to MIR.Felix S. Klock II-1/+0
* Emit `EndRegion` for every code-extent for which we observe a borrow. To do this, we needed to thread source info back through to `fn in_scope`, which makes this commit a bit more painful than one might have expected. * There is `end_region` emission in `Builder::pop_scope` and in `Builder::exit_scope`; the first handles falling out of a scope normally, the second handles e.g. `break`. * Remove `EndRegion` statements during the erase_regions mir transformation. * Preallocate the terminator block, and throw an `Unreachable` marker on it from the outset. Then overwrite that Terminator as necessary on demand. * Instead of marking the scope as needs_cleanup after seeing a borrow, just treat every scope in the chain as being part of the diverge_block (after any *one* of them has separately signalled that it needs cleanup, e.g. due to having a destructor to run). * Allow for resume terminators to be patched when looking up drop flags. (In particular, `MirPatch::new` has an explicit code path, presumably previously unreachable, that patches up such resume terminators.) * Make `Scope` implement `Debug` trait. * Expanded a stray comment: we do not emit StorageDead on diverging paths, but that end behavior might not be desirable.
2017-06-12Pass span through diverge_cleanup down to build_diverge_scope where itFelix S. Klock II-1/+1
can be used for building the diverge path's terminator.
2017-06-12Paired source_info with extent; thread both through to pts where EndRegion ↵Felix S. Klock II-8/+13
will need construction.