Skip to content

Commit 9c6ab5b

Browse files
authored
Merge pull request #17937 from CodaFi/heading-for-disaster
2 parents 751ffa4 + 2ee7e7c commit 9c6ab5b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/Frontend/FrontendOptions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ bool FrontendOptions::canActionEmitReferenceDependencies(ActionType action) {
251251
bool FrontendOptions::canActionEmitObjCHeader(ActionType action) {
252252
switch (action) {
253253
case ActionType::NoneAction:
254+
case ActionType::Parse:
255+
case ActionType::ResolveImports:
254256
case ActionType::DumpParse:
255257
case ActionType::DumpInterfaceHash:
256258
case ActionType::DumpAST:
@@ -262,8 +264,6 @@ bool FrontendOptions::canActionEmitObjCHeader(ActionType action) {
262264
case ActionType::Immediate:
263265
case ActionType::REPL:
264266
return false;
265-
case ActionType::Parse:
266-
case ActionType::ResolveImports:
267267
case ActionType::Typecheck:
268268
case ActionType::MergeModules:
269269
case ActionType::EmitModuleOnly:

test/Driver/options.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
// RUN: not %target-swift-frontend -resolve-imports -emit-reference-dependencies %s 2>&1 | %FileCheck -check-prefix=RESOLVE_IMPORTS_NO_REFERENCE_DEPS %s
4040
// RESOLVE_IMPORTS_NO_REFERENCE_DEPS: error: this mode does not support emitting reference dependency files{{$}}
4141

42+
// RUN: not %target-swift-frontend -parse -emit-objc-header %s 2>&1 | %FileCheck -check-prefix=PARSE_NO_OBJC_HEADER %s
43+
// PARSE_NO_OBJC_HEADER: error: this mode does not support emitting Objective-C headers{{$}}
44+
// RUN: not %target-swift-frontend -dump-ast -emit-objc-header %s 2>&1 | %FileCheck -check-prefix=DUMP_NO_OBJC_HEADER %s
45+
// DUMP_NO_OBJC_HEADER: error: this mode does not support emitting Objective-C headers{{$}}
46+
// RUN: not %target-swift-frontend -resolve-imports -emit-objc-header %s 2>&1 | %FileCheck -check-prefix=RESOLVE_IMPORTS_NO_OBJC_HEADER %s
47+
// RESOLVE_IMPORTS_NO_OBJC_HEADER: error: this mode does not support emitting Objective-C headers{{$}}
48+
4249
// Should not fail with non-zero exit code.
4350
// RUN: %target-swift-frontend -emit-silgen %S/Inputs/invalid-module-name.swift > /dev/null
4451
// RUN: %target-swift-frontend -emit-silgen -parse-as-library %S/Inputs/invalid-module-name.swift -module-name foo > /dev/null

0 commit comments

Comments
 (0)