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:
Richard Smith
2023-08-02 17:30:27 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent ab709b4117
commit 0c33dead70
71 changed files with 170 additions and 162 deletions
+3 -2
View File
@@ -246,8 +246,9 @@ auto SemanticsIR::StringifyType(SemanticsTypeId type_id) -> std::string {
break;
}
case SemanticsNodeKind::StructTypeField: {
out << "." << GetString(node.GetAsStructTypeField()) << ": ";
steps.push_back({.node_id = GetTypeAllowBuiltinTypes(node.type_id())});
auto [name_id, type_id] = node.GetAsStructTypeField();
out << "." << GetString(name_id) << ": ";
steps.push_back({.node_id = GetTypeAllowBuiltinTypes(type_id)});
break;
}
case SemanticsNodeKind::TupleType: {