X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fquery%2Fmod.rs;h=b8621c8ad30e2b65e22c5be1d8f5ce7c8fbbffc8;hb=760a98fb5e1c964efbe5cb36710fff892b547c51;hp=ed363800d79def6c82d5fb5efecd28663981ec0f;hpb=e06547fe8db5e9596de780197c7bcba09b3c9039;p=rust.git diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index ed363800d79..b8621c8ad30 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -42,7 +42,7 @@ load_cached(tcx, id) { let generics: Option = tcx.queries.on_disk_cache .try_load_query_result(tcx, id); - generics.map(|x| tcx.alloc_generics(x)) + generics.map(|x| &*tcx.arena.alloc(x)) } } @@ -88,7 +88,7 @@ desc { "getting a list of all mir_keys" } } - /// Maps DefId's that have an associated Mir to the result + /// Maps DefId's that have an associated `mir::Body` to the result /// of the MIR qualify_consts pass. The actual meaning of /// the value isn't known except to the pass itself. query mir_const_qualif(key: DefId) -> (u8, &'tcx BitSet) { @@ -97,28 +97,28 @@ /// Fetch the MIR for a given `DefId` right after it's built - this includes /// unreachable code. - query mir_built(_: DefId) -> &'tcx Steal> {} + query mir_built(_: DefId) -> &'tcx Steal> {} /// Fetch the MIR for a given `DefId` up till the point where it is /// ready for const evaluation. /// /// See the README for the `mir` module for details. - query mir_const(_: DefId) -> &'tcx Steal> { + query mir_const(_: DefId) -> &'tcx Steal> { no_hash } - query mir_validated(_: DefId) -> &'tcx Steal> { + query mir_validated(_: DefId) -> &'tcx Steal> { no_hash } /// MIR after our optimization passes have run. This is MIR that is ready /// for codegen. This is also the only query that can fetch non-local MIR, at present. - query optimized_mir(key: DefId) -> &'tcx mir::Mir<'tcx> { + query optimized_mir(key: DefId) -> &'tcx mir::Body<'tcx> { cache { key.is_local() } load_cached(tcx, id) { - let mir: Option> = tcx.queries.on_disk_cache + let mir: Option> = tcx.queries.on_disk_cache .try_load_query_result(tcx, id); - mir.map(|x| tcx.alloc_mir(x)) + mir.map(|x| &*tcx.arena.alloc(x)) } } } @@ -353,7 +353,7 @@ .queries.on_disk_cache .try_load_query_result(tcx, id); - typeck_tables.map(|tables| tcx.alloc_tables(tables)) + typeck_tables.map(|tables| &*tcx.arena.alloc(tables)) } } } @@ -456,7 +456,7 @@ /// in the case of closures, this will be redirected to the enclosing function. query region_scope_tree(_: DefId) -> &'tcx region::ScopeTree {} - query mir_shims(key: ty::InstanceDef<'tcx>) -> &'tcx mir::Mir<'tcx> { + query mir_shims(key: ty::InstanceDef<'tcx>) -> &'tcx mir::Body<'tcx> { no_force desc { |tcx| "generating MIR shim for `{}`", tcx.def_path_str(key.def_id()) } } @@ -624,6 +624,10 @@ fatal_cycle desc { "test whether a crate has #![no_builtins]" } } + query symbol_mangling_version(_: CrateNum) -> SymbolManglingVersion { + fatal_cycle + desc { "query a crate's symbol mangling version" } + } query extern_crate(_: DefId) -> Option<&'tcx ExternCrate> { eval_always