Xi Ge
d0cd97e3e5
swift-module-digester: diagnose any decl kind changes for nominal types.
2018-09-24 14:47:19 -07:00
Xi Ge
6e3529050d
swift-module-digester: changing super classes is API breaking.
2018-09-24 13:33:26 -07:00
Xi Ge
9db65f8527
swift-module-digester: removing super classes is API breaking.
2018-09-24 12:51:20 -07:00
Xi Ge
4e3f8f4784
swift-module-digester: added protocol requirements can be source-breaking.
2018-09-23 08:48:08 -07:00
Xi Ge
5fbecfaee6
swift-module-digester: removing setter from a subscript decl is API breaking.
2018-09-21 18:40:02 -07:00
Xi Ge
f72620c3b7
swift-module-digester: removing setter from a property is API breaking.
2018-09-21 18:25:12 -07:00
Xi Ge
01afc3395e
swift-module-digester: include SubscriptDecl in the Json dump.
...
We model SubscriptDecl as an abstract function decl with a flag indicating
whether setter is defined.
2018-09-21 17:00:52 -07:00
Xi Ge
565fd91a76
swift-module-digester: changing default associated type is API breaking.
2018-09-21 14:38:12 -07:00
Xi Ge
e8c604ff99
swift-module-digester: diagnose removing default associated type as API breakage.
2018-09-21 14:14:39 -07:00
Xi Ge
6500e321aa
swift-module-digester: include AssociatedTypeDecl in module digests.
2018-09-21 14:04:21 -07:00
Xi Ge
08c8cf14e5
swift-module-digester: diagnose adding/removing protocol conformances as API breakages.
2018-09-20 15:24:19 -07:00
Xi Ge
f1b43ab66e
swift-module-digester: diagnose removing default argument as API breakage.
2018-09-19 17:40:00 -07:00
Xi Ge
b2a159dbf9
swift-module-digester: diagnose adding variables with fixed binary order.
...
Removing these variables should be detected as API breakages already.
2018-09-19 13:17:08 -07:00
Xi Ge
05e15927a3
swift-module-digester: diagnose reordering of members in a fixed layout type under ABI mode.
2018-09-19 09:36:09 -07:00
Xi Ge
47228bc17b
swift-module-digester: remove unnecessary node annotations. NFC ( #18975 )
2018-08-24 21:44:40 -07:00
Xi Ge
6adac7a1e3
DiagnosticEngine: require clients to explicitly specify source locations when emitting diagnostics. NFC ( #18962 )
2018-08-24 16:14:16 -07:00
Xi Ge
e4388af6be
swift-module-digester: refactor the ABI/API diagnostics to use DiagnosticEngine. NFC ( #18957 )
...
Before this patch, we used to define tooling-specific diagnostics. With adding more
checking logics, we found this mechanism hard to extend. This patch
eliminates the home-made diagnostics model to use the one from compiler, which provides
several benefits: less boiler-templates, better integration with DiagnosticConsumer,
and easy ordering of detected issues.
2018-08-24 13:11:32 -07:00
Xi Ge
1b601f83fe
swift-module-differ: refactor node definition to a separate file. NFC
...
The original implementation file contains both nodes definition and detection
logics. This patch splits the two parts.
2018-08-20 13:16:57 -07:00
Xi Ge
492a73c8e2
Merge branch 'apple-master' into api-digester-match-kind
2018-08-17 17:48:09 -07:00
Xi Ge
9138b0228b
swift-api-digester: detect type to type alias change up-front to remove bogus dignostics. rdar://43425867
2018-08-17 17:46:26 -07:00
Xi Ge
697ba85dda
swift-api-digester: add a new enum class describing why two SDKNodes are matched, NFC.
2018-08-17 17:32:55 -07:00
Xi Ge
37a7dce793
remove dead code.NFC
2018-08-17 17:00:21 -07:00
Xi Ge
c069090afe
Merge pull request #18788 from brentdax/indigestion
...
Add some proper diagnostics to the API digester
2018-08-17 15:55:51 -07:00
Jordan Rose
537954fb93
[AST] Rename several DeclContext methods to be clearer and shorter ( #18798 )
...
- getAsDeclOrDeclExtensionContext -> getAsDecl
This is basically the same as a dyn_cast, so it should use a 'getAs'
name like TypeBase does.
- getAsNominalTypeOrNominalTypeExtensionContext -> getSelfNominalTypeDecl
- getAsClassOrClassExtensionContext -> getSelfClassDecl
- getAsEnumOrEnumExtensionContext -> getSelfEnumDecl
- getAsStructOrStructExtensionContext -> getSelfStructDecl
- getAsProtocolOrProtocolExtensionContext -> getSelfProtocolDecl
- getAsTypeOrTypeExtensionContext -> getSelfTypeDecl (private)
These do /not/ return some form of 'this'; instead, they get the
extended types when 'this' is an extension. They started off life with
'is' names, which makes sense, but changed to this at some point. The
names I went with match up with getSelfInterfaceType and
getSelfTypeInContext, even though strictly speaking they're closer to
what getDeclaredInterfaceType does. But it didn't seem right to claim
that an extension "declares" the ClassDecl here.
- getAsProtocolExtensionContext -> getExtendedProtocolDecl
Like the above, this didn't return the ExtensionDecl; it returned its
extended type.
This entire commit is a mechanical change: find-and-replace, followed
by manual reformatted but no code changes.
2018-08-17 14:05:24 -07:00
Brent Royal-Gordon
004ada98bc
Add errors for other invalid strings in digester
...
Specifically, TypeAttrKinds, DeclAttrKinds, and DeclKinds.
2018-08-17 04:16:20 -07:00
Brent Royal-Gordon
8a192eaaf7
Refactor away some digester diagnostic boilerplate
2018-08-17 00:29:21 -07:00
Brent Royal-Gordon
88ac6f11a2
Add error for invalid SDKNodeKind
2018-08-17 00:27:38 -07:00
Brent Royal-Gordon
ec87277e56
Add error for unknown API KeyKind
2018-08-16 23:52:06 -07:00
Brent Royal-Gordon
fbe05ea817
Use swift::SourceManager/DiagnosticEngine
2018-08-16 23:46:35 -07:00
Brent Royal-Gordon
55d54923d4
[NFC] Move SourceMgr into SDKContext
2018-08-16 19:24:31 -07:00
Xi Ge
bc79f3011a
swift-api-digester: diagnose removal/addition of dynamic attribute under abi mode.
2018-08-16 16:50:10 -07:00
Xi Ge
2152d0bde0
swift-api-digester: remove some dead code. NFC
2018-08-16 16:22:53 -07:00
Xi Ge
11cdd41bf0
swift-api-digester: simplify some code. NFC.
2018-08-16 13:16:57 -07:00
Xi Ge
07e002ce5e
swift-api-digester: diagnose generic signature change for any declarations.
2018-08-16 11:32:43 -07:00
Xi Ge
17b9a4edf9
swift-api-digester: diagnose the addition and removal of @objc, @_fixed_layout and @_frozen under ABI mode.
2018-08-15 17:49:01 -07:00
Xi Ge
2ac57cf948
swift-api-digester: add a flag to diagnostics indicating whether it's abi-specific.
2018-08-15 12:02:22 -07:00
Xi Ge
45f9e4437d
swift-api-digester: add a new flag to indicate whether the tool is checking ABI stability. ( #18707 )
...
When this flag turns on, all type nodes and generic signatures are canonicalized.
2018-08-14 14:10:59 -07:00
Xi Ge
5ea6eae2a3
swift-api-digester: include generic signature printing in the module dump. ( #18686 )
2018-08-14 08:01:23 -07:00
Xi Ge
3121af26e1
swift-api-digester: keep track of all decl attribute kinds in module dump. ( #18473 )
...
The tool should use decl attribute kinds from AST rather than defining
its own list of attributes. Thus we can keep track of all attributes kinds
rather than the selected ones.
2018-08-02 13:39:32 -07:00
Slava Pestov
5213f80e7e
IDE: Remove uses of AbstractFunctionDecl::getParameterLists()
2018-07-22 20:56:56 -07:00
Xi Ge
b78c9eb328
swift-api-digester: ensure the sdk-dump includes extensions from types of other modules. rdar://42266041
2018-07-20 17:26:22 -07:00
Xi Ge
c9746452ac
swift-api-digester: avoid diagnosing reference ownership changes from unowned to weak. rdar://41260522
2018-07-09 11:21:45 -07:00
John McCall
34b0cbc11d
Merge pull request #16237 from davezarzycki/metaprogram_ref_storage_types
...
[AST] NFC: Enable reference storage type meta-programming
2018-07-05 14:45:38 -04:00
David Zarzycki
b91bde4d14
[swift-api-digester] NFC: Adopt reference storage type meta-programming macros
2018-06-30 06:44:34 -04:00
Xi Ge
967beefffc
swift-api-digester: teach the tool to detect member variables change to global ones. rdar://41658300
2018-06-29 16:33:22 -07:00
Xi Ge
42127d9f68
swift-api-digester: emit the diff items for changing from RawRepresentable struct to a type alias of raw type.
...
related: rdar://39498127
2018-06-15 11:55:09 -07:00
Xi Ge
7312fea3b2
migrator: emit error messages when migration scripts are missing.
...
We used to assert migration scripts exist. This patch further
decouples these scripts and the compiler by treating missing scripts
as a regular compiler error.
Related: rdar://40538097
2018-05-25 11:25:32 -07:00
Xi Ge
b0084558a2
swift-api-digester: specify raw types when detecting the reversion of NS_TYPED_EXTENSIBLE_ENUM.
2018-05-24 13:01:21 -07:00
Xi Ge
82ca0a1891
swift-api-digester: detect type alias of raw types change to RawRepresentableStructs.
...
Related to: rdar://40076487
2018-05-23 12:23:47 -07:00
Xi Ge
5212311cc0
swift-api-digester: sort migration scripts before serializing them.
2018-05-22 13:39:46 -07:00