Skip to content

Commit 8c942c1

Browse files
committed
rustc_mir: rename location: SourceInfo to source_info.
1 parent 31530e5 commit 8c942c1

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

compiler/rustc_mir/src/transform/inline.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct CallSite<'tcx> {
3333
callee: DefId,
3434
substs: SubstsRef<'tcx>,
3535
bb: BasicBlock,
36-
location: SourceInfo,
36+
source_info: SourceInfo,
3737
}
3838

3939
impl<'tcx> MirPass<'tcx> for Inline {
@@ -217,7 +217,7 @@ impl Inliner<'tcx> {
217217
callee: instance.def_id(),
218218
substs: instance.substs,
219219
bb,
220-
location: terminator.source_info,
220+
source_info: terminator.source_info,
221221
});
222222
}
223223
}
@@ -440,7 +440,7 @@ impl Inliner<'tcx> {
440440

441441
for mut scope in callee_body.source_scopes.iter().cloned() {
442442
if scope.parent_scope.is_none() {
443-
scope.parent_scope = Some(callsite.location.scope);
443+
scope.parent_scope = Some(callsite.source_info.scope);
444444
// FIXME(eddyb) is this really needed?
445445
// (also note that it's always overwritten below)
446446
scope.span = callee_body.span;
@@ -449,7 +449,7 @@ impl Inliner<'tcx> {
449449
// FIXME(eddyb) this doesn't seem right at all.
450450
// The inlined source scopes should probably be annotated as
451451
// such, but also contain all of the original information.
452-
scope.span = callsite.location.span;
452+
scope.span = callsite.source_info.span;
453453

454454
let idx = caller_body.source_scopes.push(scope);
455455
scope_map.push(idx);
@@ -459,7 +459,7 @@ impl Inliner<'tcx> {
459459
let mut local = callee_body.local_decls[loc].clone();
460460

461461
local.source_info.scope = scope_map[local.source_info.scope];
462-
local.source_info.span = callsite.location.span;
462+
local.source_info.span = callsite.source_info.span;
463463

464464
let idx = caller_body.local_decls.push(local);
465465
local_map.push(idx);
@@ -491,13 +491,13 @@ impl Inliner<'tcx> {
491491

492492
let ty = dest.ty(caller_body, self.tcx);
493493

494-
let temp = LocalDecl::new(ty, callsite.location.span);
494+
let temp = LocalDecl::new(ty, callsite.source_info.span);
495495

496496
let tmp = caller_body.local_decls.push(temp);
497497
let tmp = Place::from(tmp);
498498

499499
let stmt = Statement {
500-
source_info: callsite.location,
500+
source_info: callsite.source_info,
501501
kind: StatementKind::Assign(box (tmp, dest)),
502502
};
503503
caller_body[callsite.bb].statements.push(stmt);
@@ -535,7 +535,7 @@ impl Inliner<'tcx> {
535535
}
536536

537537
let terminator = Terminator {
538-
source_info: callsite.location,
538+
source_info: callsite.source_info,
539539
kind: TerminatorKind::Goto { target: BasicBlock::new(bb_len) },
540540
};
541541

@@ -654,20 +654,23 @@ impl Inliner<'tcx> {
654654

655655
let ty = arg.ty(caller_body, self.tcx);
656656

657-
let arg_tmp = LocalDecl::new(ty, callsite.location.span);
657+
let arg_tmp = LocalDecl::new(ty, callsite.source_info.span);
658658
let arg_tmp = caller_body.local_decls.push(arg_tmp);
659659

660660
caller_body[callsite.bb].statements.push(Statement {
661-
source_info: callsite.location,
661+
source_info: callsite.source_info,
662662
kind: StatementKind::StorageLive(arg_tmp),
663663
});
664664
caller_body[callsite.bb].statements.push(Statement {
665-
source_info: callsite.location,
665+
source_info: callsite.source_info,
666666
kind: StatementKind::Assign(box (Place::from(arg_tmp), arg)),
667667
});
668668
caller_body[return_block].statements.insert(
669669
0,
670-
Statement { source_info: callsite.location, kind: StatementKind::StorageDead(arg_tmp) },
670+
Statement {
671+
source_info: callsite.source_info,
672+
kind: StatementKind::StorageDead(arg_tmp),
673+
},
671674
);
672675

673676
arg_tmp

0 commit comments

Comments
 (0)