Skip to content

Instantly share code, notes, and snippets.

@qnighy
Created May 19, 2019 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qnighy/2c337af8661b39967dcc05ab87951efc to your computer and use it in GitHub Desktop.
Save qnighy/2c337af8661b39967dcc05ab87951efc to your computer and use it in GitHub Desktop.
rustc phases memo
- https://github.com/rust-lang/rust/blob/1.34.2/src/librustc_driver/driver.rs
- https://github.com/rust-lang/rust/blob/1.34.2/src/librustc_typeck/lib.rs
compile_input
phase_1_parse_input
parsing: syntax::parse::parse_crate_from_*
phase_2_configure_and_expand
attributes injection: syntax::attr::inject
(various setups like features, crate types and disambiguator)
recursion limit: rustc::middle::recursion_limit::update_limits
crate injection: syntax::std_inject::maybe_inject_crates_ref
plugin loading: rustc_plugin::load::load_plugins
plugin registration: _
(lints)
pre ast expansion lint checks: rustc::lint::check_ast_crate
(resolver generation)
builtin registration: syntax_ext::register_builtins
expansion: syntax::ext::base::ExtCtxt
expand crate: expand_crate
check unused macros: check_unused_macros
maybe building test harness: syntax::test::modify_for_testing
AST validation: rustc_passes::ast_validation::check_crate
maybe creating a macro crate: syntax_ext::proc_macro_decls::modify
creating allocators: rustc_allocator::expand::modify
name resolution: rustc_resolve::Resolver::resolve_crate
complete gated feature checking: syntax::feature_gate::check_crate
lowering ast -> hir: rustc::hir::lowering::lower_crate
early lint checks: rustc::lint::check_ast_crate
indexing hir: rustc::hir::map::map_crate
phase_3_run_analysis_passes
load query result cache: rustc_incremental::load_query_result_cache
(TyCtxt generation)
dep graph tcx init: rustc_incremental::dep_graph_tcx_init
looking for entry point: rustc::middle::entry::find_entry_point
looking for plugin registrar: rustc_plugin::build::find_plugin_registrar
looking for derive registrar: rustc_driver::proc_macro_decls::find
loop checking: rustc_passes::loops
attribute checking: rustc::hir::check_attr::check_crate
stability checking: rustc::middle::stability::check_unstable_api_usage
typeck: rustc_typeck::check_crate
type collecting: rustc_typeck::collect::collect_item_types
outlives testing: rustc_typeck::outlives::test::test_inferred_outlives
impl wf inference: rustc_typeck::impl_wf_Check::impl_wf_check
coherence checking: rustc_typeck::coherence::check_coherence
wf checking: rustc_typeck::check::check_wf_new
item-types checking: rustc_typeck::check::check_item_types
item-bodies checking: rustc_typeck::check::check_item_bodies
(unusedness checking: rustc_typeck::check_unused::check_crate)
(entry fn checking: rustc_typeck::check_for_entry_fn)
misc checking:
rvalue promotion: rustc_passes::rvalue_promotion
intrinsic checking: rustc::middle::intrinsicck::check_crate
match checking: rustc_mir::matchck_crate
liveness checking: rustc::middle::liveness::check_crate
borrow checking: rustc_borrowck::check_crate
MIR borrow checking: rustc_mir::borrow_check::mir_borrowck
dumping chalk-like clauses: rustc_traits::lowering::dump_program_clauses
MIR effect checking: rustc_mir::transform::check_unsafety::check_unsafety
layout testing: rustc_passes::layout_test::test_layout
miec checking:
privacy checking: rustc_privacy::check_crate
death checking: rustc::middle::dead::check_crate
unused lib feature checking: rustc::middle::stability::check_unused_or_stable_features
lint checking: rustc::lint::check_crate
phase_4_codegen
resolving dependency formats: rustc::middle::dependency_format::calculate
codegen: rustc_codegen_utils::codegen_backend
(emit MIR if requested)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment