Skip to content

[Space Engine] Remove the @_downgrade_exhaustivity_check hack #17764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions include/swift/AST/Attr.def
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,7 @@ DECL_ATTR(_restatedObjCConformance, RestatedObjCConformance,
OnProtocol |
LongAttribute | RejectByParser |
NotSerialized, 70)
// HACK: Attribute needed to preserve source compatibility by downgrading errors
// due to an SDK change in Dispatch
SIMPLE_DECL_ATTR(_downgrade_exhaustivity_check, DowngradeExhaustivityCheck,
OnEnumElement |
LongAttribute | UserInaccessible,
71)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you leave behind a "71 is unused comment" here, like we did for other enums?

Technically this should probably mean bumping the module version too

// NOTE: 71 is unused
SIMPLE_DECL_ATTR(_implicitly_unwrapped_optional, ImplicitlyUnwrappedOptional,
OnFunc | OnAccessor | OnVar | OnParam | OnSubscript | OnConstructor |
RejectByParser,
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Serialization/ModuleFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const uint16_t VERSION_MAJOR = 0;
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
/// Don't worry about adhering to the 80-column limit for this line.
const uint16_t VERSION_MINOR = 438; // Last change: add isbitwisetakable
const uint16_t VERSION_MINOR = 439; // Last change: remove @_downgrade_exhaustivity_check attribute

using DeclIDField = BCFixed<31>;

Expand Down
2 changes: 0 additions & 2 deletions lib/AST/ASTDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,6 @@ namespace {

void visitEnumElementDecl(EnumElementDecl *EED) {
printCommon(EED, "enum_element_decl");
if (EED->getAttrs().hasAttribute<DowngradeExhaustivityCheckAttr>())
OS << "@_downgrade_exhaustivity_check";
PrintWithColorRAII(OS, ParenthesisColor) << ')';
}

Expand Down
3 changes: 1 addition & 2 deletions lib/SILGen/SILGenPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1806,8 +1806,7 @@ CaseBlocks::CaseBlocks(
enumDecl->isEffectivelyExhaustive(SGF.getModule().getSwiftModule(),
SGF.F.getResilienceExpansion());
if (canAssumeExhaustive) {
// Check that Sema didn't let any cases slip through. (This can happen
// with @_downgrade_exhaustivity_check.)
// Check that Sema didn't let any cases slip through.
canAssumeExhaustive = llvm::all_of(enumDecl->getAllElements(),
[&](const EnumElementDecl *elt) {
return caseToIndex.count(elt);
Expand Down
2 changes: 0 additions & 2 deletions lib/Sema/TypeCheckAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class AttributeEarlyChecker : public AttributeVisitor<AttributeEarlyChecker> {
IGNORED_ATTR(ClangImporterSynthesizedType)
IGNORED_ATTR(Convenience)
IGNORED_ATTR(DiscardableResult)
IGNORED_ATTR(DowngradeExhaustivityCheck)
IGNORED_ATTR(DynamicMemberLookup)
IGNORED_ATTR(Effects)
IGNORED_ATTR(Exported)
Expand Down Expand Up @@ -777,7 +776,6 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
IGNORED_ATTR(ClangImporterSynthesizedType)
IGNORED_ATTR(Consuming)
IGNORED_ATTR(Convenience)
IGNORED_ATTR(DowngradeExhaustivityCheck)
IGNORED_ATTR(Dynamic)
IGNORED_ATTR(Effects)
IGNORED_ATTR(Exported)
Expand Down
1 change: 0 additions & 1 deletion lib/Sema/TypeCheckDeclOverride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,6 @@ namespace {
UNINTERESTING_ATTR(RestatedObjCConformance)
UNINTERESTING_ATTR(Implements)
UNINTERESTING_ATTR(StaticInitializeObjCMetadata)
UNINTERESTING_ATTR(DowngradeExhaustivityCheck)
UNINTERESTING_ATTR(ImplicitlyUnwrappedOptional)
UNINTERESTING_ATTR(ClangImporterSynthesizedType)
UNINTERESTING_ATTR(WeakLinked)
Expand Down
Loading