Skip to content

swift-api-digester: separate migration kind from the other node annotation kind. NFC #15836

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
Apr 10, 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
45 changes: 24 additions & 21 deletions include/swift/IDE/DigesterEnums.def
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#define NODE_ANNOTATION(NAME)
#endif

#ifndef NODE_ANNOTATION_CHANGE_KIND
#define NODE_ANNOTATION_CHANGE_KIND(NAME) NODE_ANNOTATION(NAME)
#endif

#ifndef DECL_ATTR
#define DECL_ATTR(NAME)
#endif
Expand Down Expand Up @@ -49,37 +53,35 @@ NODE_KIND(DeclTypeAlias, TypeAlias)
NODE_ANNOTATION(Added)
NODE_ANNOTATION(Removed)
NODE_ANNOTATION(Updated)
NODE_ANNOTATION(RemovingErrorParam)
NODE_ANNOTATION(ImplicitOptionalToOptional)
NODE_ANNOTATION(OptionalToImplicitOptional)
NODE_ANNOTATION(WrapOptional)
NODE_ANNOTATION(WrapImplicitOptional)
NODE_ANNOTATION(UnwrapOptional)
NODE_ANNOTATION(GenericParamUpCast)
NODE_ANNOTATION(GenericParamDownCast)
NODE_ANNOTATION(TypeAliasChangeFromInt)
NODE_ANNOTATION(GetterToProperty)
NODE_ANNOTATION(SetterToProperty)
NODE_ANNOTATION(PropertyName)
NODE_ANNOTATION(TypeRewritten)
NODE_ANNOTATION(TypeRewrittenLeft)
NODE_ANNOTATION(TypeRewrittenRight)
NODE_ANNOTATION(ModernizeEnum)
NODE_ANNOTATION(UnwrapUnmanaged)
NODE_ANNOTATION(RemovedDecl)
NODE_ANNOTATION(Rename)
NODE_ANNOTATION(RenameOldName)
NODE_ANNOTATION(RenameNewName)
NODE_ANNOTATION(NowThrowing)
NODE_ANNOTATION(NowMutating)
NODE_ANNOTATION(StaticChange)
NODE_ANNOTATION(OwnershipChange)
NODE_ANNOTATION(DictionaryKeyUpdate)
NODE_ANNOTATION(OptionalDictionaryKeyUpdate)
NODE_ANNOTATION(ArrayMemberUpdate)
NODE_ANNOTATION(OptionalArrayMemberUpdate)
NODE_ANNOTATION(SimpleStringRepresentableUpdate)
NODE_ANNOTATION(SimpleOptionalStringRepresentableUpdate)

NODE_ANNOTATION_CHANGE_KIND(ImplicitOptionalToOptional)
NODE_ANNOTATION_CHANGE_KIND(OptionalToImplicitOptional)
NODE_ANNOTATION_CHANGE_KIND(WrapOptional)
NODE_ANNOTATION_CHANGE_KIND(WrapImplicitOptional)
NODE_ANNOTATION_CHANGE_KIND(UnwrapOptional)
NODE_ANNOTATION_CHANGE_KIND(GetterToProperty)
NODE_ANNOTATION_CHANGE_KIND(SetterToProperty)
NODE_ANNOTATION_CHANGE_KIND(TypeRewritten)
NODE_ANNOTATION_CHANGE_KIND(ModernizeEnum)
NODE_ANNOTATION_CHANGE_KIND(UnwrapUnmanaged)
NODE_ANNOTATION_CHANGE_KIND(Rename)
NODE_ANNOTATION_CHANGE_KIND(DictionaryKeyUpdate)
NODE_ANNOTATION_CHANGE_KIND(OptionalDictionaryKeyUpdate)
NODE_ANNOTATION_CHANGE_KIND(ArrayMemberUpdate)
NODE_ANNOTATION_CHANGE_KIND(OptionalArrayMemberUpdate)
NODE_ANNOTATION_CHANGE_KIND(SimpleStringRepresentableUpdate)
NODE_ANNOTATION_CHANGE_KIND(SimpleOptionalStringRepresentableUpdate)


DECL_ATTR(deprecated)
DECL_ATTR(fixedLayout)
Expand Down Expand Up @@ -167,5 +169,6 @@ SPECIAL_CASE_ID(ToUIntMax)
#undef KNOWN_PROTOCOL
#undef KEY
#undef DECL_ATTR
#undef NODE_ANNOTATION_CHANGE_KIND
#undef NODE_ANNOTATION
#undef NODE_KIND
2 changes: 1 addition & 1 deletion lib/IDE/APIDigesterData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ SDKNodeKind swift::ide::api::parseSDKNodeKind(StringRef Content) {

NodeAnnotation swift::ide::api::parseSDKNodeAnnotation(StringRef Content) {
return llvm::StringSwitch<NodeAnnotation>(Content)
#define NODE_ANNOTATION(NAME) .Case(#NAME, NodeAnnotation::NAME)
#define NODE_ANNOTATION_CHANGE_KIND(NAME) .Case(#NAME, NodeAnnotation::NAME)
#include "swift/IDE/DigesterEnums.def"
;
}
Expand Down
19 changes: 2 additions & 17 deletions tools/swift-api-digester/swift-api-digester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3017,23 +3017,8 @@ class DiffItemEmitter : public SDKNodeVisitor {
handleAnnotations(Node, Parent,
isa<SDKNodeType>(Node) ? getIndexString(Node) : "0",
{
NodeAnnotation::WrapOptional,
NodeAnnotation::UnwrapOptional,
NodeAnnotation::ImplicitOptionalToOptional,
NodeAnnotation::OptionalToImplicitOptional,
NodeAnnotation::UnwrapUnmanaged,
NodeAnnotation::TypeRewritten,
NodeAnnotation::SetterToProperty,
NodeAnnotation::GetterToProperty,
NodeAnnotation::ModernizeEnum,
NodeAnnotation::Rename,
NodeAnnotation::NowThrowing,
NodeAnnotation::DictionaryKeyUpdate,
NodeAnnotation::OptionalDictionaryKeyUpdate,
NodeAnnotation::ArrayMemberUpdate,
NodeAnnotation::OptionalArrayMemberUpdate,
NodeAnnotation::SimpleStringRepresentableUpdate,
NodeAnnotation::SimpleOptionalStringRepresentableUpdate,
#define NODE_ANNOTATION_CHANGE_KIND(NAME) NodeAnnotation::NAME,
#include "swift/IDE/DigesterEnums.def"
});
}

Expand Down