mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Rename SemIR::Node to SemIR::Inst (#3355)
And generally replace "node" by "inst" in the code and "instruction" in comments. --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
co-authored by
Chandler Carruth
parent
35c2142392
commit
7edfd8e02a
@@ -28,7 +28,7 @@ auto HandleStructFieldType(Context& context, Parse::Node parse_node) -> bool {
|
||||
auto [name_node, name_id] =
|
||||
context.node_stack().PopWithParseNode<Parse::NodeKind::Name>();
|
||||
|
||||
context.AddNodeAndPush(
|
||||
context.AddInstAndPush(
|
||||
parse_node, SemIR::StructTypeField{name_node, name_id, cast_type_id});
|
||||
return true;
|
||||
}
|
||||
@@ -39,16 +39,16 @@ auto HandleStructFieldUnknown(Context& context, Parse::Node parse_node)
|
||||
}
|
||||
|
||||
auto HandleStructFieldValue(Context& context, Parse::Node parse_node) -> bool {
|
||||
auto [value_parse_node, value_node_id] =
|
||||
auto [value_parse_node, value_inst_id] =
|
||||
context.node_stack().PopExpressionWithParseNode();
|
||||
StringId name_id = context.node_stack().Pop<Parse::NodeKind::Name>();
|
||||
|
||||
// Store the name for the type.
|
||||
context.args_type_info_stack().AddNode(SemIR::StructTypeField{
|
||||
parse_node, name_id, context.nodes().Get(value_node_id).type_id()});
|
||||
context.args_type_info_stack().AddInst(SemIR::StructTypeField{
|
||||
parse_node, name_id, context.insts().Get(value_inst_id).type_id()});
|
||||
|
||||
// Push the value back on the stack as an argument.
|
||||
context.node_stack().Push(parse_node, value_node_id);
|
||||
context.node_stack().Push(parse_node, value_inst_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ auto HandleStructLiteral(Context& context, Parse::Node parse_node) -> bool {
|
||||
auto type_id = context.CanonicalizeStructType(parse_node, type_block_id);
|
||||
|
||||
auto value_id =
|
||||
context.AddNode(SemIR::StructLiteral{parse_node, type_id, refs_id});
|
||||
context.AddInst(SemIR::StructLiteral{parse_node, type_id, refs_id});
|
||||
context.node_stack().Push(parse_node, value_id);
|
||||
return true;
|
||||
}
|
||||
@@ -94,10 +94,10 @@ auto HandleStructTypeLiteral(Context& context, Parse::Node parse_node) -> bool {
|
||||
// This is only used for value literals.
|
||||
context.args_type_info_stack().Pop();
|
||||
|
||||
CARBON_CHECK(refs_id != SemIR::NodeBlockId::Empty)
|
||||
CARBON_CHECK(refs_id != SemIR::InstBlockId::Empty)
|
||||
<< "{} is handled by StructLiteral.";
|
||||
|
||||
context.AddNodeAndPush(
|
||||
context.AddInstAndPush(
|
||||
parse_node,
|
||||
SemIR::StructType{parse_node, SemIR::TypeId::TypeType, refs_id});
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user