Commit Graph

158 Commits

Author SHA1 Message Date
Xi Ge
05bec0c3e3 swift-api-digester: describing external type declarations as extensions in error messages
External type declarations are synthesized to incorporate members in extensions to types
of external modules. In diagnostics, we should use 'extension' instead of 'struct/class'
for these decls to avoid confusion.
2019-05-28 14:08:36 -07:00
Xi Ge
7b445c3c98 api-digester: keep track of the introduced platforms and language versions for all APIs
These fields will be used to diagnose the missing of available
attributes for newly added APIs.

rdar://51089418
2019-05-23 17:23:30 -07:00
Xi Ge
8225b522d0 swift-api-digester: de-duplicate protocol conformance entries in the Json output
For some unclear reasons, calling getAllConformances on Int.Words and
UInt.Words returns duplicate entries for conforming to RandomAccessCollection.
Since this isn't the case for swift-5.1-branch, we saw false positives shown
in rdar://49568079.

This patch fixes the ABI/API checker by de-duplicate results collected from
getAllConformances.
2019-04-09 11:51:49 -07:00
Xi Ge
c5b4aaec47 ABI/API checker: re-baseline after recent tooling changes 2019-04-02 11:06:29 -07:00
Xi Ge
747d9dfe3b swift-api-digester: add a field to indicate whether a decl or a conformance is ABI placeholder.
ABI placeholders are decls with attribute '@available(macOS 9999, iOS
9999, tvOS 9999, watchOS 9999, *)'. The diagnostics phase could be
forgiving for ABI breakages on these decls since they are added
recently. This patch adds a new flag to the json file indicating whether
a declaration or a conformance is an ABI placeholder. The checking of
placeholder is transitive, meaning a decl is an ABI placeholder if its
decl context is one.

rdar://49502365
2019-04-02 10:45:27 -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
8817404218 test/migrator: add test for detecting initializer's return type change.
Related to rdar://37032607
2019-01-09 15:14:24 -08:00
Robert Widmann
426fe886dc [SR-8272] Drop the last remnants of LogicValue
Removes the _getBuiltinLogicValue intrinsic in favor of an open-coded
struct_extract in SIL.  This removes Sema's last non-literal use of builtin
integer types and unblocks a bunch of cleanup.

This patch would be NFC, but it improves line information for conditional expression codegen.
2018-12-19 23:14:59 -05:00
Xi Ge
9ece618087 [test] regenerate API/ABI baseline for stdlib after recent compiler and tooling enhancements. 2018-12-12 11:27:00 -08:00
Xi Ge
588391eb7e swift-api-digester: avoid synthesizing nominal types from the same module.
Synthesizing types from the same module may bring back types that are
not part the ABI/API, leading to false positives.

Resolves: SR-9372
2018-12-12 11:26:07 -08:00
Mike Ash
a49e2ddde7 [Stdlib] Rename AnyKeyPath's ObjC name and _VaListBuilder to avoid conflicts with older stdlibs.
rdar://problem/46546165
2018-12-10 10:17:52 -05: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
John McCall
3e5165d1ab Change the compiler ABI of keypaths.
Previously, the stdlib provided:

- getters for AnyKeyPath and PartialKeyPath, which have remained;

- a getter for KeyPath, which still exists alongside a new read
  coroutine; and

- a pair of owned mutable addressors that provided modify-like behavior
  for WritableKeyPath and ReferenceWritableKeyPath, which have been
  replaced with modify coroutines and augmented with dedicated setters.

SILGen then uses the most efficient accessor available for the access
it's been asked to do: for example, if it's been asked to produce a
borrowed r-value, it uses the read accessor.

Providing a broad spectrum of accessor functions here seems acceptable
because the code-size hit is fixed-size: we don't need to generate
extra code per storage declaration to support more alternatives for
key paths.

Note that this is just the compiler ABI; the implementation is still
basically what it was.  That means the implementation of the setters
and the read accessor is pretty far from optimal.  But we can improve
the implementation later; we can't improve the ABI.

The coroutine accessors have to be implemented in C++ and used via
hand-rolled declarations in SILGen because it's not currently possible
to declare independent coroutine accessors in Swift.
2018-11-10 02:08:04 -05:00
Michael Ilseman
d112e5f20f [test] Dump in new API and ABI reference point
Put in the new API/ABI from UTF-8 String.
2018-11-04 10:42:44 -08:00
John McCall
abdba1d3f4 Change the integer-literal type from Int2048 to IntLiteral.
Part of SR-290.
2018-10-31 23:14:58 -04: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
334c46aabd swift-module-digester: update API/ABI baselines after recent format changes. 2018-10-25 15:14:53 -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
Saleem Abdulrasool
920aa2f9b7 Merge pull request #19877 from compnerd/sse-no-more
SSE no more
2018-10-16 13:11:02 -07:00
Erik Eckstein
15b01ab792 SIL: Remove array.owner semantic function
Also remove the getOwner functions from ArraySlide.
These functions are not needed anymore with accessors.

rdar://problem/44184810
2018-10-15 09:44:52 -07:00
Saleem Abdulrasool
2935c09a07 stdlib: rename x86_64 variables to be generic
Rename some of the variables in the VaListBuilder path to be agnostic to
the architecture.  SSE is x86 specific, by renaming the variables to
hide the fact that the path is x86 specific, we will be able to share
some of the code with arm64 (where the analogous hardware is the VFP).
2018-10-14 13:39:17 -07:00
Xi Ge
87ed4b4488 [test] Remove Swift 3 flags from various tests. 2018-10-09 16:09:41 -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
7177f4191b test: regenerate ABI/API stability baselines after recent fixes. 2018-10-08 14:05:17 -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
c5550ce2f8 test: regenerate abi stability baseline after recent fixes. 2018-10-05 14:48:56 -07:00
Xi Ge
8a769a0460 swift-module-digester: include non-resilient class decls when checking ABI stability. 2018-10-05 14:48:00 -07:00
Xi Ge
9cfc0dee79 swift-module-digester: keep track of whether a property/subscript has didSet and willSet. 2018-10-05 13:02:31 -07:00
Xi Ge
a1e66a0515 swift-module-digester: diagnose value ownership changes for parameters. 2018-10-04 18:02:45 -07:00
Xi Ge
2d59078a0d [test] Regenerate ABI/API checker baseline by using stdlib without assertion enabled.
If we use a baseline generated from assertion build, the checker will report false-positives
when running in a non-assertion build since some decls only exist in the former.

resolves: rdar://45014723
2018-10-04 15:57:56 -07:00
Xi Ge
b7c9e5798a [test] regenerated ABI checker baseline to include decls with @usableFromInline. 2018-10-03 14:56:24 -07:00
Xi Ge
58b3c2173f swift-module-digester: use getEffectiveAccess() to get accessibility when checking ABI stability.
This allows us to include internal decls with @usableFromInline attribute, whose stored property
changes can effect ABI.
2018-10-03 14:06:53 -07:00
Xi Ge
c2c04875d0 swift-module-digester: diagnose operator *fix notation changes. 2018-10-02 15:04:23 -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
4b8507c858 [test] Regenerate abi and source stability baseline and start running tests for them. 2018-10-01 15:14:58 -07:00
Xi Ge
b3614a4b6f swift-module-digester: include unavailable variables with fixed layout order when checking ABI stability. 2018-10-01 15:02:41 -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
a6f886c8b7 swift-module-digester: include operator overloads in the module dump. 2018-09-28 17:41:52 -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
aa1ae1607a swift-module-digester: keep track of whether a VarDecl is let. 2018-09-27 12:52:58 -07:00
Xi Ge
52e05e1495 swift-module-digester: always canonicalize super class types. 2018-09-27 11:16:15 -07:00
Xi Ge
cf03b247d6 swift-module-digester: use super class types instead of super class decls to incorporate generic argument changes. 2018-09-25 11:48:47 -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
c0556cc4dd swift-module-digester: keep track of whether a decl overrides in the dump. 2018-09-25 11:04: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