Rollup merge of #81252 - jyn514:resolve-timing, r=petrochenkov

Add more self-profile info to rustc_resolve

The idea is to help me find out where the time is being spent in compiling the docs for `windows-rs`: https://github.com/microsoft/windows-rs/issues/420#issuecomment-764991646
This commit is contained in:
Jonas Schievink 2021-01-23 20:16:09 +01:00 committed by GitHub
commit 7038bb1eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1465,16 +1465,14 @@ fn macro_def(&self, mut ctxt: SyntaxContext) -> DefId {
/// Entry point to crate resolution.
pub fn resolve_crate(&mut self, krate: &Crate) {
let _prof_timer = self.session.prof.generic_activity("resolve_crate");
ImportResolver { r: self }.finalize_imports();
self.finalize_macro_resolutions();
self.late_resolve_crate(krate);
self.check_unused(krate);
self.report_errors(krate);
self.crate_loader.postprocess(krate);
self.session.time("resolve_crate", || {
self.session.time("finalize_imports", || ImportResolver { r: self }.finalize_imports());
self.session.time("finalize_macro_resolutions", || self.finalize_macro_resolutions());
self.session.time("late_resolve_crate", || self.late_resolve_crate(krate));
self.session.time("resolve_check_unused", || self.check_unused(krate));
self.session.time("resolve_report_errors", || self.report_errors(krate));
self.session.time("resolve_postprocess", || self.crate_loader.postprocess(krate));
});
}
pub fn traits_in_scope(