about summary refs log tree commit diff
path: root/compiler/rustc_mir
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2020-02-08 20:24:42 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2020-10-21 04:43:55 +0300
commit8c942c1511cc99fbc8f3e6ed56e5e3cfd8c0ff4a (patch)
treee7dffcf7cfeb0ac3635fb51418e6e6f3f9ed227e /compiler/rustc_mir
parent31530e5d132ebcc3654baf2e5460599681520af0 (diff)
downloadrust-8c942c1511cc99fbc8f3e6ed56e5e3cfd8c0ff4a.tar.gz
rust-8c942c1511cc99fbc8f3e6ed56e5e3cfd8c0ff4a.zip
rustc_mir: rename `location: SourceInfo` to `source_info`.
Diffstat (limited to 'compiler/rustc_mir')
-rw-r--r--compiler/rustc_mir/src/transform/inline.rs27
1 files changed, 15 insertions, 12 deletions
diff --git a/compiler/rustc_mir/src/transform/inline.rs b/compiler/rustc_mir/src/transform/inline.rs
index 796ad6c9c29..5163e025cba 100644
--- a/compiler/rustc_mir/src/transform/inline.rs
+++ b/compiler/rustc_mir/src/transform/inline.rs
@@ -33,7 +33,7 @@ struct CallSite<'tcx> {
     callee: DefId,
     substs: SubstsRef<'tcx>,
     bb: BasicBlock,
-    location: SourceInfo,
+    source_info: SourceInfo,
 }
 
 impl<'tcx> MirPass<'tcx> for Inline {
@@ -217,7 +217,7 @@ impl Inliner<'tcx> {
                     callee: instance.def_id(),
                     substs: instance.substs,
                     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() {
                     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?
                         // (also note that it's always overwritten below)
                         scope.span = callee_body.span;
@@ -449,7 +449,7 @@ impl Inliner<'tcx> {
                     // FIXME(eddyb) this doesn't seem right at all.
                     // The inlined source scopes should probably be annotated as
                     // 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);
                     scope_map.push(idx);
@@ -459,7 +459,7 @@ impl Inliner<'tcx> {
                     let mut local = callee_body.local_decls[loc].clone();
 
                     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);
                     local_map.push(idx);
@@ -491,13 +491,13 @@ impl Inliner<'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 = Place::from(tmp);
 
                     let stmt = Statement {
-                        source_info: callsite.location,
+                        source_info: callsite.source_info,
                         kind: StatementKind::Assign(box (tmp, dest)),
                     };
                     caller_body[callsite.bb].statements.push(stmt);
@@ -535,7 +535,7 @@ impl Inliner<'tcx> {
                 }
 
                 let terminator = Terminator {
-                    source_info: callsite.location,
+                    source_info: callsite.source_info,
                     kind: TerminatorKind::Goto { target: BasicBlock::new(bb_len) },
                 };
 
@@ -654,20 +654,23 @@ impl Inliner<'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);
 
         caller_body[callsite.bb].statements.push(Statement {
-            source_info: callsite.location,
+            source_info: callsite.source_info,
             kind: StatementKind::StorageLive(arg_tmp),
         });
         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)),
         });
         caller_body[return_block].statements.insert(
             0,
-            Statement { source_info: callsite.location, kind: StatementKind::StorageDead(arg_tmp) },
+            Statement {
+                source_info: callsite.source_info,
+                kind: StatementKind::StorageDead(arg_tmp),
+            },
         );
 
         arg_tmp