Basic lowering support for classes. (#3334)

Track the fields in a class, and generate a corresponding struct type as
the object representation for the class. For now, we always use a
pointer as the value representation for a class.
This commit is contained in:
Richard Smith
2023-10-25 20:44:24 +00:00
committed by GitHub
parent 7f2f4bec4f
commit 620408b999
18 changed files with 127 additions and 23 deletions
+1 -2
View File
@@ -126,8 +126,7 @@ auto DeclarationNameStack::UpdateScopeIfNeeded(NameContext& name_context)
case SemIR::ClassDeclaration::Kind: {
const auto& class_info = context_->classes().Get(
resolved_node.As<SemIR::ClassDeclaration>().class_id);
// TODO: Check that the class is complete rather than that it has a scope.
if (class_info.scope_id.is_valid()) {
if (class_info.is_defined()) {
name_context.state = NameContext::State::Resolved;
name_context.target_scope_id = class_info.scope_id;
} else {