mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
IRGen: Exclude unavailable enum cases from runtime layout calculations.
When `-unavailable-decl-optimization=complete` is specified, exclude unavailable enum cases from the runtime layout of enums with payloads. Without this, the type metadata for unavailable types may be referenced by enum cases with unavailable payloads and cause linker failures. Resolves rdar://107483852
This commit is contained in:
@@ -956,7 +956,7 @@ bool Lowering::usesObjCAllocator(ClassDecl *theClass) {
|
||||
return theClass->getObjectModel() == ReferenceCounting::ObjC;
|
||||
}
|
||||
|
||||
bool Lowering::shouldSkipLowering(Decl *D) {
|
||||
bool Lowering::shouldSkipLowering(const Decl *D) {
|
||||
if (D->getASTContext().LangOpts.UnavailableDeclOptimizationMode !=
|
||||
UnavailableDeclOptimization::Complete)
|
||||
return false;
|
||||
@@ -966,7 +966,7 @@ bool Lowering::shouldSkipLowering(Decl *D) {
|
||||
return D->getSemanticUnavailableAttr() != None;
|
||||
}
|
||||
|
||||
bool Lowering::shouldLowerToUnavailableCodeStub(Decl *D) {
|
||||
bool Lowering::shouldLowerToUnavailableCodeStub(const Decl *D) {
|
||||
if (D->getASTContext().LangOpts.UnavailableDeclOptimizationMode !=
|
||||
UnavailableDeclOptimization::Stub)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user