mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Frontend: Introduce -emit-api-descriptor flag.
An "API descriptor" file is JSON describing the externally accessible symbols of a module and metadata associated with those symbols like availability and SPI status. This output was previously only generated by the `swift-api-extract` alias of `swift-frontend`, which is desgined to take an already built module as input. Post-processing a built module to extract this information is inefficient because the module and the module's dependencies need to be deserialized in order to visit the entire AST. We can generate this output more efficiently as a supplementary output of the -emit-module job that originally produced the module (since the AST is already available in-memory). The -emit-api-descriptor flag can be used to request this output. This change lays the groundwork by introducing frontend flags. Follow up changes are needed to make API descriptor emission during -emit-module functional. Part of rdar://110916764.
This commit is contained in:
@@ -511,6 +511,12 @@ bool FrontendInputsAndOutputs::hasABIDescriptorOutputPath() const {
|
||||
return outs.ABIDescriptorOutputPath;
|
||||
});
|
||||
}
|
||||
bool FrontendInputsAndOutputs::hasAPIDescriptorOutputPath() const {
|
||||
return hasSupplementaryOutputPath(
|
||||
[](const SupplementaryOutputPaths &outs) -> const std::string & {
|
||||
return outs.APIDescriptorOutputPath;
|
||||
});
|
||||
}
|
||||
bool FrontendInputsAndOutputs::hasConstValuesOutputPath() const {
|
||||
return hasSupplementaryOutputPath(
|
||||
[](const SupplementaryOutputPaths &outs) -> const std::string & {
|
||||
|
||||
Reference in New Issue
Block a user