mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: Share TypeConverter between SILModules in batch mode
This commit is contained in:
@@ -917,7 +917,7 @@ generateSILModules(CompilerInvocation &Invocation, CompilerInstance &Instance) {
|
||||
if (!opts.InputsAndOutputs.hasPrimaryInputs()) {
|
||||
// If there are no primary inputs the compiler is in WMO mode and builds one
|
||||
// SILModule for the entire module.
|
||||
auto SM = performSILGeneration(mod, SILOpts);
|
||||
auto SM = performSILGeneration(mod, Instance.getSILTypes(), SILOpts);
|
||||
std::deque<PostSILGenInputs> PSGIs;
|
||||
const PrimarySpecificPaths PSPs =
|
||||
Instance.getPrimarySpecificPathsForWholeModuleOptimizationMode();
|
||||
@@ -930,7 +930,7 @@ generateSILModules(CompilerInvocation &Invocation, CompilerInstance &Instance) {
|
||||
// once for each such input.
|
||||
std::deque<PostSILGenInputs> PSGIs;
|
||||
for (auto *PrimaryFile : Instance.getPrimarySourceFiles()) {
|
||||
auto SM = performSILGeneration(*PrimaryFile, SILOpts);
|
||||
auto SM = performSILGeneration(*PrimaryFile, Instance.getSILTypes(), SILOpts);
|
||||
const PrimarySpecificPaths PSPs =
|
||||
Instance.getPrimarySpecificPathsForSourceFile(*PrimaryFile);
|
||||
PSGIs.push_back(PostSILGenInputs{std::move(SM), true, PrimaryFile, PSPs});
|
||||
@@ -944,7 +944,7 @@ generateSILModules(CompilerInvocation &Invocation, CompilerInstance &Instance) {
|
||||
if (Invocation.getFrontendOptions().InputsAndOutputs.isInputPrimary(
|
||||
SASTF->getFilename())) {
|
||||
assert(PSGIs.empty() && "Can only handle one primary AST input");
|
||||
auto SM = performSILGeneration(*SASTF, SILOpts);
|
||||
auto SM = performSILGeneration(*SASTF, Instance.getSILTypes(), SILOpts);
|
||||
const PrimarySpecificPaths &PSPs =
|
||||
Instance.getPrimarySpecificPathsForPrimary(SASTF->getFilename());
|
||||
PSGIs.push_back(
|
||||
|
||||
Reference in New Issue
Block a user