Encode exported symbols last

This commit is contained in:
John Kåre Alsaker 2020-01-11 03:42:40 +01:00
parent 6cd0dcade7
commit 1a34cbc2e2
2 changed files with 8 additions and 7 deletions

View File

@ -467,12 +467,6 @@ impl<'tcx> EncodeContext<'tcx> {
let impls = self.encode_impls();
let impl_bytes = self.position() - i;
// Encode exported symbols info.
i = self.position();
let exported_symbols = self.tcx.exported_symbols(LOCAL_CRATE);
let exported_symbols = self.encode_exported_symbols(&exported_symbols);
let exported_symbols_bytes = self.position() - i;
let tcx = self.tcx;
// Encode the items.
@ -513,6 +507,12 @@ impl<'tcx> EncodeContext<'tcx> {
let proc_macro_data = self.encode_proc_macros();
let proc_macro_data_bytes = self.position() - i;
// Encode exported symbols info.
i = self.position();
let exported_symbols = self.tcx.exported_symbols(LOCAL_CRATE);
let exported_symbols = self.encode_exported_symbols(&exported_symbols);
let exported_symbols_bytes = self.position() - i;
let attrs = tcx.hir().krate_attrs();
let has_default_lib_allocator = attr::contains_name(&attrs, sym::default_lib_allocator);

View File

@ -196,7 +196,6 @@ crate struct CrateRoot<'tcx> {
source_map: Lazy<[rustc_span::SourceFile]>,
def_path_table: Lazy<map::definitions::DefPathTable>,
impls: Lazy<[TraitImpls]>,
exported_symbols: Lazy!([(ExportedSymbol<'tcx>, SymbolExportLevel)]),
interpret_alloc_index: Lazy<[u32]>,
per_def: LazyPerDefTables<'tcx>,
@ -204,6 +203,8 @@ crate struct CrateRoot<'tcx> {
/// The DefIndex's of any proc macros declared by this crate.
proc_macro_data: Option<Lazy<[DefIndex]>>,
exported_symbols: Lazy!([(ExportedSymbol<'tcx>, SymbolExportLevel)]),
compiler_builtins: bool,
needs_allocator: bool,
needs_panic_runtime: bool,