Skip to content

Commit 0825fa5

Browse files
committed
[Frontend] Enforce restrictions on private interfaces
Previously we may have silently bailed if a private module interface path was specified, but the frontend action didn't support it. Instead, make sure we enforce the same restrictions that we enforce for public module interfaces.
1 parent b0bb723 commit 0825fa5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ bool ArgsToFrontendOptionsConverter::checkUnusedSupplementaryOutputPaths()
539539
return true;
540540
}
541541
if (!FrontendOptions::canActionEmitInterface(Opts.RequestedAction) &&
542-
Opts.InputsAndOutputs.hasModuleInterfaceOutputPath()) {
542+
(Opts.InputsAndOutputs.hasModuleInterfaceOutputPath() ||
543+
Opts.InputsAndOutputs.hasPrivateModuleInterfaceOutputPath())) {
543544
Diags.diagnose(SourceLoc(), diag::error_mode_cannot_emit_interface);
544545
return true;
545546
}

test/Frontend/supplementary-output-support.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@
2828
// PARSE_NO_INTERFACE: error: this mode does not support emitting module interface files{{$}}
2929
// RUN: not %target-swift-frontend -emit-silgen -emit-module-interface-path %t %s 2>&1 | %FileCheck -check-prefix=SILGEN_NO_INTERFACE %s
3030
// SILGEN_NO_INTERFACE: error: this mode does not support emitting module interface files{{$}}
31+
32+
// RUN: not %target-swift-frontend -parse -emit-private-module-interface-path %t %s 2>&1 | %FileCheck -check-prefix=PARSE_NO_PRIVATE_INTERFACE %s
33+
// PARSE_NO_PRIVATE_INTERFACE: error: this mode does not support emitting module interface files{{$}}
34+
// RUN: not %target-swift-frontend -emit-silgen -emit-private-module-interface-path %t %s 2>&1 | %FileCheck -check-prefix=SILGEN_NO_PRIVATE_INTERFACE %s
35+
// SILGEN_NO_PRIVATE_INTERFACE: error: this mode does not support emitting module interface files{{$}}

0 commit comments

Comments
 (0)