Enable drop_tracking_mir by default.
This commit is contained in:
parent
a626caaad9
commit
286502c9ed
29 changed files with 114 additions and 2513 deletions
|
@ -24,7 +24,6 @@ use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
|
|||
use rustc_middle::mir::interpret::{AllocDecodingSession, AllocDecodingState};
|
||||
use rustc_middle::ty::codec::TyDecoder;
|
||||
use rustc_middle::ty::fast_reject::SimplifiedType;
|
||||
use rustc_middle::ty::GeneratorDiagnosticData;
|
||||
use rustc_middle::ty::{self, ParameterizedOverTcx, Ty, TyCtxt, Visibility};
|
||||
use rustc_serialize::opaque::MemDecoder;
|
||||
use rustc_serialize::{Decodable, Decoder};
|
||||
|
@ -1750,24 +1749,6 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
|
|||
.clone()
|
||||
}
|
||||
|
||||
fn get_generator_diagnostic_data(
|
||||
self,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
id: DefIndex,
|
||||
) -> Option<GeneratorDiagnosticData<'tcx>> {
|
||||
self.root
|
||||
.tables
|
||||
.generator_diagnostic_data
|
||||
.get(self, id)
|
||||
.map(|param| param.decode((self, tcx)))
|
||||
.map(|generator_data| GeneratorDiagnosticData {
|
||||
generator_interior_types: generator_data.generator_interior_types,
|
||||
hir_owner: generator_data.hir_owner,
|
||||
nodes_types: generator_data.nodes_types,
|
||||
adjustments: generator_data.adjustments,
|
||||
})
|
||||
}
|
||||
|
||||
fn get_attr_flags(self, index: DefIndex) -> AttrFlags {
|
||||
self.root.tables.attr_flags.get(self, index)
|
||||
}
|
||||
|
|
|
@ -374,7 +374,6 @@ provide! { tcx, def_id, other, cdata,
|
|||
|
||||
crate_extern_paths => { cdata.source().paths().cloned().collect() }
|
||||
expn_that_defined => { cdata.get_expn_that_defined(def_id.index, tcx.sess) }
|
||||
generator_diagnostic_data => { cdata.get_generator_diagnostic_data(tcx, def_id.index) }
|
||||
is_doc_hidden => { cdata.get_attr_flags(def_id.index).contains(AttrFlags::IS_DOC_HIDDEN) }
|
||||
doc_link_resolutions => { tcx.arena.alloc(cdata.get_doc_link_resolutions(def_id.index)) }
|
||||
doc_link_traits_in_scope => {
|
||||
|
|
|
@ -1439,7 +1439,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
if let DefKind::Generator = def_kind {
|
||||
self.encode_info_for_generator(local_id);
|
||||
let data = self.tcx.generator_kind(def_id).unwrap();
|
||||
record!(self.tables.generator_kind[def_id] <- data);
|
||||
}
|
||||
if let DefKind::Enum | DefKind::Struct | DefKind::Union = def_kind {
|
||||
self.encode_info_for_adt(local_id);
|
||||
|
@ -1612,8 +1613,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
record!(self.tables.closure_saved_names_of_captured_variables[def_id.to_def_id()]
|
||||
<- tcx.closure_saved_names_of_captured_variables(def_id));
|
||||
|
||||
if tcx.sess.opts.unstable_opts.drop_tracking_mir
|
||||
&& let DefKind::Generator = self.tcx.def_kind(def_id)
|
||||
if let DefKind::Generator = self.tcx.def_kind(def_id)
|
||||
&& let Some(witnesses) = tcx.mir_generator_witnesses(def_id)
|
||||
{
|
||||
record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- witnesses);
|
||||
|
@ -1640,6 +1640,12 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
}
|
||||
record!(self.tables.promoted_mir[def_id.to_def_id()] <- tcx.promoted_mir(def_id));
|
||||
|
||||
if let DefKind::Generator = self.tcx.def_kind(def_id)
|
||||
&& let Some(witnesses) = tcx.mir_generator_witnesses(def_id)
|
||||
{
|
||||
record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- witnesses);
|
||||
}
|
||||
|
||||
let instance = ty::InstanceDef::Item(def_id.to_def_id());
|
||||
let unused = tcx.unused_generic_params(instance);
|
||||
self.tables.unused_generic_params.set(def_id.local_def_index, unused);
|
||||
|
@ -1712,15 +1718,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
record!(self.tables.macro_definition[def_id.to_def_id()] <- &*macro_def.body);
|
||||
}
|
||||
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn encode_info_for_generator(&mut self, def_id: LocalDefId) {
|
||||
let typeck_result: &'tcx ty::TypeckResults<'tcx> = self.tcx.typeck(def_id);
|
||||
let data = self.tcx.generator_kind(def_id).unwrap();
|
||||
let generator_diagnostic_data = typeck_result.get_generator_diagnostic_data();
|
||||
record!(self.tables.generator_kind[def_id.to_def_id()] <- data);
|
||||
record!(self.tables.generator_diagnostic_data[def_id.to_def_id()] <- generator_diagnostic_data);
|
||||
}
|
||||
|
||||
fn encode_native_libraries(&mut self) -> LazyArray<NativeLib> {
|
||||
empty_proc_macro!(self);
|
||||
let used_libraries = self.tcx.native_libraries(LOCAL_CRATE);
|
||||
|
|
|
@ -23,7 +23,7 @@ use rustc_middle::middle::resolve_bound_vars::ObjectLifetimeDefault;
|
|||
use rustc_middle::mir;
|
||||
use rustc_middle::ty::fast_reject::SimplifiedType;
|
||||
use rustc_middle::ty::{self, ReprOptions, Ty, UnusedGenericParams};
|
||||
use rustc_middle::ty::{DeducedParamAttrs, GeneratorDiagnosticData, ParameterizedOverTcx, TyCtxt};
|
||||
use rustc_middle::ty::{DeducedParamAttrs, ParameterizedOverTcx, TyCtxt};
|
||||
use rustc_middle::util::Providers;
|
||||
use rustc_serialize::opaque::FileEncoder;
|
||||
use rustc_session::config::SymbolManglingVersion;
|
||||
|
@ -452,7 +452,6 @@ define_tables! {
|
|||
// definitions from any given crate.
|
||||
def_keys: Table<DefIndex, LazyValue<DefKey>>,
|
||||
proc_macro_quoted_spans: Table<usize, LazyValue<Span>>,
|
||||
generator_diagnostic_data: Table<DefIndex, LazyValue<GeneratorDiagnosticData<'static>>>,
|
||||
variant_data: Table<DefIndex, LazyValue<VariantData>>,
|
||||
assoc_container: Table<DefIndex, ty::AssocItemContainer>,
|
||||
macro_definition: Table<DefIndex, LazyValue<ast::DelimArgs>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue