Commit Graph

76 Commits

Author SHA1 Message Date
Ben Langmuir
34da079aa6 Pass DynamicLookupInfo through VisibleDeclConsumers NFC
This commit adds a new type DynamicLookupInfo that provides information
about how a dynamic member lookup found a particular Decl. This is
needed to correctly handle KeyPath dynamic member lookups, but for now
just plumb it through everywhere.
2019-05-06 10:02:39 -07:00
Ben Langmuir
8fbd71c25e [api-digester] Force lazy attribute calculations as workaround
We were relying on attributes being propagated by the type-checker, for
example from a property to its accessors, but the goal is for these to
be caculated lazily by the request evaluator, so we should be checking
the AST predicates instead.  As a workaround, force calculating them to
cause the attributes to be added for now to fix a CI failure.

Patch by @slavapestov

rdar://50184238
2019-04-25 13:34:11 -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
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
Saleem Abdulrasool
760ef4442a swift-api-digester: use elaborated typename
cl is unable to disambiguate between `swift::KnownProtocolKind` and
`swift::ide::api::KnownProtocolKind`.  Use the elaborated typename to
disambiguate the type.  This allows us to build `swift-api-digester`
with cl again.
2019-02-24 15:38:45 -08:00
Harlan Haskins
081b05a4b4 [api-digester] Don’t synthesize type nodes with no public members
Upon seeing an extension for a type outside the current module, the digester
creates a dummy type node and puts all the extensions’ members and conformances
in that type. This allows us to track new API endpoints that are retroactively
added.

Unfortunately, if there are no public members/conformances (only internal or
private ones), the type itself ends up in the SDK dump without any public
children. This causes an issue when you dump the SDK from a parseable
interface, where the internal extension was not printed.
2019-01-30 11:45:19 -08:00
Parker Schuh
f5859ff46e Rename NameAliasType to TypeAliasType. 2019-01-09 16:47:13 -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
Xi Ge
6fac47e7e6 swift-module-digester: non-final methods in fixed-layout classes no longer have fixed orders. rdar://46617463 2018-12-12 11:26:07 -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
fcc4bf5be2 swift-module-digester: don't blindly include initializer decls. rdar://45418572 2018-10-25 15:14:17 -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
7c6a6bd724 swift-api-digester: Minor typos 2018-10-15 19:24:27 -07:00
Slava Pestov
91fc404d4f swift-api-digester: Don't desugar type aliases all the way 2018-10-15 19:24:27 -07:00
Slava Pestov
5e7a289877 swift-api-digester: Subscripts don't have storage 2018-10-15 19:24:27 -07:00
Slava Pestov
ba066b8257 swift-api-digester: Don't drop value ownership when parameter has typealias type 2018-10-15 19:24:27 -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
847aa9b327 swift-module-digester: avoid including private protocol conformances when checking API stability. 2018-10-08 13:30: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
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
5bab518d5f swift-module-digester: include parameters' value ownership values in the digests. 2018-10-04 15:57:56 -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
d36fc85535 swift-module-digester: include underscored and unavailable decls when checking stdlib abi stability. 2018-10-03 14:54:08 -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
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
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
6a198b151a swift-module-digester: keep track of whether a decl is internal. 2018-09-30 18:53:35 -07:00
Xi Ge
226811007b swift-module-digester: refactor diagnostics logic. NFC 2018-09-29 20:18:29 -07:00
Xi Ge
d15f611acd Merge pull request #19620 from nkcsgexi/include-operator
swift-module-digester: include operator overloads in the module dump.
2018-09-28 20:35:57 -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
b9c1cdefed swift-module-digester: keep track of whether a property or subscript has storage. 2018-09-28 11:36:36 -07:00
Xi Ge
459538f49a swift-module-digester: slight performance enhancement to re-use node comparison results. NFC 2018-09-28 11:05:57 -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
3dfe615d27 swift-module-digester: keep track of whether a class member is open. 2018-09-27 13:18:11 -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
de05cbc350 swift-module-digester: more refactoring to exclude empty values in the dump. 2018-09-27 11:34:56 -07:00
Xi Ge
52e05e1495 swift-module-digester: always canonicalize super class types. 2018-09-27 11:16:15 -07:00
Slava Pestov
8c94b3818f Merge pull request #19560 from slavapestov/remove-functype-getinput
Remove FunctionType::getInput()
2018-09-26 19:39:03 -07:00
Xi Ge
637017de90 Merge branch 'apple-master' into simplify-module-digester 2018-09-26 15:21:51 -07:00
Xi Ge
aaffbd1ca5 swift-module-digester: some refactoring on node serialization. NFC 2018-09-26 15:17:25 -07:00