66use std:: cell:: Cell ;
77
88use rustc_hir:: def:: DefKind ;
9- use rustc_public_bridge:: context:: SmirCtxt ;
9+ use rustc_public_bridge:: context:: CompilerCtxt ;
1010use rustc_public_bridge:: { Bridge , SmirContainer } ;
1111use tracing:: debug;
1212
@@ -66,13 +66,13 @@ impl Bridge for BridgeTys {
6666 type Allocation = crate :: ty:: Allocation ;
6767}
6868
69- /// Stable public API for querying compiler information.
69+ /// Public API for querying compiler information.
7070///
71- /// All queries are delegated to [`rustc_public_bridge::context::SmirCtxt `] that provides
71+ /// All queries are delegated to [`rustc_public_bridge::context::CompilerCtxt `] that provides
7272/// similar APIs but based on internal rustc constructs.
7373///
7474/// Do not use this directly. This is currently used in the macro expansion.
75- pub ( crate ) trait SmirInterface {
75+ pub ( crate ) trait CompilerInterface {
7676 fn entry_fn ( & self ) -> Option < CrateItem > ;
7777 /// Retrieve all items of the local crate that have a MIR associated with them.
7878 fn all_local_items ( & self ) -> CrateItems ;
@@ -316,7 +316,7 @@ pub(crate) trait SmirInterface {
316316 fn associated_items ( & self , def_id : DefId ) -> AssocItems ;
317317}
318318
319- impl < ' tcx > SmirInterface for SmirContainer < ' tcx , BridgeTys > {
319+ impl < ' tcx > CompilerInterface for SmirContainer < ' tcx , BridgeTys > {
320320 fn entry_fn ( & self ) -> Option < CrateItem > {
321321 let mut tables = self . tables . borrow_mut ( ) ;
322322 let cx = & * self . cx . borrow ( ) ;
@@ -1059,10 +1059,10 @@ impl<'tcx> SmirInterface for SmirContainer<'tcx, BridgeTys> {
10591059 }
10601060}
10611061
1062- // A thread local variable that stores a pointer to [`SmirInterface `].
1062+ // A thread local variable that stores a pointer to [`CompilerInterface `].
10631063scoped_tls:: scoped_thread_local!( static TLV : Cell <* const ( ) >) ;
10641064
1065- pub ( crate ) fn run < F , T > ( interface : & dyn SmirInterface , f : F ) -> Result < T , Error >
1065+ pub ( crate ) fn run < F , T > ( interface : & dyn CompilerInterface , f : F ) -> Result < T , Error >
10661066where
10671067 F : FnOnce ( ) -> T ,
10681068{
@@ -1074,21 +1074,21 @@ where
10741074 }
10751075}
10761076
1077- /// Execute the given function with access the [`SmirInterface `].
1077+ /// Execute the given function with access the [`CompilerInterface `].
10781078///
10791079/// I.e., This function will load the current interface and calls a function with it.
10801080/// Do not nest these, as that will ICE.
1081- pub ( crate ) fn with < R > ( f : impl FnOnce ( & dyn SmirInterface ) -> R ) -> R {
1081+ pub ( crate ) fn with < R > ( f : impl FnOnce ( & dyn CompilerInterface ) -> R ) -> R {
10821082 assert ! ( TLV . is_set( ) ) ;
10831083 TLV . with ( |tlv| {
10841084 let ptr = tlv. get ( ) ;
10851085 assert ! ( !ptr. is_null( ) ) ;
1086- f ( unsafe { * ( ptr as * const & dyn SmirInterface ) } )
1086+ f ( unsafe { * ( ptr as * const & dyn CompilerInterface ) } )
10871087 } )
10881088}
10891089
10901090fn smir_crate < ' tcx > (
1091- cx : & SmirCtxt < ' tcx , BridgeTys > ,
1091+ cx : & CompilerCtxt < ' tcx , BridgeTys > ,
10921092 crate_num : rustc_span:: def_id:: CrateNum ,
10931093) -> Crate {
10941094 let name = cx. crate_name ( crate_num) ;
0 commit comments