Commit Graph

132 Commits

Author SHA1 Message Date
Xi Ge
967beefffc swift-api-digester: teach the tool to detect member variables change to global ones. rdar://41658300 2018-06-29 16:33:22 -07:00
Xi Ge
42127d9f68 swift-api-digester: emit the diff items for changing from RawRepresentable struct to a type alias of raw type.
related: rdar://39498127
2018-06-15 11:55:09 -07:00
Xi Ge
7312fea3b2 migrator: emit error messages when migration scripts are missing.
We used to assert migration scripts exist. This patch further
decouples these scripts and the compiler by treating missing scripts
as a regular compiler error.

Related: rdar://40538097
2018-05-25 11:25:32 -07:00
Xi Ge
b0084558a2 swift-api-digester: specify raw types when detecting the reversion of NS_TYPED_EXTENSIBLE_ENUM. 2018-05-24 13:01:21 -07:00
Xi Ge
82ca0a1891 swift-api-digester: detect type alias of raw types change to RawRepresentableStructs.
Related to: rdar://40076487
2018-05-23 12:23:47 -07:00
Xi Ge
5212311cc0 swift-api-digester: sort migration scripts before serializing them. 2018-05-22 13:39:46 -07:00
Xi Ge
b9517110f2 swift-api-digester: print raw type names for raw representable API changes. 2018-05-16 17:16:41 -07:00
Xi Ge
d962656eed swift-api-digester: lessen some assertions. 2018-05-11 17:23:12 -07:00
Xi Ge
1556d62bce swift-api-digester: we should further detect if the declared type of a hoisted variable has been changed. rdar://40076924 2018-05-09 13:42:20 -07:00
Xi Ge
18f6c9c435 swift-api-digester: add an action to dump USRs for all decls in a header.
We need this for custom migration like rdar://39992329.
2018-05-04 17:19:24 -07:00
Xi Ge
82a2c2c644 migrator: ignore migration scripts with underscored new names. rdar://39877447
Updating something to underscored names is hardly correct. This patch
disallows picking up such migration scripts.
2018-05-01 16:06:06 -07:00
David Zarzycki
95473a10d7 [Misc] NFC: Fix random build warnings
Unused variables/methods, language extensions, extra semicolons, intentional
self assignment, platform specific quirks, etc.
2018-04-30 12:52:43 -04:00
Xi Ge
9b8cd0dc15 swift-api-digester: detect API changes due to undoing NS_TYPED_EXTENSIBLE_ENUM. rdar://39498127 2018-04-20 16:48:14 -07:00
Xi Ge
53c9f1aaa9 swift-api-digester: add a new action to dump name correction template.
Rename detection in the tool may not reflect overlay additions; thus we
mistakes a new name to be an underscored one. This new action searches
migration scripts for suspicious ones and generates a template for us to
specify the correct names.
2018-04-19 18:01:01 -07:00
Xi Ge
e405bab9bf swift-api-digester: separate migration kind from the other node annotation kind. NFC 2018-04-09 16:18:24 -07:00
Xi Ge
e15c197823 swift-api-digester: detect simple parameter/return type update from String to StringRepresentableStruct. 2018-04-08 13:24:12 -07:00
Xi Ge
3e00fda3e0 swift-api-digester: teach the tool to detect [String] changes to [StringRepresentable]. 2018-04-07 10:55:41 -07:00
Xi Ge
cd87f4142d swift-api-digester: add specific logic to detect optional dictionary's key changes.
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.
2018-04-06 16:43:56 -07:00
Xi Ge
9042db57b2 swift-api-digester: ignore synthesized type members from conformed clang protocols. 2018-04-06 12:42:30 -07:00
Xi Ge
4705e0790c swift-api-digester: rename SDK nodes internally. NFC 2018-04-05 15:55:41 -07:00
Xi Ge
72f49e2351 swift-api-digester: separate internal and external names for node kinds. NFC 2018-04-05 15:38:17 -07:00
Xi Ge
1163c33cfc swift-api-digester: minor refactoring. NFC 2018-04-05 14:58:04 -07:00
Xi Ge
cb53468c5f swift-api-digester: refine diagnostic messages for removed type alias.
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.
2018-04-04 21:10:10 -07:00
Xi Ge
6ffad8085b swift-api-digester: if a removed declaration has been hoisted to a type member,
show this declaration as renamed instead of removed.
2018-04-03 13:26:30 -07:00
Xi Ge
784116a79b swift-api-digester: simplify some code. NFC 2018-03-26 15:46:32 -07:00
Xi Ge
b2c437525c swift-api-digester: teach the tool to detect [String:Any] changes to [StringRepresentable:Any].
This allows us to migrate string enum changes from the frameworks.
2018-03-26 15:35:07 -07:00
Doug Gregor
b2b69e8abf Rename BoundNameAliasType to NameAliasType.
NameAliasType is dead! Long live NameAliasType!
2018-03-25 21:35:17 -07:00
Doug Gregor
c43f96a855 [AST] Remove now-unused NameAliasType. 2018-03-25 21:35:16 -07:00
Xi Ge
20a48e5adb swift-api-digester: teach the tool to serialize USRs for nominal type. (#15463)
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.
2018-03-23 16:29:54 -07:00
Doug Gregor
253bd10bd3 Cope with BoundNameAliasType in more places that handle NameAliasType. 2018-03-21 23:49:33 -07:00
Slava Pestov
30dae65226 AST: Add DeclBaseName::Kind::Constructor
Not used yet.
2018-03-16 00:25:54 -07:00
Jordan Rose
c26f40b45b Fix some more misuses of LLVM's YAML parser. (#15119)
https://reviews.llvm.org/D44317 should prevent this from happening
again.
2018-03-10 17:47:14 -08:00
Xi Ge
f66dd8e59c swift-api-digester: keep track of type declarations with fixed layout. (#14991)
We need special logic to check abi-stability for decls with fixed
layout.
2018-03-05 15:08:06 -08:00
Xi Ge
f77b318831 swift-api-digester: teach the tool to serialize raw type name for enum declarations. 2018-03-02 17:14:36 -08:00
Huon Wilson
78bdc95ce3 Merge pull request #14874 from huonw/at-owned-cleanup
Various refactorings for __owned.
2018-03-02 14:20:21 -08:00
Huon Wilson
b94c5364f5 [NFC] Rename 'Ownership' to 'ReferenceOwnership'.
There's really two forms of ownership: references and values. Renaming
to make way for better distinguishing of the two.
2018-03-02 11:38:28 -08:00
Xi Ge
66bb9ce4ba swift-api-digester: teach the tool to serialize conforming protocols. (#14923) 2018-03-01 15:57:59 -08:00
Jordan Rose
3cd9f166bc Don't spend time initializing LLVM when running the driver (#14896)
Tiny start-up time optimization noticed while looking at how we do
PrettyStackTraceProgram. Also add PrettyStackTraceProgram to a few
more of our testing tools, via the new PROGRAM_START macro.
2018-02-28 19:56:19 -08:00
Xi Ge
60bd6b91e0 swift-api-digester: serialize and de-serialize whether a parameter has a default argument.
Removing default arguments can be source-breaking.
2018-02-27 13:18:58 -08:00
Xi Ge
1aa7816956 swift-api-digester: teach the tool to serialize and de-serialize generic requirements.
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.
2018-02-23 15:30:57 -08:00
Xi Ge
4e84693ab9 swift-api-digester: print header file names along with source-breaking changes. (#14788)
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.
2018-02-22 13:47:35 -08:00
Mark Lacey
b4b66bc8e8 Replace getAnyOptionalObjectType with getOptionalObjectType. 2018-02-05 23:59:00 -08:00
Xi Ge
cd3b34c7cf swift-api-digester: for each source-breaking item, we should output its framework name to help screening. rdar://35421724 (#14068)
The framework name is behind a flag "print-module". We should
print them during whole-sdk checks however not in the per-framework diffing
tool.
2018-01-22 15:44:26 -08:00
Mark Lacey
4a913515a8 IUO: Update swift-api-digester for the removal of IUOs from the type system.
When IUOs actually go away I will commit changes to these tests for
the mangling difference:

  test/api-digester/Outputs/macro-gen.def
  test/api-digester/Outputs/macro-gen.json
2018-01-12 21:19:40 -08:00
Xi Ge
884f3dbdc2 swift-api-digester: Ignore the declarations that have no accessibility set. rdar://35375615 (#12784) 2017-11-07 11:19:54 -08:00
Jordan Rose
1c651973c3 Excise "Accessibility" from the compiler (2/3)
"Accessibility" has a different meaning for app developers, so we've
already deliberately excised it from our diagnostics in favor of terms
like "access control" and "access level". Do the same in the compiler
now that we aren't constantly pulling things into the release branch.

This commit changes the 'Accessibility' enum to be named 'AccessLevel'.
2017-08-28 11:34:44 -07:00
Jordan Rose
7d7e496dc0 [swift-api-digester] Update for 'deinit' as a special name.
Missed switch case from the 17ddc5802f series. Unbreaks the build
after -Werror=switch.
2017-08-01 10:55:21 -07:00
Xi Ge
a603fcbcf3 swift-api-digester: More strict conditions when detecting member hoist API changes. [SR-5498] (#11091)
We observed several false positives of function hoist API changes. This patch
strictly checks the new module doesn't contain a declaration with the
identical name of the old function before hoisting to eliminate such
false positives.

This case is too complex to come up with an actual test case.
2017-07-20 17:07:06 -07:00
Xi Ge
a410f20584 swift-api-digester: Avoid considering a type decl is removed if a typealias with the same name is simultaneously added. rdar://33307864 (#11016) 2017-07-18 12:01:32 -07:00
Alex Hoppen
f8c2692f79 Introduce special decl names
Special DeclNames represent names that do not have an identifier in the
surface language. This implies serializing the information about whether
a name is special together with its identifier (if it is not special)
in both the module file and the swift lookup table.
2017-07-11 19:04:13 +02:00