Skip to content

Commit c7fb1e2

Browse files
committed
Extract rustc_mir_pretty crate
1 parent 8b09ba6 commit c7fb1e2

File tree

31 files changed

+86
-36
lines changed

31 files changed

+86
-36
lines changed

Cargo.lock

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3670,6 +3670,7 @@ dependencies = [
36703670
"rustc_lexer",
36713671
"rustc_middle",
36723672
"rustc_mir_dataflow",
3673+
"rustc_mir_pretty",
36733674
"rustc_serialize",
36743675
"rustc_session",
36753676
"rustc_span",
@@ -3782,6 +3783,7 @@ dependencies = [
37823783
"rustc_macros",
37833784
"rustc_middle",
37843785
"rustc_mir_dataflow",
3786+
"rustc_mir_pretty",
37853787
"rustc_query_system",
37863788
"rustc_session",
37873789
"rustc_span",
@@ -3839,6 +3841,7 @@ dependencies = [
38393841
"rustc_lint",
38403842
"rustc_metadata",
38413843
"rustc_middle",
3844+
"rustc_mir_pretty",
38423845
"rustc_parse",
38433846
"rustc_plugin_impl",
38443847
"rustc_save_analysis",
@@ -4132,8 +4135,6 @@ version = "0.0.0"
41324135
dependencies = [
41334136
"bitflags",
41344137
"chalk-ir",
4135-
"either",
4136-
"gsgdt",
41374138
"polonius-engine",
41384139
"rand 0.8.4",
41394140
"rand_xoshiro 0.6.0",
@@ -4146,7 +4147,6 @@ dependencies = [
41464147
"rustc_data_structures",
41474148
"rustc_errors",
41484149
"rustc_feature",
4149-
"rustc_graphviz",
41504150
"rustc_hir",
41514151
"rustc_index",
41524152
"rustc_macros",
@@ -4195,6 +4195,7 @@ dependencies = [
41954195
"rustc_hir",
41964196
"rustc_index",
41974197
"rustc_middle",
4198+
"rustc_mir_pretty",
41984199
"rustc_serialize",
41994200
"rustc_session",
42004201
"rustc_span",
@@ -4203,6 +4204,23 @@ dependencies = [
42034204
"tracing",
42044205
]
42054206

4207+
[[package]]
4208+
name = "rustc_mir_pretty"
4209+
version = "0.0.0"
4210+
dependencies = [
4211+
"either",
4212+
"gsgdt",
4213+
"rustc_data_structures",
4214+
"rustc_graphviz",
4215+
"rustc_hir",
4216+
"rustc_index",
4217+
"rustc_middle",
4218+
"rustc_session",
4219+
"rustc_span",
4220+
"rustc_target",
4221+
"tracing",
4222+
]
4223+
42064224
[[package]]
42074225
name = "rustc_mir_transform"
42084226
version = "0.0.0"
@@ -4218,6 +4236,7 @@ dependencies = [
42184236
"rustc_index",
42194237
"rustc_middle",
42204238
"rustc_mir_dataflow",
4239+
"rustc_mir_pretty",
42214240
"rustc_query_system",
42224241
"rustc_serialize",
42234242
"rustc_session",

compiler/rustc_borrowck/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ rustc_lexer = { path = "../rustc_lexer" }
2222
rustc_middle = { path = "../rustc_middle" }
2323
rustc_const_eval = { path = "../rustc_const_eval" }
2424
rustc_mir_dataflow = { path = "../rustc_mir_dataflow" }
25+
rustc_mir_pretty = { path = "../rustc_mir_pretty" }
2526
rustc_serialize = { path = "../rustc_serialize" }
2627
rustc_session = { path = "../rustc_session" }
2728
rustc_target = { path = "../rustc_target" }

compiler/rustc_borrowck/src/nll.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use rustc_data_structures::vec_map::VecMap;
44
use rustc_errors::Diagnostic;
55
use rustc_index::vec::IndexVec;
66
use rustc_infer::infer::InferCtxt;
7-
use rustc_middle::mir::{create_dump_file, dump_enabled, dump_mir, PassWhere};
87
use rustc_middle::mir::{
98
BasicBlock, Body, ClosureOutlivesSubject, ClosureRegionRequirements, LocalKind, Location,
109
Promoted,
1110
};
1211
use rustc_middle::ty::{self, OpaqueTypeKey, RegionKind, RegionVid, Ty};
12+
use rustc_mir_pretty::{create_dump_file, dump_enabled, dump_mir, PassWhere};
1313
use rustc_span::symbol::sym;
1414
use std::env;
1515
use std::fmt::Debug;

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub(crate) fn codegen_fn<'tcx>(
2222
let mir = tcx.instance_mir(instance.def);
2323
let _mir_guard = crate::PrintOnPanic(|| {
2424
let mut buf = Vec::new();
25-
rustc_middle::mir::write_mir_pretty(tcx, Some(instance.def_id()), &mut buf).unwrap();
25+
rustc_mir_pretty::write_mir_pretty(tcx, Some(instance.def_id()), &mut buf).unwrap();
2626
String::from_utf8_lossy(&buf).into_owned()
2727
});
2828

compiler/rustc_codegen_cranelift/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extern crate rustc_incremental;
1717
extern crate rustc_index;
1818
extern crate rustc_interface;
1919
extern crate rustc_metadata;
20+
extern crate rustc_mir_pretty;
2021
extern crate rustc_session;
2122
extern crate rustc_span;
2223
extern crate rustc_target;

compiler/rustc_const_eval/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ rustc_infer = { path = "../rustc_infer" }
1919
rustc_macros = { path = "../rustc_macros" }
2020
rustc_middle = { path = "../rustc_middle" }
2121
rustc_mir_dataflow = { path = "../rustc_mir_dataflow" }
22+
rustc_mir_pretty = { path = "../rustc_mir_pretty" }
2223
rustc_query_system = { path = "../rustc_query_system" }
2324
rustc_session = { path = "../rustc_session" }
2425
rustc_target = { path = "../rustc_target" }

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ use rustc_errors::ErrorReported;
1010
use rustc_hir::def::DefKind;
1111
use rustc_middle::mir;
1212
use rustc_middle::mir::interpret::ErrorHandled;
13-
use rustc_middle::mir::pretty::display_allocation;
1413
use rustc_middle::traits::Reveal;
1514
use rustc_middle::ty::layout::LayoutOf;
1615
use rustc_middle::ty::print::with_no_trimmed_paths;
1716
use rustc_middle::ty::{self, subst::Subst, TyCtxt};
17+
use rustc_mir_pretty::display_allocation;
1818
use rustc_span::source_map::Span;
1919
use rustc_target::abi::Abi;
2020
use std::borrow::Cow;

compiler/rustc_const_eval/src/interpret/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use std::ptr;
1515

1616
use rustc_ast::Mutability;
1717
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
18-
use rustc_middle::mir::display_allocation;
1918
use rustc_middle::ty::{Instance, ParamEnv, TyCtxt};
19+
use rustc_mir_pretty::display_allocation;
2020
use rustc_target::abi::{Align, HasDataLayout, Size, TargetDataLayout};
2121

2222
use super::{

compiler/rustc_driver/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ rustc_feature = { path = "../rustc_feature" }
2222
rustc_hir = { path = "../rustc_hir" }
2323
rustc_hir_pretty = { path = "../rustc_hir_pretty" }
2424
rustc_metadata = { path = "../rustc_metadata" }
25+
rustc_mir_pretty = { path = "../rustc_mir_pretty" }
2526
rustc_const_eval = { path = "../rustc_const_eval" }
2627
rustc_parse = { path = "../rustc_parse" }
2728
rustc_plugin_impl = { path = "../rustc_plugin_impl" }

compiler/rustc_driver/src/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use rustc_errors::ErrorReported;
66
use rustc_hir as hir;
77
use rustc_hir_pretty as pprust_hir;
88
use rustc_middle::hir::map as hir_map;
9-
use rustc_middle::mir::{write_mir_graphviz, write_mir_pretty};
109
use rustc_middle::ty::{self, TyCtxt};
10+
use rustc_mir_pretty::{write_mir_graphviz, write_mir_pretty};
1111
use rustc_session::config::{Input, PpAstTreeMode, PpHirMode, PpMode, PpSourceMode};
1212
use rustc_session::Session;
1313
use rustc_span::symbol::Ident;

0 commit comments

Comments
 (0)