Skip to content

Commit 5449278

Browse files
committed
Sema: Don't finalize types defined in primary files
We already do everything in typeCheckDecl(), so there's no need to walk the members of the type again.
1 parent 22fe618 commit 5449278

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4373,6 +4373,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
43734373

43744374
TC.validateDecl(ED);
43754375
TC.DeclsToFinalize.remove(ED);
4376+
ED->setHasValidatedLayout();
43764377

43774378
{
43784379
// Check for circular inheritance of the raw type.
@@ -4406,6 +4407,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
44064407

44074408
TC.validateDecl(SD);
44084409
TC.DeclsToFinalize.remove(SD);
4410+
SD->setHasValidatedLayout();
44094411

44104412
TC.addImplicitConstructors(SD);
44114413

@@ -4531,6 +4533,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
45314533
TC.validateDecl(CD);
45324534
TC.requestSuperclassLayout(CD);
45334535
TC.DeclsToFinalize.remove(CD);
4536+
CD->setHasValidatedLayout();
45344537

45354538
{
45364539
// Check for circular inheritance.
@@ -6911,7 +6914,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
69116914
}
69126915

69136916
if (!isa<ClassDecl>(nominal))
6914-
DeclsToFinalize.insert(nominal);
6917+
requestNominalLayout(nominal);
69156918

69166919
break;
69176920
}

0 commit comments

Comments
 (0)