mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #65925 from cachemeifyoucan/eng/PR-swift-frontend-tweaks-for-caching
Cleanup some redundant dependencies and unnecessary works that prevent compiler caching.
This commit is contained in:
@@ -369,12 +369,13 @@ static bool precompileBridgingHeader(const CompilerInstance &Instance) {
|
||||
if (!PCHOutDir.empty()) {
|
||||
// Create or validate a persistent PCH.
|
||||
auto SwiftPCHHash = Invocation.getPCHHash();
|
||||
auto PCH = clangImporter->getOrCreatePCH(ImporterOpts, SwiftPCHHash);
|
||||
auto PCH = clangImporter->getOrCreatePCH(ImporterOpts, SwiftPCHHash,
|
||||
/*cached=*/false);
|
||||
return !PCH.has_value();
|
||||
}
|
||||
return clangImporter->emitBridgingPCH(
|
||||
opts.InputsAndOutputs.getFilenameOfFirstInput(),
|
||||
opts.InputsAndOutputs.getSingleOutputFilename());
|
||||
opts.InputsAndOutputs.getSingleOutputFilename(), /*cached=*/false);
|
||||
}
|
||||
|
||||
static bool precompileClangModule(const CompilerInstance &Instance) {
|
||||
@@ -2072,6 +2073,11 @@ int swift::performFrontend(ArrayRef<const char *> Args,
|
||||
auto finishDiagProcessing = [&](int retValue, bool verifierEnabled) -> int {
|
||||
FinishDiagProcessingCheckRAII.CalledFinishDiagProcessing = true;
|
||||
PDC.setSuppressOutput(false);
|
||||
if (auto *CDP = Instance->getCachingDiagnosticsProcessor()) {
|
||||
// Don't cache if build failed.
|
||||
if (retValue)
|
||||
CDP->endDiagnosticCapture();
|
||||
}
|
||||
bool diagnosticsError = Instance->getDiags().finishProcessing();
|
||||
// If the verifier is enabled and did not encounter any verification errors,
|
||||
// return 0 even if the compile failed. This behavior isn't ideal, but large
|
||||
|
||||
Reference in New Issue
Block a user