Rename "local variables" to "explicit stack slots".

The term "local variables" predated the SSA builder in the front-end
crate, which also provides a way to implement source-language local
variables. The name "explicit stack slot" makes it clear what this
construct is.
This commit is contained in:
Dan Gohman
2018-02-28 13:58:46 -08:00
parent c93f29ad1e
commit 5dc449ec9e
8 changed files with 42 additions and 34 deletions

View File

@@ -475,29 +475,29 @@ mod tests {
f.name = ExternalName::testcase("foo");
assert_eq!(f.to_string(), "function %foo() native {\n}\n");
f.create_stack_slot(StackSlotData::new(StackSlotKind::Local, 4));
f.create_stack_slot(StackSlotData::new(StackSlotKind::ExplicitSlot, 4));
assert_eq!(
f.to_string(),
"function %foo() native {\n ss0 = local 4\n}\n"
"function %foo() native {\n ss0 = explicit_slot 4\n}\n"
);
let ebb = f.dfg.make_ebb();
f.layout.append_ebb(ebb);
assert_eq!(
f.to_string(),
"function %foo() native {\n ss0 = local 4\n\nebb0:\n}\n"
"function %foo() native {\n ss0 = explicit_slot 4\n\nebb0:\n}\n"
);
f.dfg.append_ebb_param(ebb, types::I8);
assert_eq!(
f.to_string(),
"function %foo() native {\n ss0 = local 4\n\nebb0(v0: i8):\n}\n"
"function %foo() native {\n ss0 = explicit_slot 4\n\nebb0(v0: i8):\n}\n"
);
f.dfg.append_ebb_param(ebb, types::F32.by(4).unwrap());
assert_eq!(
f.to_string(),
"function %foo() native {\n ss0 = local 4\n\nebb0(v0: i8, v1: f32x4):\n}\n"
"function %foo() native {\n ss0 = explicit_slot 4\n\nebb0(v0: i8, v1: f32x4):\n}\n"
);
}
}