]> git.lizzy.rs Git - rust.git/commit
retool MIR passes completely
authorNiko Matsakis <niko@alum.mit.edu>
Thu, 27 Apr 2017 20:48:48 +0000 (16:48 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 2 May 2017 18:01:01 +0000 (14:01 -0400)
commit2b32cb90c72d90c722d56324ca0ea9f748ebf4e1
tree0cfe6e0ea8e729d8c0d3ec2781201a1ea5e6a01f
parentf23a7bc98a221db000991f6a618602a9a4b35759
retool MIR passes completely

The new setup is as follows. There is a pipeline of MIR passes that each
run **per def-id** to optimize a particular function. You are intended
to request MIR at whatever stage you need it. At the moment, there is
only one stage you can request:

- `optimized_mir(def_id)`

This yields the final product. Internally, it pulls the MIR for the
given def-id through a series of steps. Right now, these are still using
an "interned ref-cell" but they are intended to "steal" from one
another:

- `mir_build` -- performs the initial construction for local MIR
- `mir_pass_set` -- performs a suite of optimizations and transformations
- `mir_pass` -- an individual optimization within a suite

So, to construct the optimized MIR, we invoke:

    mir_pass_set((MIR_OPTIMIZED, def_id))

which will build up the final MIR.
13 files changed:
src/librustc/mir/transform.rs
src/librustc/ty/maps.rs
src/librustc/ty/mod.rs
src/librustc_driver/driver.rs
src/librustc_metadata/cstore_impl.rs
src/librustc_mir/lib.rs
src/librustc_mir/mir_map.rs
src/librustc_mir/transform/dump_mir.rs
src/librustc_mir/transform/inline.rs
src/librustc_mir/transform/mod.rs
src/librustc_mir/transform/qualify_consts.rs
src/librustc_mir/util/mod.rs
src/librustc_mir/util/pretty.rs