-
Notifications
You must be signed in to change notification settings - Fork 333
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
base: next
Are you sure you want to change the base?
Conversation
This patch doesn't include the codegen and serialization changes that are needed to support the availability-style features. rdar://137999979
#9815 has the codegen and serialization changes. |
else if (Kind == "dyn") { | ||
llvm_unreachable("dyn not supported"); | ||
} else | ||
llvm_unreachable("invalid FeatureAvailKind"); |
There was a problem hiding this comment.
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>> |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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) {} |
There was a problem hiding this comment.
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.
This patch doesn't include the codegen and serialization changes that are needed to support the availability-style features.
rdar://137999979