mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Do not build Swift interface files into binary modules when performing a canImport query.
We should hold off actually building the binary module file until it is imported. `canImport` queries can happen, for example, during dependency scanning, when we do not wish to have the scanner tool execute any module builds. Resolves rdar://82603098
This commit is contained in:
@@ -32,7 +32,7 @@ std::error_code ModuleDependencyScanner::findModuleFilesInDirectory(
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
|
||||
bool IsFramework) {
|
||||
bool skipBuildingInterface, bool IsFramework) {
|
||||
using namespace llvm::sys;
|
||||
|
||||
auto &fs = *Ctx.SourceMgr.getFileSystem();
|
||||
@@ -77,7 +77,7 @@ std::error_code PlaceholderSwiftModuleScanner::findModuleFilesInDirectory(
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
|
||||
bool IsFramework) {
|
||||
bool skipBuildingInterface, bool IsFramework) {
|
||||
StringRef moduleName = ModuleID.Item.str();
|
||||
auto it = PlaceholderDependencyModuleMap.find(moduleName);
|
||||
// If no placeholder module stub path is given matches the name, return with an
|
||||
|
||||
Reference in New Issue
Block a user