Skip to content

Commit faa9ec8

Browse files
committed
add MIR crate and link it into the driver
1 parent 6a2ca37 commit faa9ec8

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

mk/crates.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ TARGET_CRATES := libc std flate arena term \
5454
log graphviz core rbml alloc \
5555
rustc_unicode rustc_bitflags \
5656
alloc_system
57-
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
57+
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics
6060
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
@@ -70,11 +70,12 @@ DEPS_std := core libc rand alloc collections rustc_unicode \
7070
DEPS_graphviz := std
7171
DEPS_syntax := std term serialize log fmt_macros arena libc rustc_bitflags
7272
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
73-
rustc_typeck rustc_resolve log syntax serialize rustc_llvm \
73+
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
7474
rustc_trans rustc_privacy rustc_lint rustc_front
7575

7676
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
7777
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
78+
DEPS_rustc_mir := rustc rustc_front syntax
7879
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics
7980
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
8081
DEPS_rustc_resolve := rustc rustc_front log syntax

src/librustc_driver/driver.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use rustc::front;
1212
use rustc::front::map as hir_map;
13+
use rustc_mir as mir;
1314
use rustc::session::Session;
1415
use rustc::session::config::{self, Input, OutputFilenames};
1516
use rustc::session::search_paths::PathKind;
@@ -706,6 +707,9 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: Session,
706707
// passes are timed inside typeck
707708
typeck::check_crate(tcx, trait_map);
708709

710+
time(time_passes, "MIR dump", ||
711+
mir::dump::dump_crate(tcx));
712+
709713
time(time_passes, "const checking", ||
710714
middle::check_const::check_crate(tcx));
711715

src/librustc_driver/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ extern crate rustc_borrowck;
4545
extern crate rustc_front;
4646
extern crate rustc_lint;
4747
extern crate rustc_privacy;
48+
extern crate rustc_mir;
4849
extern crate rustc_resolve;
4950
extern crate rustc_trans;
5051
extern crate rustc_typeck;

0 commit comments

Comments
 (0)