Skip to content

swift-api-digester: keep track of all decl attribute kinds in module dump. #18473

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 2, 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
9 changes: 1 addition & 8 deletions include/swift/IDE/DigesterEnums.def
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
#define NODE_ANNOTATION_CHANGE_KIND(NAME) NODE_ANNOTATION(NAME)
#endif

#ifndef DECL_ATTR
#define DECL_ATTR(NAME)
#endif

#ifndef KEY
#define KEY(NAME)
#endif
Expand Down Expand Up @@ -96,9 +92,6 @@ NODE_ANNOTATION_CHANGE_KIND(Rename)
// Keep type rewritten the last one.
NODE_ANNOTATION_CHANGE_KIND(TypeRewritten)

DECL_ATTR(deprecated)
DECL_ATTR(fixedLayout)

KEY(kind)
KEY(name)
KEY(selfIndex)
Expand All @@ -110,6 +103,7 @@ KEY(moduleName)
KEY(throwing)
KEY(mutating)
KEY(static)
KEY(deprecated)
KEY(typeAttributes)
KEY(declAttributes)
KEY(declKind)
Expand Down Expand Up @@ -183,7 +177,6 @@ SPECIAL_CASE_ID(UIApplicationMain)
#undef KNOWN_TYPE
#undef KNOWN_PROTOCOL
#undef KEY
#undef DECL_ATTR
#undef NODE_ANNOTATION_CHANGE_KIND
#undef NODE_ANNOTATION
#undef NODE_KIND
28 changes: 26 additions & 2 deletions test/api-digester/Outputs/cake.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"P2"
],
"declAttributes": [
"fixedLayout"
"FixedLayout"
],
"children": [
{
Expand Down Expand Up @@ -231,6 +231,9 @@
"usr": "s:4cake2C1C3InsACSgXwvp",
"location": "",
"moduleName": "cake",
"declAttributes": [
"ReferenceOwnership"
],
"ownership": 1,
"children": [
{
Expand All @@ -246,6 +249,9 @@
"usr": "s:4cake2C1C3InsACSgXwvg",
"location": "",
"moduleName": "cake",
"declAttributes": [
"Transparent"
],
"children": [
{
"kind": "TypeNominal",
Expand All @@ -271,6 +277,9 @@
"usr": "s:4cake2C1C3InsACSgXwvs",
"location": "",
"moduleName": "cake",
"declAttributes": [
"Transparent"
],
"children": [
{
"kind": "TypeNominal",
Expand Down Expand Up @@ -303,6 +312,9 @@
"usr": "s:4cake2C1C4Ins2ACXovp",
"location": "",
"moduleName": "cake",
"declAttributes": [
"ReferenceOwnership"
],
"ownership": 2,
"children": [
{
Expand All @@ -318,6 +330,9 @@
"usr": "s:4cake2C1C4Ins2ACXovg",
"location": "",
"moduleName": "cake",
"declAttributes": [
"Transparent"
],
"children": [
{
"kind": "TypeNominal",
Expand All @@ -335,6 +350,9 @@
"usr": "s:4cake2C1C4Ins2ACXovs",
"location": "",
"moduleName": "cake",
"declAttributes": [
"Transparent"
],
"children": [
{
"kind": "TypeNominal",
Expand Down Expand Up @@ -561,6 +579,9 @@
"usr": "s:4cake6NumberO8rawValueACSgSi_tcfc",
"location": "",
"moduleName": "cake",
"declAttributes": [
"Inlinable"
],
"children": [
{
"kind": "TypeNominal",
Expand Down Expand Up @@ -607,6 +628,9 @@
"usr": "s:4cake6NumberO8rawValueSivg",
"location": "",
"moduleName": "cake",
"declAttributes": [
"Inlinable"
],
"children": [
{
"kind": "TypeNominal",
Expand Down Expand Up @@ -687,7 +711,7 @@
"CVarArg"
],
"declAttributes": [
"fixedLayout"
"FixedLayout"
],
"children": [
{
Expand Down
16 changes: 16 additions & 0 deletions test/api-digester/Outputs/clang-module-dump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"ObjcProt",
"NSObjectProtocol"
],
"declAttributes": [
"ObjC"
],
"children": [
{
"kind": "Function",
Expand All @@ -25,6 +28,9 @@
"usr": "c:objc(cs)ClangInterface(im)someFunction",
"location": "",
"moduleName": "Foo",
"declAttributes": [
"ObjC"
],
"children": [
{
"kind": "TypeNameAlias",
Expand All @@ -48,6 +54,10 @@
"usr": "c:objc(cs)NSObject(im)init",
"location": "",
"moduleName": "Foo",
"declAttributes": [
"Override",
"ObjC"
],
"children": [
{
"kind": "TypeNominal",
Expand All @@ -67,6 +77,9 @@
"usr": "c:objc(pl)ObjcProt",
"location": "",
"moduleName": "Foo",
"declAttributes": [
"ObjC"
],
"children": [
{
"kind": "Function",
Expand All @@ -76,6 +89,9 @@
"usr": "c:objc(pl)ObjcProt(im)someFunctionFromProt",
"location": "",
"moduleName": "Foo",
"declAttributes": [
"ObjC"
],
"children": [
{
"kind": "TypeNameAlias",
Expand Down
2 changes: 1 addition & 1 deletion test/api-digester/source-stability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// RUN: %api-digester -diagnose-sdk -input-paths %S/stdlib-stable.json -input-paths %t.tmp/current-stdlib.json >> %t.tmp/changes.txt
// RUN: %clang -E -P -x c %S/source-stability.swift.expected -o - | sed '/^\s*$/d' > %t.tmp/source-stability.swift.expected
// RUN: %clang -E -P -x c %t.tmp/changes.txt -o - | sed '/^\s*$/d' > %t.tmp/changes.txt.tmp
// RUN: diff -u %t.tmp/source-stability.swift.expected %t.tmp/changes.txt.tmp ; rm -rf %S/tmp
// RUN: diff -u %t.tmp/source-stability.swift.expected %t.tmp/changes.txt.tmp
Loading