Skip to content

Commit

Permalink
Change the local prefix to _
Browse files Browse the repository at this point in the history
There's no need for a long prefix, since there's nothing to distinguish
anymore.
  • Loading branch information
jonas-schievink committed Sep 28, 2016
1 parent 168a079 commit 34155a8
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/librustc/mir/repr.rs
Expand Up @@ -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.
Expand Down Expand Up @@ -323,7 +323,7 @@ pub enum BorrowKind {
///////////////////////////////////////////////////////////////////////////
// Variables and temps

newtype_index!(Local, "local");
newtype_index!(Local, "_");

pub const RETURN_POINTER: Local = Local(0);

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/mir/constant.rs
Expand Up @@ -230,7 +230,7 @@ impl<'a, 'tcx> MirConstContext<'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);
}
Expand Down
8 changes: 4 additions & 4 deletions src/test/codegen/lifetime_start_end.rs
Expand Up @@ -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]])
Expand Down
16 changes: 8 additions & 8 deletions src/test/mir-opt/deaggregator_test.rs
Expand Up @@ -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
14 changes: 7 additions & 7 deletions src/test/mir-opt/deaggregator_test_enum.rs
Expand Up @@ -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
34 changes: 17 additions & 17 deletions src/test/mir-opt/storage_ranges.rs
Expand Up @@ -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
// }
//
Expand Down

0 comments on commit 34155a8

Please sign in to comment.