mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
CustomAvailability: avoid exposing the synthesized function for dynamic availability checking as an API entry
For dynamic features defined from a header, we synthesize a pure Clang function to check whether the feature should be enabled at runtime. Swift modules don't have capability to deserialize this clang predicate function, leading to crasher as a result. This change fixes the crasher by hiding the synthesized function to be a module internal one. rdar://164410957
This commit is contained in:
@@ -3183,9 +3183,7 @@ FuncDecl *SwiftDeclSynthesizer::makeAvailabilityDomainPredicate(
|
||||
BuiltinIntegerType::get(1, ctx), ImporterImpl.ImportedHeaderUnit);
|
||||
funcDecl->setBodySynthesizer(synthesizeAvailabilityDomainPredicateBody,
|
||||
(void *)var);
|
||||
funcDecl->setAccess(AccessLevel::Public);
|
||||
funcDecl->addAttribute(
|
||||
new (ctx) ExportAttr(ExportKind::Implementation, /*IsImplicit=*/true));
|
||||
funcDecl->setAccess(AccessLevel::Internal);
|
||||
|
||||
ImporterImpl.availabilityDomainPredicates[var] = funcDecl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user