Move encode_metadata out of CrateStore.
This commit is contained in:
parent
11491938f8
commit
df54d3980b
9 changed files with 14 additions and 21 deletions
|
@ -30,4 +30,5 @@ pub mod creader;
|
|||
pub mod dynamic_lib;
|
||||
pub mod locator;
|
||||
|
||||
pub use rmeta::encode_metadata;
|
||||
pub use rmeta::METADATA_HEADER;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use crate::creader::{CStore, LoadedMacro};
|
||||
use crate::foreign_modules;
|
||||
use crate::native_libs;
|
||||
use crate::rmeta::encoder;
|
||||
|
||||
use rustc_ast as ast;
|
||||
use rustc_data_structures::stable_map::FxHashMap;
|
||||
|
@ -10,7 +9,7 @@ use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, CRATE_DEF_INDEX, LOCAL_CRATE}
|
|||
use rustc_hir::definitions::{DefKey, DefPath, DefPathHash};
|
||||
use rustc_middle::hir::exports::Export;
|
||||
use rustc_middle::middle::cstore::ForeignModule;
|
||||
use rustc_middle::middle::cstore::{CrateSource, CrateStore, EncodedMetadata};
|
||||
use rustc_middle::middle::cstore::{CrateSource, CrateStore};
|
||||
use rustc_middle::middle::exported_symbols::ExportedSymbol;
|
||||
use rustc_middle::middle::stability::DeprecationEntry;
|
||||
use rustc_middle::ty::query::Providers;
|
||||
|
@ -511,8 +510,4 @@ impl CrateStore for CStore {
|
|||
fn expn_hash_to_expn_id(&self, cnum: CrateNum, index_guess: u32, hash: ExpnHash) -> ExpnId {
|
||||
self.get_crate_data(cnum).expn_hash_to_expn_id(index_guess, hash)
|
||||
}
|
||||
|
||||
fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata {
|
||||
encoder::encode_metadata(tcx)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2101,7 +2101,9 @@ fn prefetch_mir(tcx: TyCtxt<'_>) {
|
|||
// will allow us to slice the metadata to the precise length that we just
|
||||
// generated regardless of trailing bytes that end up in it.
|
||||
|
||||
pub(super) fn encode_metadata(tcx: TyCtxt<'_>) -> EncodedMetadata {
|
||||
pub fn encode_metadata(tcx: TyCtxt<'_>) -> EncodedMetadata {
|
||||
let _prof_timer = tcx.prof.verbose_generic_activity("generate_crate_metadata");
|
||||
|
||||
// Since encoding metadata is not in a query, and nothing is cached,
|
||||
// there's no need to do dep-graph tracking for any of it.
|
||||
tcx.dep_graph.assert_ignored();
|
||||
|
|
|
@ -32,6 +32,7 @@ use std::num::NonZeroUsize;
|
|||
use decoder::DecodeContext;
|
||||
pub use decoder::{provide, provide_extern};
|
||||
crate use decoder::{CrateMetadata, CrateNumMap, MetadataBlob};
|
||||
pub use encoder::encode_metadata;
|
||||
use encoder::EncodeContext;
|
||||
use rustc_span::hygiene::SyntaxContextData;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue