mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 09:11:04 +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
@@ -476,8 +476,9 @@ auto SemanticsContext::CanonicalizeStructType(ParseTree::Node parse_node,
|
||||
llvm::FoldingSetNodeID canonical_id;
|
||||
for (const auto& ref_id : refs) {
|
||||
auto ref = semantics_ir_->GetNode(ref_id);
|
||||
canonical_id.AddInteger(ref.GetAsStructTypeField().index);
|
||||
canonical_id.AddInteger(ref.type_id().index);
|
||||
auto [name_id, type_id] = ref.GetAsStructTypeField();
|
||||
canonical_id.AddInteger(name_id.index);
|
||||
canonical_id.AddInteger(type_id.index);
|
||||
}
|
||||
|
||||
// If a struct with matching fields was already created, reuse it.
|
||||
|
||||
Reference in New Issue
Block a user