]> git.lizzy.rs Git - rust.git/commitdiff
Change the `local` prefix to `_`
authorJonas Schievink <jonasschievink@gmail.com>
Wed, 28 Sep 2016 23:11:54 +0000 (01:11 +0200)
committerJonas Schievink <jonasschievink@gmail.com>
Wed, 28 Sep 2016 23:11:54 +0000 (01:11 +0200)
There's no need for a long prefix, since there's nothing to distinguish
anymore.

src/librustc/mir/repr.rs
src/librustc_trans/mir/constant.rs
src/test/codegen/lifetime_start_end.rs
src/test/mir-opt/deaggregator_test.rs
src/test/mir-opt/deaggregator_test_enum.rs
src/test/mir-opt/storage_ranges.rs

index 34b46ed66a24636d9b6fe4543c213affe01f8c80..5da2e2f6fda5444d763ad1c1ffe515fa033d4a00 100644 (file)
@@ -85,7 +85,7 @@ pub struct Mir<'tcx> {
 
     /// Number of arguments this function takes.
     ///
-    /// Starting at local1, `arg_count` locals will be provided by the caller
+    /// Starting at local 1, `arg_count` locals will be provided by the caller
     /// and can be assumed to be initialized.
     ///
     /// If this MIR was built for a constant, this will be 0.
@@ -323,7 +323,7 @@ pub enum BorrowKind {
 ///////////////////////////////////////////////////////////////////////////
 // Variables and temps
 
-newtype_index!(Local, "local");
+newtype_index!(Local, "_");
 
 pub const RETURN_POINTER: Local = Local(0);
 
index b68a9a962c71077a3901ab5004c9f823cf9ee5e2..c0e7af845ec4f5c4b9d71902410bf3df9e1e6aa7 100644 (file)
@@ -230,7 +230,7 @@ fn new(ccx: &'a CrateContext<'a, 'tcx>,
             locals: (0..mir.local_decls.len()).map(|_| None).collect(),
         };
         for (i, arg) in args.into_iter().enumerate() {
-            // Locals after local0 are the function arguments
+            // Locals after local 0 are the function arguments
             let index = mir::Local::new(i + 1);
             context.locals[index] = Some(arg);
         }
index 128eb72d212617f150b4ac70833f303c386f760b..81f6cf309da50f3ee84e58a062dae5b6361d33f5 100644 (file)
@@ -30,11 +30,11 @@ pub fn test() {
 // CHECK: [[S_b:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"** %b to i8*
 // CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S_b]])
 
-// CHECK: [[S_local5:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"* %local5 to i8*
-// CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S_local5]])
+// CHECK: [[S__5:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"* %_5 to i8*
+// CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S__5]])
 
-// CHECK: [[E_local5:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"* %local5 to i8*
-// CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E_local5]])
+// CHECK: [[E__5:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"* %_5 to i8*
+// CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E__5]])
 
 // CHECK: [[E_b:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"** %b to i8*
 // CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E_b]])
index 66c3dfbf48cf36dd6713dc0ba1c41c1d23874a7b..36738ba1f7d84fdbd42617953ce37718f2fce56b 100644 (file)
@@ -23,19 +23,19 @@ fn main() {}
 // END RUST SOURCE
 // START rustc.node13.Deaggregator.before.mir
 // bb0: {
-//     local2 = local1;                     // scope 0 at main.rs:8:8: 8:9
-//     local3 = local2;                     // scope 1 at main.rs:9:14: 9:15
-//     local0 = Baz { x: local3, y: const F32(0), z: const false }; // scope ...
+//     _2 = _1;                     // scope 0 at main.rs:8:8: 8:9
+//     _3 = _2;                     // scope 1 at main.rs:9:14: 9:15
+//     _0 = Baz { x: _3, y: const F32(0), z: const false }; // scope ...
 //     goto -> bb1;                     // scope 1 at main.rs:8:1: 10:2
 // }
 // END rustc.node13.Deaggregator.before.mir
 // START rustc.node13.Deaggregator.after.mir
 // bb0: {
-//     local2 = local1;                     // scope 0 at main.rs:8:8: 8:9
-//     local3 = local2;                     // scope 1 at main.rs:9:14: 9:15
-//     (local0.0: usize) = local3;        // scope 1 at main.rs:9:5: 9:34
-//     (local0.1: f32) = const F32(0);  // scope 1 at main.rs:9:5: 9:34
-//     (local0.2: bool) = const false;  // scope 1 at main.rs:9:5: 9:34
+//     _2 = _1;                     // scope 0 at main.rs:8:8: 8:9
+//     _3 = _2;                     // scope 1 at main.rs:9:14: 9:15
+//     (_0.0: usize) = _3;        // scope 1 at main.rs:9:5: 9:34
+//     (_0.1: f32) = const F32(0);  // scope 1 at main.rs:9:5: 9:34
+//     (_0.2: bool) = const false;  // scope 1 at main.rs:9:5: 9:34
 //     goto -> bb1;                     // scope 1 at main.rs:8:1: 10:2
 // }
 // END rustc.node13.Deaggregator.after.mir
index 5d182f367b5fdd381f5a6d0f7abf0e570a2de924..f5426e410cfe534e196a56c019bf02ea3c9c170c 100644 (file)
@@ -28,18 +28,18 @@ fn main() {
 // END RUST SOURCE
 // START rustc.node10.Deaggregator.before.mir
 // bb0: {
-//     local2 = local1;                     // scope 0 at main.rs:7:8: 7:9
-//     local3 = local2;                     // scope 1 at main.rs:8:19: 8:20
-//     local0 = Baz::Foo { x: local3 };   // scope 1 at main.rs:8:5: 8:21
+//     _2 = _1;                     // scope 0 at main.rs:7:8: 7:9
+//     _3 = _2;                     // scope 1 at main.rs:8:19: 8:20
+//     _0 = Baz::Foo { x: _3 };   // scope 1 at main.rs:8:5: 8:21
 //     goto -> bb1;                     // scope 1 at main.rs:7:1: 9:2
 // }
 // END rustc.node10.Deaggregator.before.mir
 // START rustc.node10.Deaggregator.after.mir
 // bb0: {
-//     local2 = local1;                     // scope 0 at main.rs:7:8: 7:9
-//     local3 = local2;                     // scope 1 at main.rs:8:19: 8:20
-//     ((local0 as Foo).0: usize) = local3; // scope 1 at main.rs:8:5: 8:21
-//     discriminant(local0) = 1;         // scope 1 at main.rs:8:5: 8:21
+//     _2 = _1;                     // scope 0 at main.rs:7:8: 7:9
+//     _3 = _2;                     // scope 1 at main.rs:8:19: 8:20
+//     ((_0 as Foo).0: usize) = _3; // scope 1 at main.rs:8:5: 8:21
+//     discriminant(_0) = 1;         // scope 1 at main.rs:8:5: 8:21
 //     goto -> bb1;                     // scope 1 at main.rs:7:1: 9:2
 // }
 // END rustc.node10.Deaggregator.after.mir
index a4905281e4636bf703bc13f46afe2b20fffc419c..aa798231b34a39ed664ab578ad4793e2ff0e1d16 100644 (file)
@@ -21,23 +21,23 @@ fn main() {
 // END RUST SOURCE
 // START rustc.node4.TypeckMir.before.mir
 //     bb0: {
-//         StorageLive(local1);             // scope 0 at storage_ranges.rs:12:9: 12:10
-//         local1 = const 0i32;             // scope 0 at storage_ranges.rs:12:13: 12:14
-//         StorageLive(local3);             // scope 1 at storage_ranges.rs:14:13: 14:14
-//         StorageLive(local4);             // scope 1 at storage_ranges.rs:14:18: 14:25
-//         StorageLive(local5);             // scope 1 at storage_ranges.rs:14:23: 14:24
-//         local5 = local1;                 // scope 1 at storage_ranges.rs:14:23: 14:24
-//         local4 = std::option::Option<i32>::Some(local5,); // scope 1 at storage_ranges.rs:14:18: 14:25
-//         local3 = &local4;                // scope 1 at storage_ranges.rs:14:17: 14:25
-//         StorageDead(local5);             // scope 1 at storage_ranges.rs:14:23: 14:24
-//         local2 = ();                     // scope 2 at storage_ranges.rs:13:5: 15:6
-//         StorageDead(local4);             // scope 1 at storage_ranges.rs:14:18: 14:25
-//         StorageDead(local3);             // scope 1 at storage_ranges.rs:14:13: 14:14
-//         StorageLive(local6);             // scope 1 at storage_ranges.rs:16:9: 16:10
-//         local6 = const 1i32;             // scope 1 at storage_ranges.rs:16:13: 16:14
-//         local0 = ();                     // scope 3 at storage_ranges.rs:11:11: 17:2
-//         StorageDead(local6);             // scope 1 at storage_ranges.rs:16:9: 16:10
-//         StorageDead(local1);             // scope 0 at storage_ranges.rs:14:9: 14:10
+//         StorageLive(_1);             // scope 0 at storage_ranges.rs:12:9: 12:10
+//         _1 = const 0i32;             // scope 0 at storage_ranges.rs:12:13: 12:14
+//         StorageLive(_3);             // scope 1 at storage_ranges.rs:14:13: 14:14
+//         StorageLive(_4);             // scope 1 at storage_ranges.rs:14:18: 14:25
+//         StorageLive(_5);             // scope 1 at storage_ranges.rs:14:23: 14:24
+//         _5 = _1;                 // scope 1 at storage_ranges.rs:14:23: 14:24
+//         _4 = std::option::Option<i32>::Some(_5,); // scope 1 at storage_ranges.rs:14:18: 14:25
+//         _3 = &_4;                // scope 1 at storage_ranges.rs:14:17: 14:25
+//         StorageDead(_5);             // scope 1 at storage_ranges.rs:14:23: 14:24
+//         _2 = ();                     // scope 2 at storage_ranges.rs:13:5: 15:6
+//         StorageDead(_4);             // scope 1 at storage_ranges.rs:14:18: 14:25
+//         StorageDead(_3);             // scope 1 at storage_ranges.rs:14:13: 14:14
+//         StorageLive(_6);             // scope 1 at storage_ranges.rs:16:9: 16:10
+//         _6 = const 1i32;             // scope 1 at storage_ranges.rs:16:13: 16:14
+//         _0 = ();                     // scope 3 at storage_ranges.rs:11:11: 17:2
+//         StorageDead(_6);             // scope 1 at storage_ranges.rs:16:9: 16:10
+//         StorageDead(_1);             // scope 0 at storage_ranges.rs:14:9: 14:10
 //         goto -> bb1;                     // scope 0 at storage_ranges.rs:11:1: 17:2
 //     }
 //