Commit Graph

7 Commits

Author SHA1 Message Date
Allan Shortlidge
c1ce404b3c Tests: Simplify APIJSON tests that no longer exercise swift-api-extract. 2024-06-27 17:55:01 -07:00
Allan Shortlidge
470baff865 Driver: Remove swift-api-extract.
Now that API descriptions are emitted during module build jobs when
`-emit-api-descriptor-path` is specified and the build system has been updated
to pass that flag when the output is needed, the `swift-api-extract` frontend
alias is no longer used. Delete it and the tests that were specific to invoking
`swift-api-extract`.

Resolves rdar://116537394.
2024-06-27 17:05:32 -07:00
Becca Royal-Gordon
07b9fe9ce6 Support @objc(CustomName) on extensions
This now specifies a category name that’s used in TBDGen, IRGen, and PrintAsClang. There are also now category name conflict diagnostics; these subsume some @implementation diagnostics.

(It turns out there was already a check for @objc(CustomName) to make sure it wasn’t a selector!)
2024-05-16 13:40:13 -07:00
Allan Shortlidge
778532dbdf TBDGen: Don't emit pretty-printed API descriptor JSON by default.
Instead, use the `%validate-json` lit substitution to validate and format the
API descriptor file before running it through FileCheck. This allows us to
avoid needing to introduce a dedicated frontend option just to control whether
the output of -emit-api-descriptor is pretty printed.
2023-10-05 11:40:53 -07:00
Allan Shortlidge
e91580bf0e TBDGen: Teach APIGenRecorder to emit API descriptors during -emit-module.
Make the changes to APIGenRecorder that are necessary to make it capable of
emitting API descriptors during -emit-module jobs. The output in this mode
differs from the output when run on an existing module in a couple of important
ways:

- The value for the `file` key in the descriptor JSON is now the path to the
  source file that defines the declaration responsible for the symbol. In
  `swift-api-extract` mode, the value for this key is the path to the module or
  swiftinterface which is unavailable during an -emit-module job since the module
  is usually not being emitted to its final installed location.
- Some additional symbols may be included in the API descriptor JSON because
  more of the AST is available when emitting the module.

Resolves rdar://110916764
2023-10-05 11:40:53 -07:00
Allan Shortlidge
ea1ba1387d NFC: Add -parse-as-library and dedicated module caches to APIJSON tests. 2023-10-04 21:46:23 -07:00
Juergen Ributzka
a9e02e91cb [TBDGen] Add support for Objective-C Categories.
Emit Objective-C Categories for extensions that have the @objc attribute
directly (or indirectly via one of its methods, subscripts, etc) attached.

Also associate and emit all methods for that category into the API JSON file.

This fixes rdar://94734748.
2022-06-28 09:09:49 -07:00