1
Fork 0

re-name stuff

This commit is contained in:
ouz-a 2022-05-01 15:38:22 +03:00
parent 4d4b0f140f
commit d9ddb6446d
4 changed files with 15 additions and 10 deletions

View file

@ -1080,7 +1080,7 @@ pub enum LocalInfo<'tcx> {
/// (e.g. a temporary for `foo` in `MyStruct { my_field: foo }`)
AggregateTemp,
/// A temporary created during the pass `Derefer` to avoid it's retagging
Temp,
DerefTemp,
}
impl<'tcx> LocalDecl<'tcx> {

View file

@ -78,20 +78,22 @@ impl<'tcx> MirPatch<'tcx> {
Location { block: bb, statement_index: offset }
}
pub fn new_local_temp(&mut self, ty: Ty<'tcx>, span: Span) -> Local {
pub fn new_local_with_info(
&mut self,
ty: Ty<'tcx>,
span: Span,
local_info: Option<Box<LocalInfo<'tcx>>>,
) -> Local {
let index = self.next_local;
self.next_local += 1;
let mut new_decl = LocalDecl::new(ty, span);
new_decl.local_info = Some(Box::new(LocalInfo::Temp));
new_decl.local_info = local_info;
self.new_locals.push(new_decl);
Local::new(index as usize)
}
pub fn new_temp(&mut self, ty: Ty<'tcx>, span: Span) -> Local {
let index = self.next_local;
self.next_local += 1;
self.new_locals.push(LocalDecl::new(ty, span));
Local::new(index as usize)
self.new_local_with_info(ty, span, None)
}
pub fn new_internal(&mut self, ty: Ty<'tcx>, span: Span) -> Local {