mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -238,9 +238,9 @@ auto FileContext::BuildType(SemIR::NodeId node_id) -> llvm::Type* {
|
||||
auto field = semantics_ir_->GetNodeAs<SemIR::StructTypeField>(field_id);
|
||||
// TODO: Handle recursive types. The restriction for builtins prevents
|
||||
// recursion while still letting them cache.
|
||||
CARBON_CHECK(field.type_id.index < SemIR::BuiltinKind::ValidCount)
|
||||
<< field.type_id;
|
||||
subtypes.push_back(GetType(field.type_id));
|
||||
CARBON_CHECK(field.field_type_id.index < SemIR::BuiltinKind::ValidCount)
|
||||
<< field.field_type_id;
|
||||
subtypes.push_back(GetType(field.field_type_id));
|
||||
}
|
||||
return llvm::StructType::get(*llvm_context_, subtypes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user