rustc_mir: rename location: SourceInfo
to source_info
.
This commit is contained in:
parent
31530e5d13
commit
8c942c1511
1 changed files with 15 additions and 12 deletions
|
@ -33,7 +33,7 @@ struct CallSite<'tcx> {
|
||||||
callee: DefId,
|
callee: DefId,
|
||||||
substs: SubstsRef<'tcx>,
|
substs: SubstsRef<'tcx>,
|
||||||
bb: BasicBlock,
|
bb: BasicBlock,
|
||||||
location: SourceInfo,
|
source_info: SourceInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> MirPass<'tcx> for Inline {
|
impl<'tcx> MirPass<'tcx> for Inline {
|
||||||
|
@ -217,7 +217,7 @@ impl Inliner<'tcx> {
|
||||||
callee: instance.def_id(),
|
callee: instance.def_id(),
|
||||||
substs: instance.substs,
|
substs: instance.substs,
|
||||||
bb,
|
bb,
|
||||||
location: terminator.source_info,
|
source_info: terminator.source_info,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -440,7 +440,7 @@ impl Inliner<'tcx> {
|
||||||
|
|
||||||
for mut scope in callee_body.source_scopes.iter().cloned() {
|
for mut scope in callee_body.source_scopes.iter().cloned() {
|
||||||
if scope.parent_scope.is_none() {
|
if scope.parent_scope.is_none() {
|
||||||
scope.parent_scope = Some(callsite.location.scope);
|
scope.parent_scope = Some(callsite.source_info.scope);
|
||||||
// FIXME(eddyb) is this really needed?
|
// FIXME(eddyb) is this really needed?
|
||||||
// (also note that it's always overwritten below)
|
// (also note that it's always overwritten below)
|
||||||
scope.span = callee_body.span;
|
scope.span = callee_body.span;
|
||||||
|
@ -449,7 +449,7 @@ impl Inliner<'tcx> {
|
||||||
// FIXME(eddyb) this doesn't seem right at all.
|
// FIXME(eddyb) this doesn't seem right at all.
|
||||||
// The inlined source scopes should probably be annotated as
|
// The inlined source scopes should probably be annotated as
|
||||||
// such, but also contain all of the original information.
|
// such, but also contain all of the original information.
|
||||||
scope.span = callsite.location.span;
|
scope.span = callsite.source_info.span;
|
||||||
|
|
||||||
let idx = caller_body.source_scopes.push(scope);
|
let idx = caller_body.source_scopes.push(scope);
|
||||||
scope_map.push(idx);
|
scope_map.push(idx);
|
||||||
|
@ -459,7 +459,7 @@ impl Inliner<'tcx> {
|
||||||
let mut local = callee_body.local_decls[loc].clone();
|
let mut local = callee_body.local_decls[loc].clone();
|
||||||
|
|
||||||
local.source_info.scope = scope_map[local.source_info.scope];
|
local.source_info.scope = scope_map[local.source_info.scope];
|
||||||
local.source_info.span = callsite.location.span;
|
local.source_info.span = callsite.source_info.span;
|
||||||
|
|
||||||
let idx = caller_body.local_decls.push(local);
|
let idx = caller_body.local_decls.push(local);
|
||||||
local_map.push(idx);
|
local_map.push(idx);
|
||||||
|
@ -491,13 +491,13 @@ impl Inliner<'tcx> {
|
||||||
|
|
||||||
let ty = dest.ty(caller_body, self.tcx);
|
let ty = dest.ty(caller_body, self.tcx);
|
||||||
|
|
||||||
let temp = LocalDecl::new(ty, callsite.location.span);
|
let temp = LocalDecl::new(ty, callsite.source_info.span);
|
||||||
|
|
||||||
let tmp = caller_body.local_decls.push(temp);
|
let tmp = caller_body.local_decls.push(temp);
|
||||||
let tmp = Place::from(tmp);
|
let tmp = Place::from(tmp);
|
||||||
|
|
||||||
let stmt = Statement {
|
let stmt = Statement {
|
||||||
source_info: callsite.location,
|
source_info: callsite.source_info,
|
||||||
kind: StatementKind::Assign(box (tmp, dest)),
|
kind: StatementKind::Assign(box (tmp, dest)),
|
||||||
};
|
};
|
||||||
caller_body[callsite.bb].statements.push(stmt);
|
caller_body[callsite.bb].statements.push(stmt);
|
||||||
|
@ -535,7 +535,7 @@ impl Inliner<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let terminator = Terminator {
|
let terminator = Terminator {
|
||||||
source_info: callsite.location,
|
source_info: callsite.source_info,
|
||||||
kind: TerminatorKind::Goto { target: BasicBlock::new(bb_len) },
|
kind: TerminatorKind::Goto { target: BasicBlock::new(bb_len) },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -654,20 +654,23 @@ impl Inliner<'tcx> {
|
||||||
|
|
||||||
let ty = arg.ty(caller_body, self.tcx);
|
let ty = arg.ty(caller_body, self.tcx);
|
||||||
|
|
||||||
let arg_tmp = LocalDecl::new(ty, callsite.location.span);
|
let arg_tmp = LocalDecl::new(ty, callsite.source_info.span);
|
||||||
let arg_tmp = caller_body.local_decls.push(arg_tmp);
|
let arg_tmp = caller_body.local_decls.push(arg_tmp);
|
||||||
|
|
||||||
caller_body[callsite.bb].statements.push(Statement {
|
caller_body[callsite.bb].statements.push(Statement {
|
||||||
source_info: callsite.location,
|
source_info: callsite.source_info,
|
||||||
kind: StatementKind::StorageLive(arg_tmp),
|
kind: StatementKind::StorageLive(arg_tmp),
|
||||||
});
|
});
|
||||||
caller_body[callsite.bb].statements.push(Statement {
|
caller_body[callsite.bb].statements.push(Statement {
|
||||||
source_info: callsite.location,
|
source_info: callsite.source_info,
|
||||||
kind: StatementKind::Assign(box (Place::from(arg_tmp), arg)),
|
kind: StatementKind::Assign(box (Place::from(arg_tmp), arg)),
|
||||||
});
|
});
|
||||||
caller_body[return_block].statements.insert(
|
caller_body[return_block].statements.insert(
|
||||||
0,
|
0,
|
||||||
Statement { source_info: callsite.location, kind: StatementKind::StorageDead(arg_tmp) },
|
Statement {
|
||||||
|
source_info: callsite.source_info,
|
||||||
|
kind: StatementKind::StorageDead(arg_tmp),
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
arg_tmp
|
arg_tmp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue