about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/lib.rs
diff options
context:
space:
mode:
authorDenis Merigoux <denis.merigoux@gmail.com>2018-10-03 16:56:24 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2018-11-16 15:08:18 +0200
commit015e4441f5c540300477a7937a1517d407bc8436 (patch)
treecc2104db0ba7b33703e0f59749f5ec8b287bc5b6 /src/librustc_codegen_llvm/lib.rs
parentc0a428ee702329b0ad818a67a6ecc9617df267c7 (diff)
downloadrust-015e4441f5c540300477a7937a1517d407bc8436.tar.gz
rust-015e4441f5c540300477a7937a1517d407bc8436.zip
Finished moving backend-agnostic code to rustc_codegen_ssa
Diffstat (limited to 'src/librustc_codegen_llvm/lib.rs')
-rw-r--r--src/librustc_codegen_llvm/lib.rs22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs
index 41796d24d9e..560d266e926 100644
--- a/src/librustc_codegen_llvm/lib.rs
+++ b/src/librustc_codegen_llvm/lib.rs
@@ -40,6 +40,7 @@ use back::write::create_target_machine;
 use syntax_pos::symbol::Symbol;
 
 extern crate flate2;
+#[macro_use] extern crate bitflags;
 extern crate libc;
 #[macro_use] extern crate rustc;
 extern crate jobserver;
@@ -66,7 +67,7 @@ extern crate cc; // Used to locate MSVC
 extern crate tempfile;
 extern crate memmap;
 
-use interfaces::*;
+use rustc_codegen_ssa::interfaces::*;
 use time_graph::TimeGraph;
 use std::sync::mpsc::Receiver;
 use back::write::{self, OngoingCodegen};
@@ -76,22 +77,17 @@ use rustc::mir::mono::Stats;
 pub use llvm_util::target_features;
 use std::any::Any;
 use std::sync::mpsc;
-use rustc_data_structures::sync::Lrc;
 
 use rustc::dep_graph::DepGraph;
-use rustc::hir::def_id::CrateNum;
 use rustc::middle::allocator::AllocatorKind;
 use rustc::middle::cstore::{EncodedMetadata, MetadataLoader};
-use rustc::middle::cstore::{NativeLibrary, CrateSource, LibSource};
-use rustc::middle::lang_items::LangItem;
 use rustc::session::{Session, CompileIncomplete};
 use rustc::session::config::{OutputFilenames, OutputType, PrintRequest};
 use rustc::ty::{self, TyCtxt};
 use rustc::util::time_graph;
-use rustc::util::nodemap::{FxHashSet, FxHashMap};
 use rustc::util::profiling::ProfileCategory;
 use rustc_mir::monomorphize;
-use rustc_codegen_ssa::{interfaces, ModuleCodegen, CompiledModule};
+use rustc_codegen_ssa::{ModuleCodegen, CompiledModule, CachedModuleCodegen, CrateInfo};
 use rustc_codegen_utils::codegen_backend::CodegenBackend;
 use rustc_data_structures::svh::Svh;
 
@@ -157,7 +153,7 @@ impl BackendMethods for LlvmCodegenBackend {
     ) -> OngoingCodegen {
         write::start_async_codegen(tcx, time_graph, metadata, coordinator_receive, total_cgus)
     }
-    fn submit_pre_codegened_module_to_llvm(
+    fn submit_pre_codegened_module_to_backend(
         &self,
         codegen: &OngoingCodegen,
         tcx: TyCtxt,
@@ -165,10 +161,10 @@ impl BackendMethods for LlvmCodegenBackend {
     ) {
         codegen.submit_pre_codegened_module_to_llvm(tcx, module)
     }
-    fn submit_pre_lto_module_to_llvm(&self, tcx: TyCtxt, module: CachedModuleCodegen) {
+    fn submit_pre_lto_module_to_backend(&self, tcx: TyCtxt, module: CachedModuleCodegen) {
         write::submit_pre_lto_module_to_llvm(tcx, module)
     }
-    fn submit_post_lto_module_to_llvm(&self, tcx: TyCtxt, module: CachedModuleCodegen) {
+    fn submit_post_lto_module_to_backend(&self, tcx: TyCtxt, module: CachedModuleCodegen) {
         write::submit_post_lto_module_to_llvm(tcx, module)
     }
     fn codegen_aborted(codegen: OngoingCodegen) {
@@ -260,13 +256,13 @@ impl CodegenBackend for LlvmCodegenBackend {
     fn provide(&self, providers: &mut ty::query::Providers) {
         rustc_codegen_utils::symbol_export::provide(providers);
         rustc_codegen_utils::symbol_names::provide(providers);
-        base::provide_both(providers);
+        rustc_codegen_ssa::base::provide_both(providers);
         attributes::provide(providers);
     }
 
     fn provide_extern(&self, providers: &mut ty::query::Providers) {
         rustc_codegen_utils::symbol_export::provide_extern(providers);
-        base::provide_both(providers);
+        rustc_codegen_ssa::base::provide_both(providers);
         attributes::provide_extern(providers);
     }
 
@@ -275,7 +271,7 @@ impl CodegenBackend for LlvmCodegenBackend {
         tcx: TyCtxt<'a, 'tcx, 'tcx>,
         rx: mpsc::Receiver<Box<dyn Any + Send>>
     ) -> Box<dyn Any> {
-        box base::codegen_crate(LlvmCodegenBackend(()), tcx, rx)
+        box rustc_codegen_ssa::base::codegen_crate(LlvmCodegenBackend(()), tcx, rx)
     }
 
     fn join_codegen_and_link(