Commit Graph

222 Commits

Author SHA1 Message Date
Xi Ge
2160f65283 [SR-10972] swift-api-digester: avoid diagnosing the removal of __derived_enum_equals and __derived_struct_equals
These functions are compiler implementation details and diagnosing
them is redundant and may be confusing to framework authors.
2019-06-20 16:14:43 -07:00
Xi Ge
ec3678c486 swift-api-digester: teach the tool to compare two SDKs directly
With module stability from the compiler, we can now use an earlier version
of the SDK as the baseline and compare the new SDK with it. This patch
adds a new -bsdk flag to the tool to specify the baseline SDK path.
2019-06-16 13:00:25 -07:00
Xi Ge
d405fcd8ec swift-api-digester: teach the tool to directly compare two module interfaces
We used to use a Json format to capture the ABI/API detail of Swift modules to
walk-around module compatibility issues across different compiler versions. Since
Swift module now is in stable format, we can compare two swiftinterface files
directly without dumping the content into Json format.
2019-06-12 11:16:23 -07:00
Xi Ge
c9660106a7 swift-api-digester: remove some unused code. NFC 2019-06-12 11:02:47 -07:00
Xi Ge
31b46ee709 swift-api-digester: add a flag to disable OS related diagnostics
For frameworks not shipping with OSs, the users should specify this flag
to avoid diagnosing some changes, such as the missing of OS availability
attributes.
2019-05-28 17:03:03 -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
bfed404c7c api-digester: rename argument -compare-sdk to -generate-migration-script. SR-10489 2019-05-17 12:54:13 -07:00
Xi Ge
99caadf794 api-digester: avoid looking up node update table to collect renamed declarations
We could simply get the new name from the node annotation of the decl before renaming.
2019-05-15 17:20:48 -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
23cd5f037d api-digester: use target triple to check platform info 2019-05-14 14:12:14 -07:00
Xi Ge
b0005a5bdc api-digester: disable objc interop when building on linux. SR-10539 2019-05-14 11:13:58 -07:00
Harlan Haskins
0785fd797b [swift-api-digester] Put command-line flags in their own category (#24178)
Previously, swift-api-digester -help would print a bunch of unrelated
LLVM and SIL command-line flags. Putting these in their own category
limits the help output to the specific set of flags swift-api-digester
recognizes.
2019-04-22 09:58:01 -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
350ed65def swift-api-digester: simplify the API to emit diagnostics. NFC
All diagnostics in the abi/api checker shares empty source location
and a screening info string as the first argument. This patch
adds a new forwarding function to avoid duplicating these common
logics.
2019-03-27 14:28:41 -07:00
Xi Ge
33c0b4f4b2 swift-module-digester: test -v mode when diagnosing ABI/API changes. 2018-12-07 14:23:19 -08:00
swift-ci
7f121bf2f7 Merge pull request #20843 from akyrtzi/api-checker-protocol-whitelist 2018-11-28 15:57:10 -08:00
Argyrios Kyrtzidis
2358c8944f [api-digester] For readFileLineByLine() ignore lines that are comments
Allows us to add informational comments in the text files that are used as inputs for the digester.
2018-11-28 15:34:36 -08:00
Argyrios Kyrtzidis
5e7327714f [api-digester] Add '-protocol-requirement-white-list' option to the digester for when diagnosing API breakage in SDKs
This option access a file that lists protocol names that are 'whitelisted' for getting new protocol requirements.
This allows the SDK checker to avoid flagging protocol method additions for protocols that we know are not intended
for user classes to conform to.
2018-11-28 15:01:39 -08:00
Argyrios Kyrtzidis
0413358f25 [api-digester] Don't report as API breaking when an ObjC protocol gets a new optional method 2018-11-28 11:59:20 -08:00
Xi Ge
8c0495f467 swift-module-digester: drop isSDKPrivate() from node since filtering should happen at AST level. 2018-10-25 17:41:28 -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
da4fc05a0e swift-module-digester: model ProcotolConformance as a standalone node.
Modeling ProtocolConformance as a standalone node allows us to keep
track of all type witnesses and re-use existing matching algorithm
to diagnose type witness changes.
2018-10-25 15:14:17 -07:00
Slava Pestov
8954e5f3c8 Merge pull request #19891 from slavapestov/unqualified-lookup-fixes-part-2
Unqualified lookup fixes, part 2
2018-10-15 23:02:19 -07:00
swift-ci
7cd273e777 Merge pull request #19904 from nkcsgexi/redirect-diags 2018-10-15 20:06:13 -07:00
Slava Pestov
7c6a6bd724 swift-api-digester: Minor typos 2018-10-15 19:24:27 -07:00
Xi Ge
70118d4db0 swift-module-digester: output ABI/API diagnostics to a path instead of stdout.
This is handy for scripts.
2018-10-15 19:12:34 -07:00
Xi Ge
715d481333 swift-module-digester: remove unused clang importer flag specialization. 2018-10-14 23:10:28 -07:00
Xi Ge
3f58f1e6d3 swift-module-digester: add a flag to include Swift decls specifically.
This flag allows us to diagnose the overlay part exclusively without digesting
the entire SDK framework.
2018-10-09 12:57:22 -07:00
Xi Ge
c8c7fb39b0 swift-module-digester: exclude fixed binary order when checking API stability. 2018-10-08 13:59:30 -07:00
Xi Ge
382e27f4ab swift-module-digester: diagnose adding/removing final as ABI/API breakages. 2018-10-08 13:19:54 -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
784cb9e1a9 Revert "swift-module-digester: diagnose added associated types as ABI breakages even they have default type." 2018-10-02 11:12:37 -07:00
Xi Ge
a969486932 swift-module-digester: diagnose added associated types as ABI breakages even they have default type. 2018-10-01 16:00:36 -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
9fcc59bcaf swift-module-digester: include operator declarations in the module dump.
Their changes should have no impact on ABI, but can be source-breaking.
2018-10-01 12:28:54 -07:00
Xi Ge
226811007b swift-module-digester: refactor diagnostics logic. NFC 2018-09-29 20:18:29 -07:00
Xi Ge
e31b04495e swift-module-digester: print node matching details in verbose mode for debugging purposes, NFC. 2018-09-28 13:50:09 -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
e1f4eecadb swift-module-digester: don't diagnose new protocol requirements if they're inherited. 2018-09-25 11:12:55 -07:00
Xi Ge
2182f5301e swift-module-digester: fix a false positive when diagnosing super class changes. 2018-09-24 17:31:13 -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