@@ -31,11 +31,11 @@ use crate::{rustc_smir, stable_mir};
3131/// similar APIs but based on internal rustc constructs.
3232///
3333/// Do not use this directly. This is currently used in the macro expansion.
34- pub struct CompilerInterface < ' tcx > {
34+ pub struct SmirInterface < ' tcx > {
3535 pub ( crate ) cx : Context < ' tcx > ,
3636}
3737
38- impl < ' tcx > CompilerInterface < ' tcx > {
38+ impl < ' tcx > SmirInterface < ' tcx > {
3939 pub fn entry_fn ( & self ) -> Option < CrateItem > {
4040 self . cx . entry_fn ( )
4141 }
@@ -461,30 +461,30 @@ impl<'tcx> CompilerInterface<'tcx> {
461461 }
462462}
463463
464- // A thread local variable that stores a pointer to [`CompilerInterface `].
464+ // A thread local variable that stores a pointer to [`SmirInterface `].
465465scoped_tls:: scoped_thread_local!( static TLV : Cell <* const ( ) >) ;
466466
467- pub fn run < ' tcx , T , F > ( interface : & CompilerInterface < ' tcx > , f : F ) -> Result < T , Error >
467+ pub fn run < ' tcx , T , F > ( interface : & SmirInterface < ' tcx > , f : F ) -> Result < T , Error >
468468where
469469 F : FnOnce ( ) -> T ,
470470{
471471 if TLV . is_set ( ) {
472472 Err ( Error :: from ( "StableMIR already running" ) )
473473 } else {
474- let ptr: * const ( ) = ( interface as * const CompilerInterface < ' tcx > ) as * const ( ) ;
474+ let ptr: * const ( ) = ( interface as * const SmirInterface < ' tcx > ) as * const ( ) ;
475475 TLV . set ( & Cell :: new ( ptr) , || Ok ( f ( ) ) )
476476 }
477477}
478478
479- /// Execute the given function with access the [`CompilerInterface `].
479+ /// Execute the given function with access the [`SmirInterface `].
480480///
481481/// I.e., This function will load the current interface and calls a function with it.
482482/// Do not nest these, as that will ICE.
483- pub ( crate ) fn with < R > ( f : impl FnOnce ( & CompilerInterface < ' _ > ) -> R ) -> R {
483+ pub ( crate ) fn with < R > ( f : impl FnOnce ( & SmirInterface < ' _ > ) -> R ) -> R {
484484 assert ! ( TLV . is_set( ) ) ;
485485 TLV . with ( |tlv| {
486486 let ptr = tlv. get ( ) ;
487487 assert ! ( !ptr. is_null( ) ) ;
488- f ( unsafe { & * ( ptr as * const CompilerInterface < ' _ > ) } )
488+ f ( unsafe { & * ( ptr as * const SmirInterface < ' _ > ) } )
489489 } )
490490}
0 commit comments