about summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2017-11-10Separately eliminate self-assignmentssinkuu-4/+39
2017-11-10Fix MIR CopyPropagation errneously propagating assignments to function argumentssinkuu-0/+7
2017-11-10Normalize inlined function in MIR inlinerShotaro Yamada-5/+33
2017-11-10Auto merge of #45785 - arielb1:unsafe-fixes, r=eddybbors-69/+113
fixes to MIR effectck r? @eddyb beta-nominating because regression (MIR effectck is new)
2017-11-09add a bunch of debug logging to transform::inlineAriel Ben-Yehuda-6/+23
2017-11-06Auto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1bors-177/+462
extend NLL with preliminary support for free regions on functions This PR extends https://github.com/rust-lang/rust/pull/45538 with support for free regions. This is pretty preliminary and will no doubt want to change in various ways, particularly as we add support for closures, but it's enough to get the basic idea in place: - We now create specific regions to represent each named lifetime declared on the function. - Region values can contain references to these regions (represented for now as a `BTreeSet<RegionIndex>`). - If we wind up trying to infer that `'a: 'b` must hold, but no such relationship was declared, we report an error. It also does a number of drive-by refactorings. r? @arielb1 cc @spastorino
2017-11-06collect unused unsafe codeAriel Ben-Yehuda-61/+92
FIXME: de-uglify
2017-11-06run unsafety checking before dead block collectionAriel Ben-Yehuda-4/+12
Fixes #45087.
2017-11-06fix unsafety checking for generatorsAriel Ben-Yehuda-7/+12
Fixes #45729
2017-11-02trace span info for constraints and report errorsNiko Matsakis-26/+104
2017-11-02encapsulate the `Region` struct within region inferenceNiko Matsakis-39/+47
2017-11-02add comments to `region_infer`, restructure a bitNiko Matsakis-35/+56
2017-11-02extend NLL regions to include free region indices and add outlivesNiko Matsakis-110/+289
2017-11-02rename `Lookup` to `TyContext` and pass more info when visiting tysNiko Matsakis-23/+22
2017-11-02add TerminatorKind::FalseEdges and use it in matchesMikhail Modin-4/+23
2017-10-31remove the NLL pass (it is now invoked by mir borrowck)Niko Matsakis-23/+2
2017-10-31change region display to `'_#Nr`, update the `newtype_index!` macroNiko Matsakis-1/+1
The macro now takes a format string. It no longer defaults to using the type name. Didn't seem worth going through contortions to maintain. I also changed most of the debug formats to be `foo[N]` instead of `fooN`.
2017-10-31make the dataflow / mir-borrowck types carry a `'tcx` lifetimeNiko Matsakis-5/+5
Also, factor out `do_mir_borrowck`, which is the code that actually performs the MIR borrowck from within the scope of an inference context. This change should be a pure refactoring.
2017-10-31make nll separately invokableNiko Matsakis-29/+13
2017-10-31add basic region subtyping inferenceSantiago Pastorino-0/+112
2017-10-31add reborrow constraintsSantiago Pastorino-0/+35
2017-10-31factor out NLL invocation interfaceNiko Matsakis-76/+123
2017-10-31update the format of liveness debug dumps to be more readableNiko Matsakis-24/+61
2017-10-31add subregion between borrow region and resulting referenceNiko Matsakis-8/+55
2017-10-31preliminary support for may-dangle attribute and drop constraintsNiko Matsakis-13/+113
2017-10-31extend liveness to distinguish "drop" and "non-drop" usesNiko Matsakis-33/+74
2017-10-31introduce liveness constraints into NLL codeNiko Matsakis-209/+329
And do a bunch of gratuitious refactoring that I did not bother to separate into nice commits.
2017-10-31extend liveness to compute intrablock liveness and add unit testsNiko Matsakis-10/+34
2017-10-31execute liveness, write a simple testNiko Matsakis-3/+25
2017-10-13Add License to infer.rsSantiago Pastorino-0/+10
2017-10-13TODO -> FIXMESantiago Pastorino-4/+4
2017-10-13Add allow_dead code directive to unused methodsSantiago Pastorino-0/+5
2017-10-13Do not move infcx, just borrow itSantiago Pastorino-7/+8
2017-10-13borrow block_data instead of moving itSantiago Pastorino-1/+1
2017-10-13sup_def is a mutable referenceSantiago Pastorino-1/+1
2017-10-13inteference_context should be mutSantiago Pastorino-1/+1
2017-10-13Mark Region as publicSantiago Pastorino-1/+1
2017-10-13Mark free regions handling as TODOSantiago Pastorino-9/+10
2017-10-13Initial attempt at implementation of inference layout for nllPaul Faria-5/+224
2017-10-13Auto merge of #45013 - chrisvittal:mir_pretty_printing_pr, r=nikomatsakisbors-7/+38
Extend mir dump to dump each region Building on #44878, implement the feature discussed in #44872. Through discussions on the WG-nll-gitter, @nikomatsakis and I decided to implement this by extending `dump_mir` and all functions that it calls to take a callback of signature `FnMut(PassWhere, &mut Write) -> io::Result<()>` where `PassWhere` is an enum that represents possible locations that we may want to print out extra data in the process of dumping the MIR. I'm not particularly wedded to the name `PassWhere`, but I felt that simply calling the enum `Where` wasn't the right thing to name it. This work depends strongly on #44878, and should be rebased on the final version of that tree, whatever that may be.
2017-10-08Auto merge of #45016 - pnkfelix:mir-borrowck-gather-and-signal-move-errors, ↵bors-2/+2
r=nikomatsakis MIR-borrowck: gather and signal any move errors When building up the `MoveData` structure for a given MIR, also accumulate any erroneous actions, and then report all of those errors when the construction is complete. This PR adds a host of move-related error constructor methods to `trait BorrowckErrors`. I think I got the notes right; but we should plan to audit all of the notes before turning MIR-borrowck on by default. Fix #44830
2017-10-04Expand mir dump in order to handle NLL passChristopher Vittal-7/+38
Extend `dump_mir` and functions it calls in order to allow callers to add custom information. We do this by adding an enum `PassWhere` and an extra argument of type `FnMut(PassWhere, &mut Write) -> io::Result<()>`. This callback is responsible for printing the extra information when MIR is dumped at various stages. For the "nll" pass, use the new mechanism to dump the `Region` information after the header, but before the control flow graph for every function. In the interest of keeping the output somewhat concise, implement a custom Debug impl for `Region` Open Questions: * What should we call what has been called `PassWhere` so far?
2017-10-04Make newtype_index get debug_name using reflectionSantiago Pastorino-1/+1
2017-10-04Make newtype_index macro use full path to resolve constantsSantiago Pastorino-2/+0
2017-10-04Generate Idx in nll using newtype_index!Santiago Pastorino-15/+3
2017-10-04Convert regions to IndexVecSantiago Pastorino-2/+19
2017-10-04Store a new Region value every time we create a new region variablePaul Faria-2/+11
2017-10-04Auto merge of #44901 - michaelwoerister:on-demand-eval, r=nikomatsakisbors-8/+7
incr.comp.: Switch to red/green change tracking, remove legacy system. This PR finally switches incremental compilation to [red/green tracking](https://github.com/rust-lang/rust/issues/42293) and completely removes the legacy dependency graph implementation -- which includes a few quite costly passes that are simply not needed with the new system anymore. There's still some documentation to be done and there's certainly still lots of optimizing and tuning ahead -- but the foundation for red/green is in place with this PR. This has been in the making for a long time `:)` r? @nikomatsakis cc @alexcrichton, @rust-lang/compiler
2017-10-04mir-borrowck: Gather move errors during MoveData construction and report them.Felix S. Klock II-2/+2
Currently is using DUMMY_SP as the associated span; a follow-up commit will pass in appropriate spans when constructing the errors.
2017-10-03Auto merge of #44896 - qmx:move-resolve-to-librustc, r=arielb1bors-11/+17
Move monomorphize::resolve() to librustc this moves `monomorphize::resolve(..)` to librustc, and re-enables inlining for some trait methods, fixing #44389 @nikomatsakis I've kept the calls to the new `ty::Instance::resolve(....)` always `.unwrap()`-ing for the moment, how/do you want to add more debugging info via `.unwrap_or()` or something like this? we still have some related `resolve_*` functions on monomorphize, but I wasn't sure moving them was into the scope for this PR too. @eddyb mind to take a look too?