diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-28 19:53:01 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-05-13 08:06:48 +0200 |
| commit | 9900ea352b1b7dbcbe290bbb62f436c91818c5d1 (patch) | |
| tree | a3dc7fe7489312081ebdbfd7b7dbf6e24b34e780 /compiler/rustc_query_impl | |
| parent | 3a08bd7873ac755f93286f087fdc398380c69e21 (diff) | |
| download | rust-9900ea352b1b7dbcbe290bbb62f436c91818c5d1.tar.gz rust-9900ea352b1b7dbcbe290bbb62f436c91818c5d1.zip | |
Cache more queries on disk.
Diffstat (limited to 'compiler/rustc_query_impl')
| -rw-r--r-- | compiler/rustc_query_impl/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_query_impl/src/on_disk_cache.rs | 22 |
2 files changed, 19 insertions, 5 deletions
diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs index 6ebff5388f4..2fa030f9b3f 100644 --- a/compiler/rustc_query_impl/src/lib.rs +++ b/compiler/rustc_query_impl/src/lib.rs @@ -21,7 +21,7 @@ use rustc_middle::dep_graph::{self, DepKindStruct, SerializedDepNodeIndex}; use rustc_middle::ty::query::{query_keys, query_storage, query_stored, query_values}; use rustc_middle::ty::query::{ExternProviders, Providers, QueryEngine}; use rustc_middle::ty::{self, TyCtxt}; -use rustc_span::def_id::LocalDefId; +use rustc_span::def_id::{LocalDefId, LOCAL_CRATE}; use rustc_span::Span; #[macro_use] diff --git a/compiler/rustc_query_impl/src/on_disk_cache.rs b/compiler/rustc_query_impl/src/on_disk_cache.rs index f2f895367ff..c4920408527 100644 --- a/compiler/rustc_query_impl/src/on_disk_cache.rs +++ b/compiler/rustc_query_impl/src/on_disk_cache.rs @@ -788,10 +788,24 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [rustc_ast::InlineAsm } } -impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [Span] { - fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self { - RefDecodable::decode(d) - } +macro_rules! impl_ref_decoder { + (<$tcx:tt> $($ty:ty,)*) => { + $(impl<'a, $tcx> Decodable<CacheDecoder<'a, $tcx>> for &$tcx [$ty] { + fn decode(d: &mut CacheDecoder<'a, $tcx>) -> Self { + RefDecodable::decode(d) + } + })* + }; +} + +impl_ref_decoder! {<'tcx> + Span, + rustc_ast::Attribute, + rustc_span::symbol::Ident, + ty::Variance, + rustc_span::def_id::DefId, + rustc_span::def_id::LocalDefId, + (rustc_middle::middle::exported_symbols::ExportedSymbol<'tcx>, rustc_middle::middle::exported_symbols::SymbolExportInfo), } //- ENCODING ------------------------------------------------------------------- |
