mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Frontend: add a frontend flag to generate empty ABI descriptors to workaround deserialization issues
ABI descriptors should always be emitted as sidecars for library-evolution-enabled modules. However, generating these files requires traversing the entire module (like indexing), which may hit additional deserialization issues. To unblock builds, this patch introduces a flag to skip the traversing logic so that we emit an empty ABI descriptor file. The empty file serves as a placeholder so that build system doesn't need to know the details.
This commit is contained in:
@@ -2498,7 +2498,7 @@ int swift::ide::api::deserializeSDKDump(StringRef dumpPath, StringRef OutputPath
|
||||
}
|
||||
|
||||
void swift::ide::api::dumpModuleContent(ModuleDecl *MD, StringRef OutputFile,
|
||||
bool ABI) {
|
||||
bool ABI, bool Empty) {
|
||||
CheckerOptions opts;
|
||||
opts.ABI = ABI;
|
||||
opts.SwiftOnly = true;
|
||||
@@ -2509,12 +2509,17 @@ void swift::ide::api::dumpModuleContent(ModuleDecl *MD, StringRef OutputFile,
|
||||
opts.Verbose = false;
|
||||
SDKContext ctx(opts);
|
||||
SwiftDeclCollector collector(ctx);
|
||||
collector.lookupVisibleDecls({MD});
|
||||
ConstExtractor extractor(ctx, MD->getASTContext());
|
||||
extractor.extract(MD);
|
||||
PayLoad payload;
|
||||
payload.allContsValues = &extractor.getAllConstValues();
|
||||
dumpSDKRoot(collector.getSDKRoot(), payload, OutputFile);
|
||||
SWIFT_DEFER {
|
||||
payload.allContsValues = &extractor.getAllConstValues();
|
||||
dumpSDKRoot(collector.getSDKRoot(), payload, OutputFile);
|
||||
};
|
||||
if (Empty) {
|
||||
return;
|
||||
}
|
||||
collector.lookupVisibleDecls({MD});
|
||||
extractor.extract(MD);
|
||||
}
|
||||
|
||||
int swift::ide::api::findDeclUsr(StringRef dumpPath, CheckerOptions Opts) {
|
||||
|
||||
Reference in New Issue
Block a user