Skip to content

Several changes to the codegen backend organization #65340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 15, 2019
Prev Previous commit
Next Next commit
Add top level provide/provide_extern to cg_ssa and cg_utils
  • Loading branch information
bjorn3 committed Oct 13, 2019
commit ea60335c286f45ea14fb2049b395e1bced2a1b45
11 changes: 11 additions & 0 deletions src/librustc_codegen_ssa/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use rustc::dep_graph::WorkProduct;
use rustc::session::config::{OutputFilenames, OutputType};
use rustc::middle::lang_items::LangItem;
use rustc::hir::def_id::CrateNum;
use rustc::ty::query::Providers;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::svh::Svh;
Expand Down Expand Up @@ -155,3 +156,13 @@ pub struct CodegenResults {
pub linker_info: back::linker::LinkerInfo,
pub crate_info: CrateInfo,
}

pub fn provide(providers: &mut Providers<'_>) {
crate::back::symbol_export::provide(providers);
crate::base::provide_both(providers);
}

pub fn provide_extern(providers: &mut Providers<'_>) {
crate::back::symbol_export::provide_extern(providers);
crate::base::provide_both(providers);
}
5 changes: 5 additions & 0 deletions src/librustc_codegen_utils/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
extern crate rustc;

use rustc::ty::TyCtxt;
use rustc::ty::query::Providers;
use rustc::hir::def_id::LOCAL_CRATE;
use syntax::symbol::sym;

Expand All @@ -37,3 +38,7 @@ pub fn check_for_rustc_errors_attr(tcx: TyCtxt<'_>) {
}
}
}

pub fn provide(providers: &mut Providers<'_>) {
crate::symbol_names::provide(providers);
}
8 changes: 3 additions & 5 deletions src/librustc_interface/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,13 @@ pub fn default_provide(providers: &mut ty::query::Providers<'_>) {
cstore::provide(providers);
lint::provide(providers);
rustc_lint::provide(providers);
rustc_codegen_utils::symbol_names::provide(providers);
rustc_codegen_ssa::back::symbol_export::provide(providers);
rustc_codegen_ssa::base::provide_both(providers);
rustc_codegen_utils::provide(providers);
rustc_codegen_ssa::provide(providers);
}

pub fn default_provide_extern(providers: &mut ty::query::Providers<'_>) {
cstore::provide_extern(providers);
rustc_codegen_ssa::back::symbol_export::provide_extern(providers);
rustc_codegen_ssa::base::provide_both(providers);
rustc_codegen_ssa::provide_extern(providers);
}

declare_box_region_type!(
Expand Down