diff options
| author | bors <bors@rust-lang.org> | 2015-11-13 20:18:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-11-13 20:18:18 +0000 |
| commit | 5f2ffe0066b901efd12efee92562ffc5c21f9b4b (patch) | |
| tree | 70214f73d7a254af93f7f7c7cbfe49f7b5796694 | |
| parent | 3beb159809d2f1c9daf9c73d8fd62a4383742bc4 (diff) | |
| parent | 83af140b40b010efa1d73cd9083c6bb6a11f8f7a (diff) | |
| download | rust-5f2ffe0066b901efd12efee92562ffc5c21f9b4b.tar.gz rust-5f2ffe0066b901efd12efee92562ffc5c21f9b4b.zip | |
Auto merge of #29806 - tsion:compile-state-mir_map, r=nikomatsakis
This allows "rustc drop-in replacement" programs like https://github.com/nrc/stupid-stats to access the MIR map. Working toy example: https://gist.github.com/tsion/288423389e32eb73bb39 r? @nikomatsakis
| -rw-r--r-- | src/librustc_driver/driver.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index f2ca3652659..2d7f5544402 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -150,6 +150,7 @@ pub fn compile_input(sess: Session, &expanded_crate, tcx.map.krate(), &analysis, + &mir_map, tcx, &lcx, &id); @@ -275,6 +276,7 @@ pub struct CompileState<'a, 'ast: 'a, 'tcx: 'a> { pub expanded_crate: Option<&'a ast::Crate>, pub hir_crate: Option<&'a hir::Crate>, pub ast_map: Option<&'a hir_map::Map<'ast>>, + pub mir_map: Option<&'a MirMap<'tcx>>, pub analysis: Option<&'a ty::CrateAnalysis<'a>>, pub tcx: Option<&'a ty::ctxt<'tcx>>, pub lcx: Option<&'a LoweringContext<'a>>, @@ -298,6 +300,7 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> { hir_crate: None, ast_map: None, analysis: None, + mir_map: None, tcx: None, lcx: None, trans: None, @@ -350,12 +353,14 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> { krate: &'a ast::Crate, hir_crate: &'a hir::Crate, analysis: &'a ty::CrateAnalysis, + mir_map: &'a MirMap<'tcx>, tcx: &'a ty::ctxt<'tcx>, lcx: &'a LoweringContext<'a>, crate_name: &'a str) -> CompileState<'a, 'ast, 'tcx> { CompileState { analysis: Some(analysis), + mir_map: Some(mir_map), tcx: Some(tcx), krate: Some(krate), hir_crate: Some(hir_crate), |
