Store THIR in IndexVec
s instead of an Arena
This commit is contained in:
parent
e78bccfbc0
commit
dc3eabd487
18 changed files with 686 additions and 633 deletions
|
@ -9,14 +9,12 @@ use rustc_hir_pretty as pprust_hir;
|
|||
use rustc_middle::hir::map as hir_map;
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_mir::util::{write_mir_graphviz, write_mir_pretty};
|
||||
use rustc_mir_build::thir;
|
||||
use rustc_session::config::{Input, PpAstTreeMode, PpHirMode, PpMode, PpSourceMode};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::Ident;
|
||||
use rustc_span::FileName;
|
||||
|
||||
use std::cell::Cell;
|
||||
use std::fmt::Write;
|
||||
use std::path::Path;
|
||||
|
||||
pub use self::PpMode::*;
|
||||
|
@ -491,18 +489,8 @@ fn print_with_analysis(
|
|||
}
|
||||
|
||||
ThirTree => {
|
||||
let mut out = String::new();
|
||||
abort_on_err(rustc_typeck::check_crate(tcx), tcx.sess);
|
||||
debug!("pretty printing THIR tree");
|
||||
for did in tcx.body_owners() {
|
||||
let hir = tcx.hir();
|
||||
let body = hir.body(hir.body_owned_by(hir.local_def_id_to_hir_id(did)));
|
||||
let arena = thir::Arena::default();
|
||||
let thir =
|
||||
thir::build_thir(tcx, ty::WithOptConstParam::unknown(did), &arena, &body.value);
|
||||
let _ = writeln!(out, "{:?}:\n{:#?}\n", did, thir);
|
||||
}
|
||||
out
|
||||
// FIXME(rust-lang/project-thir-unsafeck#8)
|
||||
todo!()
|
||||
}
|
||||
|
||||
_ => unreachable!(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue