Frontend: teach -emit-module and -merge-modules to emit ABI descriptor files

This commit is contained in:
Xi Ge
2021-09-21 15:39:33 -07:00
parent 84200b846f
commit f97653ef37
8 changed files with 39 additions and 10 deletions

View File

@@ -24,7 +24,6 @@
#include "swift/Frontend/ModuleInterfaceSupport.h"
#include "swift/SILOptimizer/PassManager/Passes.h"
#include "swift/Serialization/SerializationOptions.h"
#include "swift/APIDigester/ModuleAnalyzerNodes.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "llvm/ADT/Hashing.h"
@@ -258,7 +257,7 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
SerializationOpts.ModuleInterface = InPath;
SerializationOpts.SDKName = SubInstance.getASTContext().LangOpts.SDKName;
SerializationOpts.ABIDescriptorPath = ABIDescriptorPath.str();
SmallVector<FileDependency, 16> Deps;
bool serializeHashes = FEOpts.SerializeModuleInterfaceDependencyHashes;
if (collectDepsForSerialization(SubInstance, Deps, serializeHashes)) {
@@ -286,9 +285,6 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
if (SubInstance.getDiags().hadAnyError()) {
return std::make_error_code(std::errc::not_supported);
}
if (!ABIDescriptorPath.empty()) {
swift::ide::api::dumpModuleContent(Mod, ABIDescriptorPath, true);
}
return std::error_code();
});
}, ThreadStackSize);