mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 11:55:51 +01:00
Remove the type field from semantics nodes that don't produce values of that type. (#3049)
For `Assign` and `ReturnExpression`, this field wasn't used for anything. For `StructTypeField`, we stored the type of the field here, and now store it as an argument of the node instead. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
ab709b4117
commit
0c33dead70
@@ -34,7 +34,7 @@ auto SemanticsHandleStructFieldType(SemanticsContext& context,
|
||||
context.node_stack().PopWithParseNode<ParseNodeKind::Name>();
|
||||
|
||||
context.AddNodeAndPush(parse_node, SemanticsNode::StructTypeField::Make(
|
||||
name_node, cast_type_id, name_id));
|
||||
name_node, name_id, cast_type_id));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ auto SemanticsHandleStructFieldValue(SemanticsContext& context,
|
||||
context.semantics_ir().AddNode(
|
||||
type_block_id,
|
||||
SemanticsNode::StructTypeField::Make(
|
||||
parse_node, context.semantics_ir().GetNode(value_node_id).type_id(),
|
||||
name_id));
|
||||
parse_node, name_id,
|
||||
context.semantics_ir().GetNode(value_node_id).type_id()));
|
||||
|
||||
// Push the value back on the stack as an argument.
|
||||
context.node_stack().Push(parse_node, value_node_id);
|
||||
|
||||
Reference in New Issue
Block a user