Skip to content

Commit 765deb1

Browse files
committed
Allow enabling embedded Swift without WMO when not generating SIL
This allows modes like -index-file to work the same way they do when not using embedded Swift
1 parent 9d2af57 commit 765deb1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Frontend/CompilerInvocation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
15751575
HadError = true;
15761576
}
15771577

1578-
if (!FrontendOpts.InputsAndOutputs.isWholeModule()) {
1578+
if (!FrontendOpts.InputsAndOutputs.isWholeModule() && FrontendOptions::doesActionGenerateSIL(FrontendOpts.RequestedAction)) {
15791579
Diags.diagnose(SourceLoc(), diag::wmo_with_embedded);
15801580
HadError = true;
15811581
}

test/embedded/wmo-with-embedded-diag.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %target-swift-frontend -typecheck -parse-stdlib %s -enable-experimental-feature Embedded
22
// RUN: not %target-swift-frontend -typecheck -parse-stdlib %s -primary-file %s -enable-experimental-feature Embedded 2>&1 | %FileCheck %s
33

4-
// RUN: %target-swiftc_driver -typecheck -parse-stdlib %s -Xfrontend -disable-objc-interop -enable-experimental-feature Embedded -wmo
5-
// RUN: not %target-swiftc_driver -typecheck -parse-stdlib %s -Xfrontend -disable-objc-interop -enable-experimental-feature Embedded 2>&1 | %FileCheck %s
4+
// RUN: %target-swiftc_driver -c %s -o %t -parse-stdlib -Xfrontend -disable-objc-interop -enable-experimental-feature Embedded -wmo
5+
// RUN: not %target-swiftc_driver -c %s -o %t -parse-stdlib -Xfrontend -disable-objc-interop -enable-experimental-feature Embedded 2>&1 | %FileCheck %s
66

77
// REQUIRES: swift_in_compiler
88

0 commit comments

Comments
 (0)