mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add a “typecheck module interface” mode
This commit is contained in:
@@ -176,6 +176,8 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
|
||||
return false;
|
||||
}
|
||||
FrontendOptions &FEOpts = subInvocation.getFrontendOptions();
|
||||
bool isTypeChecking =
|
||||
(FEOpts.RequestedAction == FrontendOptions::ActionType::Typecheck);
|
||||
const auto &InputInfo = FEOpts.InputsAndOutputs.firstInput();
|
||||
StringRef InPath = InputInfo.file();
|
||||
const auto &OutputInfo =
|
||||
@@ -242,6 +244,9 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
|
||||
if (ShouldSerializeDeps)
|
||||
SerializationOpts.Dependencies = Deps;
|
||||
SILMod->setSerializeSILAction([&]() {
|
||||
if (isTypeChecking)
|
||||
return;
|
||||
|
||||
// We don't want to serialize module docs in the cache -- they
|
||||
// will be serialized beside the interface file.
|
||||
serializeToBuffers(Mod, SerializationOpts, ModuleBuffer,
|
||||
|
||||
Reference in New Issue
Block a user