mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-23 16:52:39 +00: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:
1 parent
0e8e94d8bf
commit
c7a9e29a89
41 files changed
+1445
-954
No files matched your search
@@ -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