File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
rustc_smir/src/rustc_smir Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -587,6 +587,13 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
587
587
}
588
588
}
589
589
590
+ fn intrinsic_name ( & self , def : InstanceDef ) -> Option < Symbol > {
591
+ let tables = self . 0 . borrow_mut ( ) ;
592
+ let instance = tables. instances [ def] ;
593
+ let name = tables. tcx . intrinsic ( instance. def_id ( ) ) ?;
594
+ Some ( name. to_string ( ) )
595
+ }
596
+
590
597
fn ty_layout ( & self , ty : Ty ) -> Result < Layout , Error > {
591
598
let mut tables = self . 0 . borrow_mut ( ) ;
592
599
let tcx = tables. tcx ;
Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ pub trait Context {
183
183
fn vtable_allocation ( & self , global_alloc : & GlobalAlloc ) -> Option < AllocId > ;
184
184
fn krate ( & self , def_id : DefId ) -> Crate ;
185
185
fn instance_name ( & self , def : InstanceDef , trimmed : bool ) -> Symbol ;
186
+ fn intrinsic_name ( & self , def : InstanceDef ) -> Option < Symbol > ;
186
187
187
188
/// Return information about the target machine.
188
189
fn target_info ( & self ) -> MachineInfo ;
Original file line number Diff line number Diff line change @@ -90,6 +90,10 @@ impl Instance {
90
90
with ( |context| context. instance_name ( self . def , true ) )
91
91
}
92
92
93
+ pub fn intrinsic_name ( & self ) -> Option < Symbol > {
94
+ with ( |context| context. intrinsic_name ( self . def ) )
95
+ }
96
+
93
97
/// Resolve an instance starting from a function definition and generic arguments.
94
98
pub fn resolve ( def : FnDef , args : & GenericArgs ) -> Result < Instance , crate :: Error > {
95
99
with ( |context| {
You can’t perform that action at this time.
0 commit comments