Skip to content

Commit 34155a8

Browse files
Change the local prefix to _
There's no need for a long prefix, since there's nothing to distinguish anymore.
1 parent 168a079 commit 34155a8

File tree

6 files changed

+39
-39
lines changed

6 files changed

+39
-39
lines changed

src/librustc/mir/repr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub struct Mir<'tcx> {
8585

8686
/// Number of arguments this function takes.
8787
///
88-
/// Starting at local1, `arg_count` locals will be provided by the caller
88+
/// Starting at local 1, `arg_count` locals will be provided by the caller
8989
/// and can be assumed to be initialized.
9090
///
9191
/// If this MIR was built for a constant, this will be 0.
@@ -323,7 +323,7 @@ pub enum BorrowKind {
323323
///////////////////////////////////////////////////////////////////////////
324324
// Variables and temps
325325

326-
newtype_index!(Local, "local");
326+
newtype_index!(Local, "_");
327327

328328
pub const RETURN_POINTER: Local = Local(0);
329329

src/librustc_trans/mir/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl<'a, 'tcx> MirConstContext<'a, 'tcx> {
230230
locals: (0..mir.local_decls.len()).map(|_| None).collect(),
231231
};
232232
for (i, arg) in args.into_iter().enumerate() {
233-
// Locals after local0 are the function arguments
233+
// Locals after local 0 are the function arguments
234234
let index = mir::Local::new(i + 1);
235235
context.locals[index] = Some(arg);
236236
}

src/test/codegen/lifetime_start_end.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ pub fn test() {
3030
// CHECK: [[S_b:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"** %b to i8*
3131
// CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S_b]])
3232

33-
// CHECK: [[S_local5:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"* %local5 to i8*
34-
// CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S_local5]])
33+
// CHECK: [[S__5:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"* %_5 to i8*
34+
// CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S__5]])
3535

36-
// CHECK: [[E_local5:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"* %local5 to i8*
37-
// CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E_local5]])
36+
// CHECK: [[E__5:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"* %_5 to i8*
37+
// CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E__5]])
3838

3939
// CHECK: [[E_b:%[0-9]+]] = bitcast %"2.std::option::Option<i32>"** %b to i8*
4040
// CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E_b]])

src/test/mir-opt/deaggregator_test.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ fn main() {}
2323
// END RUST SOURCE
2424
// START rustc.node13.Deaggregator.before.mir
2525
// bb0: {
26-
// local2 = local1; // scope 0 at main.rs:8:8: 8:9
27-
// local3 = local2; // scope 1 at main.rs:9:14: 9:15
28-
// local0 = Baz { x: local3, y: const F32(0), z: const false }; // scope ...
26+
// _2 = _1; // scope 0 at main.rs:8:8: 8:9
27+
// _3 = _2; // scope 1 at main.rs:9:14: 9:15
28+
// _0 = Baz { x: _3, y: const F32(0), z: const false }; // scope ...
2929
// goto -> bb1; // scope 1 at main.rs:8:1: 10:2
3030
// }
3131
// END rustc.node13.Deaggregator.before.mir
3232
// START rustc.node13.Deaggregator.after.mir
3333
// bb0: {
34-
// local2 = local1; // scope 0 at main.rs:8:8: 8:9
35-
// local3 = local2; // scope 1 at main.rs:9:14: 9:15
36-
// (local0.0: usize) = local3; // scope 1 at main.rs:9:5: 9:34
37-
// (local0.1: f32) = const F32(0); // scope 1 at main.rs:9:5: 9:34
38-
// (local0.2: bool) = const false; // scope 1 at main.rs:9:5: 9:34
34+
// _2 = _1; // scope 0 at main.rs:8:8: 8:9
35+
// _3 = _2; // scope 1 at main.rs:9:14: 9:15
36+
// (_0.0: usize) = _3; // scope 1 at main.rs:9:5: 9:34
37+
// (_0.1: f32) = const F32(0); // scope 1 at main.rs:9:5: 9:34
38+
// (_0.2: bool) = const false; // scope 1 at main.rs:9:5: 9:34
3939
// goto -> bb1; // scope 1 at main.rs:8:1: 10:2
4040
// }
4141
// END rustc.node13.Deaggregator.after.mir

src/test/mir-opt/deaggregator_test_enum.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ fn main() {
2828
// END RUST SOURCE
2929
// START rustc.node10.Deaggregator.before.mir
3030
// bb0: {
31-
// local2 = local1; // scope 0 at main.rs:7:8: 7:9
32-
// local3 = local2; // scope 1 at main.rs:8:19: 8:20
33-
// local0 = Baz::Foo { x: local3 }; // scope 1 at main.rs:8:5: 8:21
31+
// _2 = _1; // scope 0 at main.rs:7:8: 7:9
32+
// _3 = _2; // scope 1 at main.rs:8:19: 8:20
33+
// _0 = Baz::Foo { x: _3 }; // scope 1 at main.rs:8:5: 8:21
3434
// goto -> bb1; // scope 1 at main.rs:7:1: 9:2
3535
// }
3636
// END rustc.node10.Deaggregator.before.mir
3737
// START rustc.node10.Deaggregator.after.mir
3838
// bb0: {
39-
// local2 = local1; // scope 0 at main.rs:7:8: 7:9
40-
// local3 = local2; // scope 1 at main.rs:8:19: 8:20
41-
// ((local0 as Foo).0: usize) = local3; // scope 1 at main.rs:8:5: 8:21
42-
// discriminant(local0) = 1; // scope 1 at main.rs:8:5: 8:21
39+
// _2 = _1; // scope 0 at main.rs:7:8: 7:9
40+
// _3 = _2; // scope 1 at main.rs:8:19: 8:20
41+
// ((_0 as Foo).0: usize) = _3; // scope 1 at main.rs:8:5: 8:21
42+
// discriminant(_0) = 1; // scope 1 at main.rs:8:5: 8:21
4343
// goto -> bb1; // scope 1 at main.rs:7:1: 9:2
4444
// }
4545
// END rustc.node10.Deaggregator.after.mir

src/test/mir-opt/storage_ranges.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ fn main() {
2121
// END RUST SOURCE
2222
// START rustc.node4.TypeckMir.before.mir
2323
// bb0: {
24-
// StorageLive(local1); // scope 0 at storage_ranges.rs:12:9: 12:10
25-
// local1 = const 0i32; // scope 0 at storage_ranges.rs:12:13: 12:14
26-
// StorageLive(local3); // scope 1 at storage_ranges.rs:14:13: 14:14
27-
// StorageLive(local4); // scope 1 at storage_ranges.rs:14:18: 14:25
28-
// StorageLive(local5); // scope 1 at storage_ranges.rs:14:23: 14:24
29-
// local5 = local1; // scope 1 at storage_ranges.rs:14:23: 14:24
30-
// local4 = std::option::Option<i32>::Some(local5,); // scope 1 at storage_ranges.rs:14:18: 14:25
31-
// local3 = &local4; // scope 1 at storage_ranges.rs:14:17: 14:25
32-
// StorageDead(local5); // scope 1 at storage_ranges.rs:14:23: 14:24
33-
// local2 = (); // scope 2 at storage_ranges.rs:13:5: 15:6
34-
// StorageDead(local4); // scope 1 at storage_ranges.rs:14:18: 14:25
35-
// StorageDead(local3); // scope 1 at storage_ranges.rs:14:13: 14:14
36-
// StorageLive(local6); // scope 1 at storage_ranges.rs:16:9: 16:10
37-
// local6 = const 1i32; // scope 1 at storage_ranges.rs:16:13: 16:14
38-
// local0 = (); // scope 3 at storage_ranges.rs:11:11: 17:2
39-
// StorageDead(local6); // scope 1 at storage_ranges.rs:16:9: 16:10
40-
// StorageDead(local1); // scope 0 at storage_ranges.rs:14:9: 14:10
24+
// StorageLive(_1); // scope 0 at storage_ranges.rs:12:9: 12:10
25+
// _1 = const 0i32; // scope 0 at storage_ranges.rs:12:13: 12:14
26+
// StorageLive(_3); // scope 1 at storage_ranges.rs:14:13: 14:14
27+
// StorageLive(_4); // scope 1 at storage_ranges.rs:14:18: 14:25
28+
// StorageLive(_5); // scope 1 at storage_ranges.rs:14:23: 14:24
29+
// _5 = _1; // scope 1 at storage_ranges.rs:14:23: 14:24
30+
// _4 = std::option::Option<i32>::Some(_5,); // scope 1 at storage_ranges.rs:14:18: 14:25
31+
// _3 = &_4; // scope 1 at storage_ranges.rs:14:17: 14:25
32+
// StorageDead(_5); // scope 1 at storage_ranges.rs:14:23: 14:24
33+
// _2 = (); // scope 2 at storage_ranges.rs:13:5: 15:6
34+
// StorageDead(_4); // scope 1 at storage_ranges.rs:14:18: 14:25
35+
// StorageDead(_3); // scope 1 at storage_ranges.rs:14:13: 14:14
36+
// StorageLive(_6); // scope 1 at storage_ranges.rs:16:9: 16:10
37+
// _6 = const 1i32; // scope 1 at storage_ranges.rs:16:13: 16:14
38+
// _0 = (); // scope 3 at storage_ranges.rs:11:11: 17:2
39+
// StorageDead(_6); // scope 1 at storage_ranges.rs:16:9: 16:10
40+
// StorageDead(_1); // scope 0 at storage_ranges.rs:14:9: 14:10
4141
// goto -> bb1; // scope 0 at storage_ranges.rs:11:1: 17:2
4242
// }
4343
//

0 commit comments

Comments
 (0)