create localdecl and add span to it
This commit is contained in:
parent
5282e5e120
commit
9130484db9
2 changed files with 15 additions and 2 deletions
|
@ -106,7 +106,14 @@ impl<'tcx> Context for Tables<'tcx> {
|
||||||
.collect(),
|
.collect(),
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
locals: mir.local_decls.iter().map(|decl| self.intern_ty(decl.ty)).collect(),
|
locals: mir
|
||||||
|
.local_decls
|
||||||
|
.iter()
|
||||||
|
.map(|decl| stable_mir::mir::LocalDecl {
|
||||||
|
ty: self.intern_ty(decl.ty),
|
||||||
|
span: decl.source_info.span.stable(self),
|
||||||
|
})
|
||||||
|
.collect(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,13 @@ use crate::{ty::Ty, Span};
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Body {
|
pub struct Body {
|
||||||
pub blocks: Vec<BasicBlock>,
|
pub blocks: Vec<BasicBlock>,
|
||||||
pub locals: Vec<Ty>,
|
pub locals: Vec<LocalDecl>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct LocalDecl {
|
||||||
|
pub ty: Ty,
|
||||||
|
pub span: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue