storage(ArenaCacheSelector<'tcx>)
cache_on_disk_if { key.is_local() }
load_cached(tcx, id) {
- let generics: Option<ty::Generics> = tcx.queries.on_disk_cache
- .try_load_query_result(tcx, id);
+ let generics: Option<ty::Generics> = tcx.queries.on_disk_cache.as_ref()
+ .and_then(|c| c.try_load_query_result(tcx, id));
generics
}
}
cache_on_disk_if { key.is_local() }
}
+ /// Returns the name of the file that contains the function body, if instrumented for coverage.
+ query covered_file_name(key: DefId) -> Option<Symbol> {
+ desc { |tcx| "retrieving the covered file name, if instrumented, for `{}`", tcx.def_path_str(key) }
+ storage(ArenaCacheSelector<'tcx>)
+ cache_on_disk_if { key.is_local() }
+ }
+
+ /// Returns the `CodeRegions` for a function that has instrumented coverage, in case the
+ /// function was optimized out before codegen, and before being added to the Coverage Map.
+ query covered_code_regions(key: DefId) -> Vec<&'tcx mir::coverage::CodeRegion> {
+ desc { |tcx| "retrieving the covered `CodeRegion`s, if instrumented, for `{}`", tcx.def_path_str(key) }
+ storage(ArenaCacheSelector<'tcx>)
+ cache_on_disk_if { key.is_local() }
+ }
+
/// The `DefId` is the `DefId` of the containing MIR body. Promoteds do not have their own
/// `DefId`. This function returns all promoteds in the specified body. The body references
/// promoteds by the `DefId` and the `mir::Promoted` index. This is necessary, because
TypeChecking {
/// Erases regions from `ty` to yield a new type.
- /// Normally you would just use `tcx.erase_regions(&value)`,
+ /// Normally you would just use `tcx.erase_regions(value)`,
/// however, which uses this query as a kind of cache.
query erase_regions_ty(ty: Ty<'tcx>) -> Ty<'tcx> {
// This query is not expected to have input -- as a result, it
desc { |tcx| "checking loops in {}", describe_as_module(key, tcx) }
}
+ query check_mod_naked_functions(key: LocalDefId) -> () {
+ desc { |tcx| "checking naked functions in {}", describe_as_module(key, tcx) }
+ }
+
query check_mod_item_types(key: LocalDefId) -> () {
desc { |tcx| "checking item types in {}", describe_as_module(key, tcx) }
}
cache_on_disk_if { true }
load_cached(tcx, id) {
let typeck_results: Option<ty::TypeckResults<'tcx>> = tcx
- .queries.on_disk_cache
- .try_load_query_result(tcx, id);
+ .queries.on_disk_cache.as_ref()
+ .and_then(|c| c.try_load_query_result(tcx, id));
typeck_results.map(|x| &*tcx.arena.alloc(x))
}