Skip to content

Commit 61cb1ba

Browse files
committed
Add compiler option to keep mtwt tables
This is so that the resolution results can be used after analysis, potentially for tool support
1 parent f18c2aa commit 61cb1ba

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/librustc/session/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
601601
"For every macro invocation, print its name and arguments"),
602602
enable_nonzeroing_move_hints: bool = (false, parse_bool,
603603
"Force nonzeroing move optimization on"),
604+
keep_mtwt_tables: bool = (false, parse_bool,
605+
"Don't clear the resolution tables after analysis"),
604606
}
605607

606608
pub fn default_lib_output() -> CrateType {

src/librustc_driver/driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,9 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: Session,
671671
|| resolve::resolve_crate(&sess, &ast_map, make_glob_map));
672672

673673
// Discard MTWT tables that aren't required past resolution.
674-
syntax::ext::mtwt::clear_tables();
674+
if !sess.opts.debugging_opts.keep_mtwt_tables {
675+
syntax::ext::mtwt::clear_tables();
676+
}
675677

676678
let named_region_map = time(time_passes, "lifetime resolution",
677679
|| middle::resolve_lifetime::krate(&sess, krate, &def_map));

0 commit comments

Comments
 (0)