Commit Graph

40 Commits

Author SHA1 Message Date
Anthony Latsis
cdae255f9f AST: Quote attributes more consistently in DiagnosticsModuleDiffer.def 2025-04-23 19:18:11 +01:00
Xi Ge
7bab30c718 ABIChecker: diagnose moving a non-final member from a class to an extension to the class
rdar://93498817
2022-06-03 12:54:41 -07:00
Xi Ge
2c1bfcd1ba ABI checker: downgrade missing @available attributes to warnings. rdar://84278884 2021-10-15 11:14:16 -07:00
Xi Ge
499a0cb0a3 ABIChecker: downgrade mangled name change breakage to warnings to unblock builds
rdar://83450549
2021-09-23 11:48:05 -07:00
Xi Ge
d7f5dc4b28 ABIChecker: diagnose mangled name changes
Moving generic constraint from extension to its member or vice versa may change the mangled name
of the member without changing the generic signature, thus introducing ABI breakages. This change
teaches the ABI checker to diagnose USR (mangled name) changes to cover such cases.

rdar://78276290
2021-08-23 17:06:37 -07:00
Owen Voorhees
07fb294c8a [APIDigester] Provide a category when serializing diagnostics representing API or ABI breakage 2021-05-04 19:35:35 -07:00
Xi Ge
55e77785df ABI checker: add a mechansim for specifying allowd ABI breakages
When the checker found a breakage listed in the user-specified list,
the breage should be consumed internally without failing the check.

rdar://68086477
2020-08-31 10:57:15 -07:00
Owen Voorhees
fdb6eabb0a [Diagnostics] Move macros used in diagnostic definitions to their own header
These were duplicated in 11 different files, and as they've gotten more
complex a few inconsistencies have snuck in. Sharing them should make future
changes easier and less bug-prone.
2020-04-14 18:10:30 -07:00
Xi Ge
cec45195a2 APIChecker: adding enum cases are source breaking changes
rdar://60041622
2020-03-05 16:23:49 -08:00
Harlan Haskins
4d731735d2 [api-digester] Teach the api-digester about hasMissingDesignatedInitializers
Because we won’t be serializing this attribute, add custom diagnostics for the cases where:

- We add @_hasMissingDesignatedInits to an open class, which means subclasses won’t be able to inherit its inits
- We remove @_inheritsConvenienceInitializers, which means APIs are removed
2020-01-06 10:15:07 -08:00
Xi Ge
c8ce5b304c ABI/API checker: don't complain about changing var to let or vice versa
The tool diagnoses the removal of getter/setter for properties, so complaining about the keyword change can be redundant.

rdar://problem/57201030
2019-11-14 13:59:26 -08:00
Xi Ge
78bb298389 ABI/API checker: diagnose adding new designated initializers to open classes
If client's subclass provides an implementation of all of its superclass designated
initializers, it automatically inherits all of the superclass convenience initializers.
This means if a new designated init is added to the base class, the inherited
convenience init may be missing and cause breakage.

SR-11454
2019-09-12 15:46:45 -07:00
Xi Ge
6374d3676a ABI/API checker: diagnose ObjC name changes as breakages
rdar://54797695
2019-08-28 11:56:03 -07:00
Xi Ge
5c22fd50e2 ABI checker: include all kinds of accessors for abstract storage decl and diagnose their missing.
Removing accessors other than getter and setter can be ABI breaking. This
patch starts to formally include all accessor decls in the tree and diagnose
their removal. This change only applies to the ABI checker since we still
exclude accessors other than getter and setter when diagnosing source
compatibility.

Including accessors formally can also allow us to check the missing
of availability attributes for newly added accessors.

rdar://52063421
2019-06-26 18:04:28 -07:00
Xi Ge
f55d3ad029 ABI checker: diagnose the missing of @available attributes for added ABIs
New ABIs should have an @available attribute to describe the introducing
version. This patch teaches the tool to diagnose its missing.

Decls with @_AlwaysEmitIntoClient are excluded from the blaming lists since
they are essentially available all the time.

rdar://51089418
2019-05-28 16:38:59 -07:00
Xi Ge
ae16a74af9 api-digester: diagnose adding conformances to existing protocols. rdar://48131686 2019-05-14 15:40:04 -07:00
Xi Ge
f7406e6c3c swift-api-digester: diagnose changing of the necessity of new witness table entry as ABI breakage
Protocol requirements may not necessarily add new entries to the witness table if
it's inherited from super protocol. This patch teaches the json dump to
include a flag indicating whether a protocol requirement requires new
witness table entry and diagnoses the change of such flag as ABI
breakages.

rdar://47657204
2019-04-01 20:29:44 -07:00
Xi Ge
49c16922dd swift-module-digester: diagnose type witness type changes when checking ABI stability. 2018-10-25 16:40:23 -07:00
Xi Ge
bfadd46d57 swift-module-digester: diagnose non-final function changes in non-resilient classes. 2018-10-08 12:15:55 -07:00
Xi Ge
a1e66a0515 swift-module-digester: diagnose value ownership changes for parameters. 2018-10-04 18:02:45 -07:00
Xi Ge
78271f19a0 swift-module-digester: diagnose self access kind changes for function decls. 2018-10-04 15:57:56 -07:00
Xi Ge
c2c04875d0 swift-module-digester: diagnose operator *fix notation changes. 2018-10-02 15:04:23 -07:00
Xi Ge
9364415eab swift-module-digester: use "stored property" instead of "fixed layout order" in diagnostics. 2018-10-02 11:15:20 -07:00
Xi Ge
8e81b59f4e swift-module-digester: diagnose fixed-order property changes to computed property and vice versa as ABI breakage. 2018-10-01 15:54:14 -07:00
Xi Ge
7b45ae9135 swift-module-digester: diagnose adding/removing @escaping as ABI breakage. 2018-09-27 17:43:02 -07:00
Xi Ge
6665b56e9d swift-module-digester: changing open class members to public can be source-breaking. 2018-09-27 14:38:59 -07:00
Xi Ge
0afafd1ca4 swift-module-digester: diagnose let to var changes and vice versa as ABI breaking. 2018-09-27 14:25:46 -07:00
Xi Ge
c5444a8e99 swift-module-digester: diagnose optional protocol requirement changes. 2018-09-27 13:45:23 -07:00
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
f72620c3b7 swift-module-digester: removing setter from a property is API breaking. 2018-09-21 18:25: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
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
0658dca6bb swift-module-digester: use non-resilient type consistently across diagnostics. 2018-09-19 13:17:08 -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
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