mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SR-3063] Suppress SIL transforms when merging modules.
This commit is contained in:
@@ -816,7 +816,9 @@ static bool performCompile(CompilerInstance &Instance,
|
||||
}
|
||||
|
||||
// Perform "stable" optimizations that are invariant across compiler versions.
|
||||
if (!Invocation.getDiagnosticOptions().SkipDiagnosticPasses) {
|
||||
if (Action == FrontendOptions::MergeModules) {
|
||||
// Don't run diagnostic passes at all.
|
||||
} else if (!Invocation.getDiagnosticOptions().SkipDiagnosticPasses) {
|
||||
if (runSILDiagnosticPasses(*SM))
|
||||
return true;
|
||||
|
||||
@@ -846,8 +848,9 @@ static bool performCompile(CompilerInstance &Instance,
|
||||
// These may change across compiler versions.
|
||||
{
|
||||
SharedTimer timer("SIL optimization");
|
||||
if (Invocation.getSILOptions().Optimization >
|
||||
SILOptions::SILOptMode::None) {
|
||||
if (Action != FrontendOptions::MergeModules &&
|
||||
Invocation.getSILOptions().Optimization >
|
||||
SILOptions::SILOptMode::None) {
|
||||
|
||||
runSILOptPreparePasses(*SM);
|
||||
|
||||
@@ -936,7 +939,8 @@ static bool performCompile(CompilerInstance &Instance,
|
||||
serialize(DC, serializationOpts, SM.get());
|
||||
}
|
||||
|
||||
if (Action == FrontendOptions::EmitModuleOnly) {
|
||||
if (Action == FrontendOptions::MergeModules ||
|
||||
Action == FrontendOptions::EmitModuleOnly) {
|
||||
if (shouldIndex) {
|
||||
if (emitIndexData(PrimarySourceFile, Invocation, Instance))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user