summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2016-01-08Change destination accessor to return referencesSimonas Kazlauskas-1/+1
Previously it was returning a value, mostly for the two reasons: * Cloning Lvalue is very cheap most of the time (i.e. when Lvalue is not a Projection); * There’s users who want &mut lvalue and there’s users who want &lvalue. Returning a value allows to make either one easier when pattern matching (i.e. Some(ref dest) or Some(ref mut dest)). However, I’m now convinced this is an invalid approach. Namely the users which want a mutable reference may modify the Lvalue in-place, but the changes won’t be reflected in the final MIR, since the Lvalue modified is merely a clone. Instead, we have two accessors `destination` and `destination_mut` which return a reference to the destination in desired mode.
2016-01-06Merge Call and DivergingCall diffs into CallKindSimonas Kazlauskas-7/+3
This merges two separate Call terminators and uses a separate CallKind sub-enum instead. A little bit unrelatedly, copying into destination value for a certain kind of invoke, is also implemented here. See the associated comment in code for various details that arise with this implementation.
2016-01-06Remove diverge terminatorSimonas Kazlauskas-19/+12
Unreachable terminator can be contained all within the trans.
2016-01-06Remove the Panic block terminatorSimonas Kazlauskas-2/+1
2016-01-06Add Resume Terminator which corresponds to resumeSimonas Kazlauskas-0/+1
Diverge should eventually go away
2016-01-06Split Call into Call and DivergingCallSimonas Kazlauskas-13/+8
DivergingCall is different enough from the regular converging Call to warrant the split. This also inlines CallData struct and creates a new CallTargets enum in order to have a way to differentiate between calls that do not have an associated cleanup block. Note, that this patch still does not produce DivergingCall terminator anywhere. Look for that in the next patches.
2015-12-10MIR: Refactor mir::Terminator to use tuples instead of a fixed-size arrays.Michael Woerister-4/+7
2015-11-30Move the core MIR datastructures to librustc.Michael Woerister-4/+4
This is done mostly so that we can refer to MIR types in csearch and other metadata related area.
2015-11-18MIR: Add pass that erases all regions right before transMichael Woerister-4/+239
2015-11-12Add a MIR pass to simplify the control flow graphBjörn Steinbrink-0/+204
For now, this pass does some easy transformations, like eliminating empty blocks that just jump to another block, some trivial conversion of If terminators into Gotos and removal of dead blocks.