When trying to figure out errors from an import failure, the nullability
completeness warnings would clutter the output making it difficult to
identify the errors. Sprinkle the declaarations with
`_Null_unspecified` to maintain the current nullability semantics and
silence the warnings. NFC.
We've also seen type changes in the frameworks from "[String: Any]?" to
"[StringRepresentable: Any]?". This patch adds specific logic and
attribute for this kind of change on the top of nonnull dictionary
changes.
Framework authors can use SwiftWraper:none to bring back string enums
to type alias of String. When diagnosing source breaking changes, these
type alias are shown as removed. Therefore, it's hard to tell whether these
changes are automatically migratable. This patch refines the
removed-type-alias by further analyzing whether a
RawRepresentable with the same usr appeared in the later version of
SDK. If there is, another kind of message is emitted for differentiation.
This allows us to map back from a type to the declaration in the dump,
so that we can perform more fine-grained analysis like whether a string
has been changed to string enum.
The tool should diagnose the change of extension's applicability since
such change can be source-breaking. We need first to support the
requirements in the module dump. Currently, we decorate each
member defined in extension with a field called extension info. The
field will keep track of the generic requirements that need to be satisfied
for this decorated member to be applicable. This patch doesn't implement the checking
of requirements change.
When diagnosing API source-breaking changes, we
should also output the header file name from where the affected Clang
declaration is defined.
This may expedite screening process.
When we compare the APIs of entire SDKs, we can assume super classes
are always present in the API dump. However, this assumption is invalid
for framework-level API diff checking, where super classes can come from
other modules whose contents are not serialized.
rdar://33110442
This patch restricts the detection of moved members to be static members,
since only in this case we need to update qualified access to
them. The move of instance members will be either handled by rename or
we don't need to update anything at all.
Additionally, this patch introduces a sub-kind of type member diff item
called qualified replacement to describe the aforementioned case. However,
the migrator part has not started to honor this sub-kind yet.
rdar://32466196
Different from type hoist that moves global variables to static member
variables, we've also seen member variables being moved among different
types via apinotes. Swift-api-digester should be able to detect such
case so that migrator can handle them properly.
rdar://32466196
* swift-api-digester: ensure constructors are detected as removed if not moved. rdar://31694119
* swift-api-digester: types with the same printed name are considered behavior-preserving. rdar://31694085
* [test] Using tmp directory from build.
* swift-api-digester: Add a test for generating migrator script.
* swift-api-digester: Add #ifndef guard before each macro category.
* swift-api-digester: Avoid printing macro categories with empty content.
* swift-api-digester: Add test for multiple type changes in a single decl.
* swift-api-digester: simplify some code. NFC
* swift-api-digester: consider name alias type as a standalone node kind.
* [test] Update the swift-api-digester dump for stdlib to honor new name alias node.