Merge branch 'master' into master-next

This commit is contained in:
Bob Wilson
2017-05-08 23:44:23 -07:00
31 changed files with 1021 additions and 115 deletions

View File

@@ -549,6 +549,9 @@ llvm::Constant *swift::getWrapperFn(llvm::Module &Module,
#define FUNCTION_FOR_CONV_C_CC(ID, NAME, CC, RETURNS, ARGS, ATTRS) \
FUNCTION_IMPL(ID, NAME, CC, QUOTE(RETURNS), QUOTE(ARGS), QUOTE(ATTRS))
#define FUNCTION_FOR_CONV_SwiftCC(ID, NAME, CC, RETURNS, ARGS, ATTRS) \
FUNCTION_IMPL(ID, NAME, CC, QUOTE(RETURNS), QUOTE(ARGS), QUOTE(ATTRS))
#define FUNCTION_FOR_CONV_RegisterPreservingCC(ID, NAME, CC, RETURNS, ARGS, \
ATTRS) \
FUNCTION_WITH_GLOBAL_SYMBOL_IMPL(ID, NAME, SWIFT_RT_ENTRY_REF(NAME), CC, \
@@ -739,6 +742,26 @@ void IRGenerator::addLazyWitnessTable(const ProtocolConformance *Conf) {
}
}
void IRGenerator::addClassForArchiveNameRegistration(ClassDecl *ClassDecl) {
// Those two attributes are interesting to us
if (!ClassDecl->getAttrs().hasAttribute<NSKeyedArchiveLegacyAttr>() &&
!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;
ClassesForArchiveNameRegistration.push_back(ClassDecl);
}
llvm::AttributeList IRGenModule::getAllocAttrs() {
if (AllocAttrs.isEmpty()) {
AllocAttrs =