Skip to content

Commit

Permalink
use monoitems instead of internalmonoitems
Browse files Browse the repository at this point in the history
  • Loading branch information
ouz-a committed Nov 14, 2023
1 parent d2523aa commit 1b09e16
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions kani-compiler/src/kani_middle/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ use std::fmt::Display;
/// - Total number of MIR instructions.
pub fn print_stats<'tcx>(tcx: TyCtxt<'tcx>, items: &[InternalMonoItem<'tcx>]) {
rustc_internal::run(tcx, || {
let item_types = items.iter().collect::<Counter>();
let item_types: Vec<MonoItem> =
items.iter().map(|item| rustc_internal::stable(item)).collect();
let item_types = item_types.iter().collect::<Counter>();
let visitor = items
.iter()
.filter_map(|&mono| {
Expand Down Expand Up @@ -120,12 +122,12 @@ impl<T: Into<Key>> FromIterator<T> for Counter {
#[derive(Debug, Eq, Hash, PartialEq)]
struct Key(pub &'static str);

impl<'tcx> From<&InternalMonoItem<'tcx>> for Key {
fn from(value: &InternalMonoItem) -> Self {
impl<'tcx> From<&MonoItem> for Key {
fn from(value: &stable_mir::mir::mono::MonoItem) -> Self {
match value {
InternalMonoItem::Fn(_) => Key("function"),
InternalMonoItem::GlobalAsm(_) => Key("global assembly"),
InternalMonoItem::Static(_) => Key("static item"),
MonoItem::Fn(_) => Key("function"),
MonoItem::GlobalAsm(_) => Key("global assembly"),
MonoItem::Static(_) => Key("static item"),
}
}
}
Expand Down

0 comments on commit 1b09e16

Please sign in to comment.