Rollup merge of #38418 - michaelwoerister:def_path_cleanup, r=eddyb

Cleanup refactoring around DefPath handling

This PR makes two big changes:
* All DefPaths of a crate are now stored in metadata in their own table (as opposed to `DefKey`s as part of metadata `Entry`s.
* The compiler will no longer allocate a pseudo-local DefId for inlined HIR nodes (because those are gross). Inlined HIR nodes will have a NodeId but they don't have there own DefId anymore. Turns out they were not needed anymore either. Hopefully HIR inlining will be gone completely one day but if until then we start needing to be able to map inlined NodeIds to original DefIds, we can add an additional table to metadata that allows for reconstructing this.

Overall this makes for some nice simplifications and removal of special cases.

r? @eddyb

cc @rust-lang/compiler
This commit is contained in:
Alex Crichton 2016-12-20 11:16:38 -08:00
commit 21f33dbf71
23 changed files with 238 additions and 532 deletions

View file

@ -136,6 +136,8 @@ pub struct PerfStats {
pub incr_comp_bytes_hashed: Cell<u64>,
// The accumulated time spent on computing symbol hashes
pub symbol_hash_time: Cell<Duration>,
// The accumulated time spent decoding def path tables from metadata
pub decode_def_path_tables_time: Cell<Duration>,
}
impl Session {
@ -501,6 +503,8 @@ impl Session {
self.perf_stats.incr_comp_hashes_count.get());
println!("Total time spent computing symbol hashes: {}",
duration_to_secs_str(self.perf_stats.symbol_hash_time.get()));
println!("Total time spent decoding DefPath tables: {}",
duration_to_secs_str(self.perf_stats.decode_def_path_tables_time.get()));
}
}
@ -635,6 +639,7 @@ pub fn build_session_(sopts: config::Options,
incr_comp_hashes_count: Cell::new(0),
incr_comp_bytes_hashed: Cell::new(0),
symbol_hash_time: Cell::new(Duration::from_secs(0)),
decode_def_path_tables_time: Cell::new(Duration::from_secs(0)),
},
code_stats: RefCell::new(CodeStats::new()),
};