Speculatively revert "IRGen: Make case numbering consistent for enums with empty payloads"

I suspect its breaking the build. I must've screwed up my testing.

This reverts commit 86e6b81336.
This commit is contained in:
Slava Pestov
2015-12-21 14:50:16 -08:00
parent 4c6d972691
commit 6c2d8839ec
5 changed files with 34 additions and 104 deletions

View File

@@ -2588,14 +2588,7 @@ StringRef IRGenModule::mangleType(CanType type, SmallVectorImpl<char> &buffer) {
return StringRef(buffer.data(), buffer.size());
}
/// Do we have to use resilient access patterns when working with this
/// declaration?
///
/// IRGen is primarily concerned with resilient handling of the following:
/// - For structs, a struct's size might change
/// - For enums, new cases can be added
/// - For classes, the superclass might change the size or number
/// of stored properties
/// Is the given declaration resilient?
bool IRGenModule::isResilient(Decl *D, ResilienceScope scope) {
auto NTD = dyn_cast<NominalTypeDecl>(D);
if (!NTD)
@@ -2611,23 +2604,6 @@ bool IRGenModule::isResilient(Decl *D, ResilienceScope scope) {
llvm_unreachable("Bad resilience scope");
}
// The most general resilience scope where the given declaration is visible.
ResilienceScope IRGenModule::getResilienceScopeForAccess(NominalTypeDecl *decl) {
if (decl->getModuleContext() == SILMod->getSwiftModule() &&
decl->getFormalAccess() != Accessibility::Public)
return ResilienceScope::Component;
return ResilienceScope::Universal;
}
// The most general resilience scope which has knowledge of the declaration's
// layout. Calling isResilient() with this scope will always return false.
ResilienceScope IRGenModule::getResilienceScopeForLayout(NominalTypeDecl *decl) {
if (isResilient(decl, ResilienceScope::Universal))
return ResilienceScope::Component;
return getResilienceScopeForAccess(decl);
}
/// Fetch the witness table access function for a protocol conformance.
llvm::Function *
IRGenModule::getAddrOfWitnessTableAccessFunction(