Skip to content
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

Add support for availability-style features #10098

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

ahatanaka
Copy link

This patch doesn't include the codegen and serialization changes that are needed to support the availability-style features.

rdar://137999979

This patch doesn't include the codegen and serialization changes that
are needed to support the availability-style features.

rdar://137999979
@ahatanaka
Copy link
Author

#9815 has the codegen and serialization changes.

else if (Kind == "dyn") {
llvm_unreachable("dyn not supported");
} else
llvm_unreachable("invalid FeatureAvailKind");

Choose a reason for hiding this comment

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

unreachable shouldn't be used for diagnostics when the user could hit them

#ifndef __FEATURE_AVAILABILITY_H
#define __FEATURE_AVAILABILITY_H

#include <stdint.h>>

Choose a reason for hiding this comment

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

extra >

@@ -3999,6 +4008,23 @@ std::optional<AvailabilitySpec> Parser::ParseAvailabilitySpec() {
Actions.CodeCompletion().CodeCompleteAvailabilityPlatformName();
return std::nullopt;
}

if (Tok.is(tok::identifier) && GetLookAheadToken(1).is(tok::equal)) {

Choose a reason for hiding this comment

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

suggest: tok::colon instead of tok:equal, so it matches the feat: <feature> style ones

ObjCShouldCallSuper(false), ObjCIsDesignatedInit(false),
ObjCWarnForNoDesignatedInitChain(false), ObjCIsSecondaryInit(false),
ObjCWarnForNoInitDelegation(false), NeedsCoroutineSuspends(true),
FoundImmediateEscalatingExpression(false), ErrorTrap(Diag) {}

Choose a reason for hiding this comment

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

suggest to not clang-format this after adding the new line, so we reduce the downstream diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants