File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1167,14 +1167,19 @@ void Serializer::writeHeader() {
1167
1167
auto &Opts = Options.ExtraClangOptions ;
1168
1168
for (auto Arg = Opts.begin (), E = Opts.end (); Arg != E; ++Arg) {
1169
1169
StringRef arg (*Arg);
1170
- if (arg.starts_with (" -ivfsoverlay" )) {
1170
+ if (!Options. ExplicitModuleBuild && arg.starts_with (" -ivfsoverlay" )) {
1171
1171
// FIXME: This is a hack and calls for a better design.
1172
1172
//
1173
1173
// Filter out any -ivfsoverlay options that include an
1174
1174
// unextended-module-overlay.yaml overlay. By convention the Xcode
1175
1175
// buildsystem uses these while *building* mixed Objective-C and
1176
1176
// Swift frameworks; but they should never be used to *import* the
1177
1177
// module defined in the framework.
1178
+ //
1179
+ // This is not done for explicit modules builds. In an explicit
1180
+ // build LLDB needs to be able import the unmodified .pcms, so
1181
+ // having the exact same flags matters there, and there is no risk
1182
+ // of a recompilation failure, because nothing is recompiled.
1178
1183
auto Next = std::next (Arg);
1179
1184
if (Next != E &&
1180
1185
StringRef (*Next).ends_with (" unextended-module-overlay.yaml" )) {
Original file line number Diff line number Diff line change 6
6
7
7
// Output paths differ in the new driver, so force SWIFT_USE_OLD_DRIVER for now.
8
8
// RUN: cd %t/secret && env SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -emit-module -o %t/has_xref.swiftmodule -I . -F ../Frameworks -parse-as-library %S/Inputs/has_xref.swift %S/../Inputs/empty.swift -Xfrontend -serialize-debugging-options -Xcc -ivfsoverlay -Xcc %S/../Inputs/unextended-module-overlay.yaml -Xcc -DDUMMY
9
+ // RUN: cd %t/secret && env SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -emit-module -o %t/explicit.swiftmodule -parse-stdlib -parse-as-library %S/../Inputs/empty.swift -Xfrontend -disable-implicit-swift-modules -Xfrontend -serialize-debugging-options -Xcc -ivfsoverlay -Xcc %S/../Inputs/unextended-module-overlay.yaml -Xcc -DDUMMY
9
10
// RUN: %target-swift-frontend %s -typecheck -I %t
10
11
11
12
// Ensure that in Swift 6 mode we do not read out search paths, thus are no longer able to
15
16
16
17
// Check the actual serialized search paths.
17
18
// RUN: llvm-bcanalyzer -dump %t/has_xref.swiftmodule > %t/has_xref.swiftmodule.txt
19
+ // RUN: llvm-bcanalyzer -dump %t/explicit.swiftmodule > %t/explicit.swiftmodule.txt
18
20
// RUN: %FileCheck %s < %t/has_xref.swiftmodule.txt
19
21
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t/has_xref.swiftmodule.txt
22
+ // RUN: %FileCheck -check-prefix=EXPLICIT %s < %t/explicit.swiftmodule.txt
20
23
21
24
import has_xref
22
25
@@ -36,6 +39,10 @@ numeric(42)
36
39
// NEGATIVE-NOT: '.'
37
40
// NEGATIVE-NOT: '../Frameworks'
38
41
// This should be filtered out.
39
- // NEGATIVE-NOT: -ivfsoverlay{{.*}}unextended-module-overlay.yaml
42
+ // NEGATIVE-NOT: -ivfsoverlay
43
+ // NEGATIVE-NOT: unextended-module-overlay.yaml
44
+ // EXPLICIT: -ivfsoverlay
45
+ // EXPLICIT: unextended-module-overlay.yaml
46
+ // EXPLICIT: -DDUMMY
40
47
41
48
// SWIFT6: error: missing required modules: 'has_alias', 'struct_with_operators'
You can’t perform that action at this time.
0 commit comments