@@ -23,16 +23,16 @@ use std::mem;
2323use syntax:: ast:: NodeId ;
2424use syntax:: source_map:: { SourceMap , StableSourceFileId } ;
2525use syntax_pos:: { BytePos , Span , DUMMY_SP , SourceFile } ;
26- use syntax_pos:: hygiene:: { ExpnId , SyntaxContext , ExpnInfo } ;
26+ use syntax_pos:: hygiene:: { ExpnId , SyntaxContext , ExpnData } ;
2727
2828const TAG_FILE_FOOTER : u128 = 0xC0FFEE_C0FFEE_C0FFEE_C0FFEE_C0FFEE ;
2929
3030const TAG_CLEAR_CROSS_CRATE_CLEAR : u8 = 0 ;
3131const TAG_CLEAR_CROSS_CRATE_SET : u8 = 1 ;
3232
33- const TAG_NO_EXPANSION_INFO : u8 = 0 ;
34- const TAG_EXPANSION_INFO_SHORTHAND : u8 = 1 ;
35- const TAG_EXPANSION_INFO_INLINE : u8 = 2 ;
33+ const TAG_NO_EXPN_DATA : u8 = 0 ;
34+ const TAG_EXPN_DATA_SHORTHAND : u8 = 1 ;
35+ const TAG_EXPN_DATA_INLINE : u8 = 2 ;
3636
3737const TAG_VALID_SPAN : u8 = 0 ;
3838const TAG_INVALID_SPAN : u8 = 1 ;
@@ -58,7 +58,7 @@ pub struct OnDiskCache<'sess> {
5858
5959 // These two fields caches that are populated lazily during decoding.
6060 file_index_to_file : Lock < FxHashMap < SourceFileIndex , Lrc < SourceFile > > > ,
61- synthetic_expansion_infos : Lock < FxHashMap < AbsoluteBytePos , SyntaxContext > > ,
61+ synthetic_syntax_contexts : Lock < FxHashMap < AbsoluteBytePos , SyntaxContext > > ,
6262
6363 // A map from dep-node to the position of the cached query result in
6464 // `serialized_data`.
@@ -135,7 +135,7 @@ impl<'sess> OnDiskCache<'sess> {
135135 current_diagnostics : Default :: default ( ) ,
136136 query_result_index : footer. query_result_index . into_iter ( ) . collect ( ) ,
137137 prev_diagnostics_index : footer. diagnostics_index . into_iter ( ) . collect ( ) ,
138- synthetic_expansion_infos : Default :: default ( ) ,
138+ synthetic_syntax_contexts : Default :: default ( ) ,
139139 alloc_decoding_state : AllocDecodingState :: new ( footer. interpret_alloc_index ) ,
140140 }
141141 }
@@ -151,7 +151,7 @@ impl<'sess> OnDiskCache<'sess> {
151151 current_diagnostics : Default :: default ( ) ,
152152 query_result_index : Default :: default ( ) ,
153153 prev_diagnostics_index : Default :: default ( ) ,
154- synthetic_expansion_infos : Default :: default ( ) ,
154+ synthetic_syntax_contexts : Default :: default ( ) ,
155155 alloc_decoding_state : AllocDecodingState :: new ( Vec :: new ( ) ) ,
156156 }
157157 }
@@ -185,7 +185,7 @@ impl<'sess> OnDiskCache<'sess> {
185185 encoder,
186186 type_shorthands : Default :: default ( ) ,
187187 predicate_shorthands : Default :: default ( ) ,
188- expn_info_shorthands : Default :: default ( ) ,
188+ expn_data_shorthands : Default :: default ( ) ,
189189 interpret_allocs : Default :: default ( ) ,
190190 interpret_allocs_inverse : Vec :: new ( ) ,
191191 source_map : CachingSourceMapView :: new ( tcx. sess . source_map ( ) ) ,
@@ -383,7 +383,7 @@ impl<'sess> OnDiskCache<'sess> {
383383 cnum_map : self . cnum_map . get ( ) ,
384384 file_index_to_file : & self . file_index_to_file ,
385385 file_index_to_stable_id : & self . file_index_to_stable_id ,
386- synthetic_expansion_infos : & self . synthetic_expansion_infos ,
386+ synthetic_syntax_contexts : & self . synthetic_syntax_contexts ,
387387 alloc_decoding_session : self . alloc_decoding_state . new_decoding_session ( ) ,
388388 } ;
389389
@@ -440,7 +440,7 @@ struct CacheDecoder<'a, 'tcx> {
440440 opaque : opaque:: Decoder < ' a > ,
441441 source_map : & ' a SourceMap ,
442442 cnum_map : & ' a IndexVec < CrateNum , Option < CrateNum > > ,
443- synthetic_expansion_infos : & ' a Lock < FxHashMap < AbsoluteBytePos , SyntaxContext > > ,
443+ synthetic_syntax_contexts : & ' a Lock < FxHashMap < AbsoluteBytePos , SyntaxContext > > ,
444444 file_index_to_file : & ' a Lock < FxHashMap < SourceFileIndex , Lrc < SourceFile > > > ,
445445 file_index_to_stable_id : & ' a FxHashMap < SourceFileIndex , StableSourceFileId > ,
446446 alloc_decoding_session : AllocDecodingSession < ' a > ,
@@ -586,37 +586,37 @@ impl<'a, 'tcx> SpecializedDecoder<Span> for CacheDecoder<'a, 'tcx> {
586586 let lo = file_lo. lines [ line_lo - 1 ] + col_lo;
587587 let hi = lo + len;
588588
589- let expn_info_tag = u8:: decode ( self ) ?;
589+ let expn_data_tag = u8:: decode ( self ) ?;
590590
591- // FIXME(mw): This method does not restore `ExpnInfo ::parent` or
591+ // FIXME(mw): This method does not restore `ExpnData ::parent` or
592592 // `SyntaxContextData::prev_ctxt` or `SyntaxContextData::opaque`. These things
593593 // don't seem to be used after HIR lowering, so everything should be fine
594594 // as long as incremental compilation does not kick in before that.
595595 let location = || Span :: with_root_ctxt ( lo, hi) ;
596- let recover_from_expn_info = |this : & Self , expn_info , pos| {
597- let span = location ( ) . fresh_expansion ( expn_info ) ;
598- this. synthetic_expansion_infos . borrow_mut ( ) . insert ( pos, span. ctxt ( ) ) ;
596+ let recover_from_expn_data = |this : & Self , expn_data , pos| {
597+ let span = location ( ) . fresh_expansion ( expn_data ) ;
598+ this. synthetic_syntax_contexts . borrow_mut ( ) . insert ( pos, span. ctxt ( ) ) ;
599599 span
600600 } ;
601- Ok ( match expn_info_tag {
602- TAG_NO_EXPANSION_INFO => {
601+ Ok ( match expn_data_tag {
602+ TAG_NO_EXPN_DATA => {
603603 location ( )
604604 }
605- TAG_EXPANSION_INFO_INLINE => {
606- let expn_info = Decodable :: decode ( self ) ?;
607- recover_from_expn_info (
608- self , expn_info , AbsoluteBytePos :: new ( self . opaque . position ( ) )
605+ TAG_EXPN_DATA_INLINE => {
606+ let expn_data = Decodable :: decode ( self ) ?;
607+ recover_from_expn_data (
608+ self , expn_data , AbsoluteBytePos :: new ( self . opaque . position ( ) )
609609 )
610610 }
611- TAG_EXPANSION_INFO_SHORTHAND => {
611+ TAG_EXPN_DATA_SHORTHAND => {
612612 let pos = AbsoluteBytePos :: decode ( self ) ?;
613- let cached_ctxt = self . synthetic_expansion_infos . borrow ( ) . get ( & pos) . cloned ( ) ;
613+ let cached_ctxt = self . synthetic_syntax_contexts . borrow ( ) . get ( & pos) . cloned ( ) ;
614614 if let Some ( ctxt) = cached_ctxt {
615615 Span :: new ( lo, hi, ctxt)
616616 } else {
617- let expn_info =
618- self . with_position ( pos. to_usize ( ) , |this| ExpnInfo :: decode ( this) ) ?;
619- recover_from_expn_info ( self , expn_info , pos)
617+ let expn_data =
618+ self . with_position ( pos. to_usize ( ) , |this| ExpnData :: decode ( this) ) ?;
619+ recover_from_expn_data ( self , expn_data , pos)
620620 }
621621 }
622622 _ => {
@@ -725,7 +725,7 @@ struct CacheEncoder<'a, 'tcx, E: ty_codec::TyEncoder> {
725725 encoder : & ' a mut E ,
726726 type_shorthands : FxHashMap < Ty < ' tcx > , usize > ,
727727 predicate_shorthands : FxHashMap < ty:: Predicate < ' tcx > , usize > ,
728- expn_info_shorthands : FxHashMap < ExpnId , AbsoluteBytePos > ,
728+ expn_data_shorthands : FxHashMap < ExpnId , AbsoluteBytePos > ,
729729 interpret_allocs : FxHashMap < interpret:: AllocId , usize > ,
730730 interpret_allocs_inverse : Vec < interpret:: AllocId > ,
731731 source_map : CachingSourceMapView < ' tcx > ,
@@ -817,17 +817,17 @@ where
817817 len. encode ( self ) ?;
818818
819819 if span_data. ctxt == SyntaxContext :: root ( ) {
820- TAG_NO_EXPANSION_INFO . encode ( self )
820+ TAG_NO_EXPN_DATA . encode ( self )
821821 } else {
822- let ( expn_id, expn_info ) = span_data. ctxt . outer_expn_with_info ( ) ;
823- if let Some ( pos) = self . expn_info_shorthands . get ( & expn_id) . cloned ( ) {
824- TAG_EXPANSION_INFO_SHORTHAND . encode ( self ) ?;
822+ let ( expn_id, expn_data ) = span_data. ctxt . outer_expn_with_data ( ) ;
823+ if let Some ( pos) = self . expn_data_shorthands . get ( & expn_id) . cloned ( ) {
824+ TAG_EXPN_DATA_SHORTHAND . encode ( self ) ?;
825825 pos. encode ( self )
826826 } else {
827- TAG_EXPANSION_INFO_INLINE . encode ( self ) ?;
827+ TAG_EXPN_DATA_INLINE . encode ( self ) ?;
828828 let pos = AbsoluteBytePos :: new ( self . position ( ) ) ;
829- self . expn_info_shorthands . insert ( expn_id, pos) ;
830- expn_info . encode ( self )
829+ self . expn_data_shorthands . insert ( expn_id, pos) ;
830+ expn_data . encode ( self )
831831 }
832832 }
833833 }
0 commit comments