File tree Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 90
90
#include " clang/Serialization/ASTReader.h"
91
91
#include " clang/Serialization/ASTWriter.h"
92
92
#include " clang/Serialization/ObjectFilePCHContainerReader.h"
93
+ #include " clang/Tooling/DependencyScanning/ModuleDepCollector.h"
93
94
#include " clang/Tooling/DependencyScanning/ScanAndUpdateArgs.h"
94
95
#include " llvm/ADT/IntrusiveRefCntPtr.h"
95
96
#include " llvm/ADT/STLExtras.h"
@@ -4232,11 +4233,12 @@ ClangImporter::getSwiftExplicitModuleDirectCC1Args() const {
4232
4233
PPOpts.MacroIncludes .clear ();
4233
4234
PPOpts.Includes .clear ();
4234
4235
4235
- // CodeGenOptions.
4236
- auto &CGOpts = instance.getCodeGenOpts ();
4237
- CGOpts.DebugCompilationDir .clear ();
4236
+ // Clear benign CodeGenOptions.
4237
+ clang::tooling::dependencies::resetBenignCodeGenOptions (
4238
+ clang::frontend::ActionKind::GenerateModule, instance.getLangOpts (),
4239
+ instance.getCodeGenOpts ());
4238
4240
4239
- // FileSystemOptions.
4241
+ // FileSystemOptions.
4240
4242
auto &FSOpts = instance.getFileSystemOpts ();
4241
4243
FSOpts.WorkingDir .clear ();
4242
4244
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: split-file %s %t
3
+
4
+ // RUN: %target-swift-frontend -scan-dependencies -module-name Test -O -I %t/include \
5
+ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \
6
+ // RUN: %t/main.swift -o %t/deps.json -cache-compile-job -cas-path %t/cas -profile-coverage-mapping -profile-generate
7
+
8
+ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/shim.cmd
9
+ // RUN: %swift_frontend_plain @%t/shim.cmd
10
+ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json A > %t/A.cmd
11
+ // RUN: %swift_frontend_plain @%t/A.cmd
12
+
13
+ // RUN: %FileCheck %s --input-file=%t/shim.cmd
14
+ // RUN: %FileCheck %s --input-file=%t/A.cmd
15
+
16
+ // CHECK: -direct-clang-cc1-module-build
17
+ // CHECK-NOT: -fcoverage-compilation-dir
18
+
19
+ //--- main.swift
20
+ import A
21
+ func test( ) {
22
+ a ( ) ;
23
+ }
24
+
25
+ //--- include/A.swiftinterface
26
+ // swift-interface-format-version: 1.0
27
+ // swift-module-flags: -module-name A -O -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib -user-module-version 1.0
28
+ public func a( ) { }
You can’t perform that action at this time.
0 commit comments