Remove most of the metaprogramming in node.h in favor of listing all the members in the typed node structs. (#3310)

Split `node.h` into separate files for ID types (`id.h`) and for typed
nodes (`typed_nodes.h`). The per-node-kind data is now specified as part
of declaring the typed nodes, and is removed from the node kinds
x-macros, which now simply enumerate the node kinds.
This commit is contained in:
Richard Smith authored and GitHub committed 2023-10-20 20:26:10 +00:00
1 parent e54deee525
commit a46e7dd967
31 files changed
+1240 -957

No files matched your search

+2 -2
View File
@@ -49,7 +49,7 @@ auto HandleReturnStatement(Context& context, Parse::Node parse_node) -> bool {
.Emit();
}
context.AddNode(SemIR::Return(parse_node));
context.AddNode(SemIR::Return{parse_node});
} else {
auto arg = context.node_stack().PopExpression();
context.node_stack()
@@ -72,7 +72,7 @@ auto HandleReturnStatement(Context& context, Parse::Node parse_node) -> bool {
callable.return_type_id);
}
context.AddNode(SemIR::ReturnExpression(parse_node, arg));
context.AddNode(SemIR::ReturnExpression{parse_node, arg});
}
// Switch to a new, unreachable, empty node block. This typically won't