about summary refs log tree commit diff
path: root/src/librustc_codegen_utils
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2019-04-26 17:22:36 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2019-04-30 14:55:10 +1000
commitfaf5eac854f9099b54854145f2307cae3f3aa768 (patch)
tree9d90efdc4c648c5efe111da6fb2f7926f608f170 /src/librustc_codegen_utils
parent03122e1bac482b150844ef9664b1ad2438b43072 (diff)
downloadrust-faf5eac854f9099b54854145f2307cae3f3aa768.tar.gz
rust-faf5eac854f9099b54854145f2307cae3f3aa768.zip
Move metadata encoding earlier.
This commit separates metadata encoding (`tcx.encode_metadata`) from the
creation of the metadata module (which is now handled by
`write_compressed_metadata`, formerly `write_metadata`).

The metadata encoding now occurs slightly earlier in the pipeline, at
the very start of code generation within `start_codegen`.

Metadata *writing* still occurs near the end of compilation; that will
be moved forward in subsequent commits.
Diffstat (limited to 'src/librustc_codegen_utils')
-rw-r--r--src/librustc_codegen_utils/codegen_backend.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_codegen_utils/codegen_backend.rs b/src/librustc_codegen_utils/codegen_backend.rs
index 56eaffb1ca3..191c6605b43 100644
--- a/src/librustc_codegen_utils/codegen_backend.rs
+++ b/src/librustc_codegen_utils/codegen_backend.rs
@@ -18,7 +18,7 @@ use rustc::util::common::ErrorReported;
 use rustc::session::config::{OutputFilenames, PrintRequest};
 use rustc::ty::TyCtxt;
 use rustc::ty::query::Providers;
-use rustc::middle::cstore::MetadataLoader;
+use rustc::middle::cstore::{EncodedMetadata, MetadataLoader};
 use rustc::dep_graph::DepGraph;
 
 pub use rustc_data_structures::sync::MetadataRef;
@@ -37,6 +37,8 @@ pub trait CodegenBackend {
     fn codegen_crate<'a, 'tcx>(
         &self,
         tcx: TyCtxt<'a, 'tcx, 'tcx>,
+        metadata: EncodedMetadata,
+        need_metadata_module: bool,
         rx: mpsc::Receiver<Box<dyn Any + Send>>
     ) -> Box<dyn Any>;