IRGen: Move some deployment target checks to LangOptions

This commit is contained in:
Slava Pestov
2019-05-01 13:32:41 -04:00
parent f863700bfa
commit 3b6ec6c651
8 changed files with 44 additions and 44 deletions

View File

@@ -814,15 +814,8 @@ void IRGenerator::addClassForEagerInitialization(ClassDecl *ClassDecl) {
if (!ClassDecl->getAttrs().hasAttribute<StaticInitializeObjCMetadataAttr>())
return;
// Exclude some classes where those attributes make no sense but could be set
// for some reason. Just to be on the safe side.
Type ClassTy = ClassDecl->getDeclaredType();
if (ClassTy->is<UnboundGenericType>())
return;
if (ClassTy->hasArchetype())
return;
if (ClassDecl->hasClangNode())
return;
assert(!ClassDecl->isGenericContext());
assert(!ClassDecl->hasClangNode());
ClassesForEagerInitialization.push_back(ClassDecl);
}