6
6
use std:: cell:: Cell ;
7
7
8
8
use rustc_hir:: def:: DefKind ;
9
- use rustc_public_bridge:: context:: SmirCtxt ;
9
+ use rustc_public_bridge:: context:: CompilerCtxt ;
10
10
use rustc_public_bridge:: { Bridge , SmirContainer } ;
11
11
use tracing:: debug;
12
12
@@ -66,13 +66,13 @@ impl Bridge for BridgeTys {
66
66
type Allocation = crate :: ty:: Allocation ;
67
67
}
68
68
69
- /// Stable public API for querying compiler information.
69
+ /// Public API for querying compiler information.
70
70
///
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
72
72
/// similar APIs but based on internal rustc constructs.
73
73
///
74
74
/// Do not use this directly. This is currently used in the macro expansion.
75
- pub ( crate ) trait SmirInterface {
75
+ pub ( crate ) trait CompilerInterface {
76
76
fn entry_fn ( & self ) -> Option < CrateItem > ;
77
77
/// Retrieve all items of the local crate that have a MIR associated with them.
78
78
fn all_local_items ( & self ) -> CrateItems ;
@@ -316,7 +316,7 @@ pub(crate) trait SmirInterface {
316
316
fn associated_items ( & self , def_id : DefId ) -> AssocItems ;
317
317
}
318
318
319
- impl < ' tcx > SmirInterface for SmirContainer < ' tcx , BridgeTys > {
319
+ impl < ' tcx > CompilerInterface for SmirContainer < ' tcx , BridgeTys > {
320
320
fn entry_fn ( & self ) -> Option < CrateItem > {
321
321
let mut tables = self . tables . borrow_mut ( ) ;
322
322
let cx = & * self . cx . borrow ( ) ;
@@ -1059,10 +1059,10 @@ impl<'tcx> SmirInterface for SmirContainer<'tcx, BridgeTys> {
1059
1059
}
1060
1060
}
1061
1061
1062
- // A thread local variable that stores a pointer to [`SmirInterface `].
1062
+ // A thread local variable that stores a pointer to [`CompilerInterface `].
1063
1063
scoped_tls:: scoped_thread_local!( static TLV : Cell <* const ( ) >) ;
1064
1064
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 >
1066
1066
where
1067
1067
F : FnOnce ( ) -> T ,
1068
1068
{
@@ -1074,21 +1074,21 @@ where
1074
1074
}
1075
1075
}
1076
1076
1077
- /// Execute the given function with access the [`SmirInterface `].
1077
+ /// Execute the given function with access the [`CompilerInterface `].
1078
1078
///
1079
1079
/// I.e., This function will load the current interface and calls a function with it.
1080
1080
/// 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 {
1082
1082
assert ! ( TLV . is_set( ) ) ;
1083
1083
TLV . with ( |tlv| {
1084
1084
let ptr = tlv. get ( ) ;
1085
1085
assert ! ( !ptr. is_null( ) ) ;
1086
- f ( unsafe { * ( ptr as * const & dyn SmirInterface ) } )
1086
+ f ( unsafe { * ( ptr as * const & dyn CompilerInterface ) } )
1087
1087
} )
1088
1088
}
1089
1089
1090
1090
fn smir_crate < ' tcx > (
1091
- cx : & SmirCtxt < ' tcx , BridgeTys > ,
1091
+ cx : & CompilerCtxt < ' tcx , BridgeTys > ,
1092
1092
crate_num : rustc_span:: def_id:: CrateNum ,
1093
1093
) -> Crate {
1094
1094
let name = cx. crate_name ( crate_num) ;
0 commit comments