mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Dependency Scanning] Add ClangImporter's mandatory path remaps to dependency scanning query filesystem
On creation, 'ClangImporter' adds overlay modulemap files for non-modular platform libraries (e.g. glibc, libstdc++), which allows Swift code to import and use those libraries. This change adds the same filesystem overlay to dependency scanning queries by applying them to the filesystem instantiated for each depndency scanning worker. Without these overlays EBM builds cannot discover and use non-modular system libraries on non-Darwin platforms. Resolves rdar://151780437
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "swift/Frontend/ModuleInterfaceLoader.h"
|
||||
#include "swift/Serialization/SerializedModuleLoader.h"
|
||||
#include "swift/Subsystems.h"
|
||||
#include "clang/Frontend/CompilerInstance.h"
|
||||
#include "llvm/ADT/IntrusiveRefCntPtr.h"
|
||||
#include "llvm/ADT/SetOperations.h"
|
||||
#include "llvm/CAS/CachingOnDiskFileSystem.h"
|
||||
@@ -267,7 +268,7 @@ ModuleDependencyScanningWorker::ModuleDependencyScanningWorker(
|
||||
const SILOptions &SILOptions, ASTContext &ScanASTContext,
|
||||
swift::DependencyTracker &DependencyTracker, DiagnosticEngine &Diagnostics)
|
||||
: clangScanningTool(*globalScanningService.ClangScanningService,
|
||||
globalScanningService.getClangScanningFS()) {
|
||||
globalScanningService.getClangScanningFS(ScanASTContext)) {
|
||||
// Create a scanner-specific Invocation and ASTContext.
|
||||
workerCompilerInvocation =
|
||||
std::make_unique<CompilerInvocation>(ScanCompilerInvocation);
|
||||
|
||||
Reference in New Issue
Block a user