Skip to content

Commit 0ca2399

Browse files
committed
Build Module Interfaces in WMO
Building in incremental mode incurs the overhead associated with the incremental dependency tracking infrastructure. Considering we're throwing away all of this stuff anyways, let's just build in WMO to avoid that.
1 parent 403b2bf commit 0ca2399

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

include/swift/Frontend/ModuleInterfaceLoader.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
244244
llvm::StringSaver ArgSaver;
245245
std::vector<StringRef> GenericArgs;
246246
CompilerInvocation subInvocation;
247-
std::vector<SupplementaryOutputPaths> ModuleOutputPaths;
248247

249248
template<typename ...ArgTypes>
250249
InFlightDiagnostic diagnose(StringRef interfacePath,

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ bool InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleN
13401340
assert(BuildArgs.size() == GenericArgs.size());
13411341
// Configure inputs
13421342
subInvocation.getFrontendOptions().InputsAndOutputs
1343-
.addPrimaryInputFile(interfacePath);
1343+
.addInputFile(interfacePath);
13441344
BuildArgs.push_back(interfacePath);
13451345
subInvocation.setModuleName(moduleName);
13461346
BuildArgs.push_back("-module-name");
@@ -1357,13 +1357,12 @@ bool InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleN
13571357
}
13581358

13591359
// Configure the outputs in front-end options. There must be an equal number of
1360-
// primary inputs and outputs.
1361-
auto N = subInvocation.getFrontendOptions().InputsAndOutputs
1362-
.primaryInputCount();
1363-
std::vector<std::string> outputFiles(N, "/<unused>");
1360+
// inputs and outputs.
1361+
std::vector<std::string> outputFiles{"/<unused>"};
1362+
std::vector<SupplementaryOutputPaths> ModuleOutputPaths;
13641363
ModuleOutputPaths.emplace_back();
13651364
ModuleOutputPaths.back().ModuleOutputPath = outputPath.str();
1366-
assert(N == ModuleOutputPaths.size());
1365+
assert(subInvocation.getFrontendOptions().InputsAndOutputs.isWholeModule());
13671366
subInvocation.getFrontendOptions().InputsAndOutputs
13681367
.setMainAndSupplementaryOutputs(outputFiles, ModuleOutputPaths);
13691368

0 commit comments

Comments
 (0)