File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -957,6 +957,11 @@ importer::addCommonInvocationArguments(
957
957
}
958
958
}
959
959
}
960
+
961
+ for (auto &overlay : searchPathOpts.VFSOverlayFiles ) {
962
+ invocationArgStrs.push_back (" -ivfsoverlay" );
963
+ invocationArgStrs.push_back (overlay);
964
+ }
960
965
}
961
966
962
967
bool ClangImporter::canReadPCH (StringRef PCHFilename) {
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ ModuleDependencyVector ClangImporter::bridgeClangModuleDependencies(
138
138
clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
139
139
clang::tooling::dependencies::ModuleDepsGraph &clangDependencies,
140
140
StringRef moduleOutputPath, RemapPathCallback callback) {
141
- const auto &ctx = Impl.SwiftContext ;
141
+ auto &ctx = Impl.SwiftContext ;
142
142
ModuleDependencyVector result;
143
143
144
144
auto remapPath = [&](StringRef path) {
@@ -201,6 +201,11 @@ ModuleDependencyVector ClangImporter::bridgeClangModuleDependencies(
201
201
clangModuleDep.getBuildArguments (),
202
202
[&](const std::string &Arg) { clangArgs.push_back (Arg.c_str ()); });
203
203
204
+ ClangInvocationFileMapping fileMapping =
205
+ getClangInvocationFileMapping (ctx, nullptr , /* supressDiagnostic*/ true );
206
+ if (fileMapping.requiresBuiltinHeadersInSystemModules )
207
+ clangArgs.push_back (" -fbuiltin-headers-in-system-modules" );
208
+
204
209
bool success = clang::CompilerInvocation::CreateFromArgs (
205
210
depsInvocation, clangArgs, clangDiags);
206
211
(void )success;
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend -scan-dependencies -Xcc -v %s -o - | %validate-json | %FileCheck %s
3
+
4
+ // We want to explicitly import WinSDK's CRT.
5
+ // REQUIRES: OS=windows-msvc
6
+
7
+ import CRT
8
+
9
+ // CHECK: "modulePath": "{{.*}}\\ucrt-{{.*}}.pcm",
10
+ // CHECK-NEXT: "sourceFiles": [
11
+ // CHECK-NEXT: "{{.*}}\\ucrt\\module.modulemap"
You can’t perform that action at this time.
0 commit comments