create localdecl and add span to it
This commit is contained in:
parent
5282e5e120
commit
9130484db9
@ -106,7 +106,14 @@ fn mir_body(&mut self, item: stable_mir::DefId) -> stable_mir::mir::Body {
|
|||||||
.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 @@
|
|||||||
#[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…
Reference in New Issue
Block a user