mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge branch 'master' into master-next
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user