mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #28515 from DougGregor/fast-dependency-scanning
Fast dependency scanning for Swift
This commit is contained in:
@@ -687,11 +687,10 @@ std::unique_ptr<SILModule> CompilerInstance::takeSILModule() {
|
||||
/// builds. This allows for use of popular specialized functions
|
||||
/// from the standard library, which makes the non-optimized builds
|
||||
/// execute much faster.
|
||||
static bool shouldImplicityImportSwiftOnoneSupportModule(
|
||||
const CompilerInvocation &Invocation) {
|
||||
if (Invocation.getImplicitStdlibKind() != ImplicitStdlibKind::Stdlib)
|
||||
bool CompilerInvocation::shouldImportSwiftONoneSupport() const {
|
||||
if (getImplicitStdlibKind() != ImplicitStdlibKind::Stdlib)
|
||||
return false;
|
||||
if (Invocation.getSILOptions().shouldOptimize())
|
||||
if (getSILOptions().shouldOptimize())
|
||||
return false;
|
||||
|
||||
// If we are not executing an action that has a dependency on
|
||||
@@ -706,7 +705,7 @@ static bool shouldImplicityImportSwiftOnoneSupportModule(
|
||||
//
|
||||
// This optimization is disabled by -track-system-dependencies to preserve
|
||||
// the explicit dependency.
|
||||
const auto &options = Invocation.getFrontendOptions();
|
||||
const auto &options = getFrontendOptions();
|
||||
return options.TrackSystemDeps
|
||||
|| FrontendOptions::doesActionGenerateSIL(options.RequestedAction);
|
||||
}
|
||||
@@ -720,7 +719,7 @@ ImplicitImportInfo CompilerInstance::getImplicitImportInfo() const {
|
||||
for (auto &moduleStr : frontendOpts.getImplicitImportModuleNames())
|
||||
imports.ModuleNames.push_back(Context->getIdentifier(moduleStr));
|
||||
|
||||
if (shouldImplicityImportSwiftOnoneSupportModule(Invocation))
|
||||
if (Invocation.shouldImportSwiftONoneSupport())
|
||||
imports.ModuleNames.push_back(Context->getIdentifier(SWIFT_ONONE_SUPPORT));
|
||||
|
||||
imports.ShouldImportUnderlyingModule = frontendOpts.ImportUnderlyingModule;
|
||||
|
||||
Reference in New Issue
Block a user