Add a stable MIR visitor
Add a few utility functions as well and extend most `mir` and `ty` ADTs to implement `PartialEq` and `Eq`.
This commit is contained in:
parent
e6e931dda5
commit
af7472ecbc
8 changed files with 662 additions and 85 deletions
|
@ -216,6 +216,12 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
|
|||
tables.create_def_id(def_id)
|
||||
}
|
||||
|
||||
fn instance_mangled_name(&self, def: InstanceDef) -> String {
|
||||
let tables = self.0.borrow_mut();
|
||||
let instance = tables.instances[def];
|
||||
tables.tcx.symbol_name(instance).name.to_string()
|
||||
}
|
||||
|
||||
fn mono_instance(&self, item: stable_mir::CrateItem) -> stable_mir::mir::mono::Instance {
|
||||
let mut tables = self.0.borrow_mut();
|
||||
let def_id = tables[item.0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue