Auto merge of #38217 - oli-obk:mir-for-all-and-all-for-mir, r=eddyb

add a -Z flag to guarantee that MIR is generated for all functions

r? @eddyb

cc @solson
This commit is contained in:
bors 2016-12-10 03:49:38 +00:00
commit d53f39e1e5
6 changed files with 53 additions and 12 deletions

View file

@ -355,6 +355,11 @@ pub trait CrateStore<'tcx> {
fn get_item_mir<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId) -> Mir<'tcx>;
fn is_item_mir_available(&self, def: DefId) -> bool;
/// Take a look if we need to inline or monomorphize this. If so, we
/// will emit code for this item in the local crate, and thus
/// create a translation item for it.
fn can_have_local_instance<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId) -> bool;
// This is basically a 1-based range of ints, which is a little
// silly - I may fix that.
fn crates(&self) -> Vec<CrateNum>;
@ -528,6 +533,9 @@ impl<'tcx> CrateStore<'tcx> for DummyCrateStore {
fn is_item_mir_available(&self, def: DefId) -> bool {
bug!("is_item_mir_available")
}
fn can_have_local_instance<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId) -> bool {
bug!("can_have_local_instance")
}
// This is basically a 1-based range of ints, which is a little
// silly - I may fix that.

View file

@ -928,6 +928,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"print some statistics about AST and HIR"),
mir_stats: bool = (false, parse_bool, [UNTRACKED],
"print some statistics about MIR"),
always_encode_mir: bool = (false, parse_bool, [TRACKED],
"encode MIR of all functions into the crate metadata"),
}
pub fn default_lib_output() -> CrateType {