mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 16:31:04 +01:00
Add typed nodes to SemIR. (#3280)
Replace `SemIR::Node::GetAsFoo` and `SemIR::Node::Foo::Make` with `SemIR::Foo` class that represents a particular kind of node, with named fields. Rename `SemIR::IntegerLiteral` and `SemIR::RealLiteral` to `IntegerValue` / `RealValue` to better reflect their purpose and avoid a name collision with the corresponding `SemIR` node kinds. Remove `NodeKind::Invalid` and the `SemIR::Node` default constructor entirely, as they were not used for anything.
This commit is contained in:
@@ -120,7 +120,8 @@ auto DeclarationNameStack::UpdateScopeIfNeeded(NameContext& name_context)
|
||||
switch (resolved_node.kind()) {
|
||||
case SemIR::NodeKind::Namespace:
|
||||
name_context.state = NameContext::State::Resolved;
|
||||
name_context.target_scope_id = resolved_node.GetAsNamespace();
|
||||
name_context.target_scope_id =
|
||||
resolved_node.As<SemIR::Namespace>().name_scope_id;
|
||||
break;
|
||||
default:
|
||||
name_context.state = NameContext::State::ResolvedNonScope;
|
||||
|
||||
Reference in New Issue
Block a user