about summary refs log tree commit diff
path: root/src/librustc_codegen_utils/codegen_backend.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-21 08:51:14 +0100
committerGitHub <noreply@github.com>2020-03-21 08:51:14 +0100
commit0b99489a89a10b5bd4e69ca9d9c32d03582c4aea (patch)
tree50de525c3b0fcd9749e2216621f6eddd0bb143bb /src/librustc_codegen_utils/codegen_backend.rs
parent426a4cc930476a557b1e8b3d708a8bec97bad92a (diff)
parent2d75a339ca9e7cd11338b165311927e6eb73cca4 (diff)
Rollup merge of #69965 - mark-i-m:codegen-utils, r=eddyb
Refactorings to get rid of rustc_codegen_utils

r? @eddyb

cc #45276

After this, the only modules left in `rustc_codegen_utils` are
- `link`: a bunch of linking-related functions (many dealing with file names). These are mostly consumed by save analysis, rustc_driver, rustc_interface, and of course codegen. I assume they live here because we don't want a dependency of save analysis on codegen... Perhaps they can be moved to librustc?
- ~`symbol_names` and `symbol_names_test`: honestly it seems odd that `symbol_names_test` is not a submodule of `symbol_names`. It seems like these could honestly live in their own crate or move to librustc. Already name mangling is exported as the `symbol_name` query.~ (move it to its own crate)

I don't mind doing either of the above as part of this PR or a followup if you want.
Diffstat (limited to 'src/librustc_codegen_utils/codegen_backend.rs')
-rw-r--r--src/librustc_codegen_utils/codegen_backend.rs64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/librustc_codegen_utils/codegen_backend.rs b/src/librustc_codegen_utils/codegen_backend.rs
deleted file mode 100644
index 561692e7066..00000000000
--- a/src/librustc_codegen_utils/codegen_backend.rs
+++ /dev/null
@@ -1,64 +0,0 @@
-//! The Rust compiler.
-//!
-//! # Note
-//!
-//! This API is completely unstable and subject to change.
-
-#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
-
-use std::any::Any;
-
-use rustc::dep_graph::DepGraph;
-use rustc::middle::cstore::{EncodedMetadata, MetadataLoaderDyn};
-use rustc::ty::query::Providers;
-use rustc::ty::TyCtxt;
-use rustc::util::common::ErrorReported;
-use rustc_session::config::{OutputFilenames, PrintRequest};
-use rustc_session::Session;
-use rustc_span::symbol::Symbol;
-
-pub use rustc_data_structures::sync::MetadataRef;
-
-pub trait CodegenBackend {
-    fn init(&self, _sess: &Session) {}
-    fn print(&self, _req: PrintRequest, _sess: &Session) {}
-    fn target_features(&self, _sess: &Session) -> Vec<Symbol> {
-        vec![]
-    }
-    fn print_passes(&self) {}
-    fn print_version(&self) {}
-
-    fn metadata_loader(&self) -> Box<MetadataLoaderDyn>;
-    fn provide(&self, _providers: &mut Providers<'_>);
-    fn provide_extern(&self, _providers: &mut Providers<'_>);
-    fn codegen_crate<'tcx>(
-        &self,
-        tcx: TyCtxt<'tcx>,
-        metadata: EncodedMetadata,
-        need_metadata_module: bool,
-    ) -> Box<dyn Any>;
-
-    /// This is called on the returned `Box<dyn Any>` from `codegen_backend`
-    ///
-    /// # Panics
-    ///
-    /// Panics when the passed `Box<dyn Any>` was not returned by `codegen_backend`.
-    fn join_codegen(
-        &self,
-        ongoing_codegen: Box<dyn Any>,
-        sess: &Session,
-        dep_graph: &DepGraph,
-    ) -> Result<Box<dyn Any>, ErrorReported>;
-
-    /// This is called on the returned `Box<dyn Any>` from `join_codegen`
-    ///
-    /// # Panics
-    ///
-    /// Panics when the passed `Box<dyn Any>` was not returned by `join_codegen`.
-    fn link(
-        &self,
-        sess: &Session,
-        codegen_results: Box<dyn Any>,
-        outputs: &OutputFilenames,
-    ) -> Result<(), ErrorReported>;
-}