Skip to content

Commit bd05aa7

Browse files
committed
---
yaml --- r: 317279 b: refs/heads/master-rebranch c: cb56d35 h: refs/heads/master i: 317277: d896220 317275: 0e4d838 317271: baf7dd3 317263: 17e95cf 317247: 3c49a28
1 parent 36fa7b9 commit bd05aa7

File tree

6 files changed

+36
-14
lines changed

6 files changed

+36
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,4 +1457,4 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14571457
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14581458
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14591459
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1460-
refs/heads/master-rebranch: 680442ad9ba10f9fd167c25eac49c31c1bd66c64
1460+
refs/heads/master-rebranch: cb56d358efb3dc4ade2812bffbb6c6661650ed7e

branches/master-rebranch/include/swift/Option/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def module_name_EQ : Joined<["-"], "module-name=">, Flags<[FrontendOption]>,
284284
Alias<module_name>;
285285

286286
def module_link_name : Separate<["-"], "module-link-name">,
287-
Flags<[FrontendOption]>,
287+
Flags<[FrontendOption, ParseableInterfaceOption]>,
288288
HelpText<"Library to link against when using this module">;
289289
def module_link_name_EQ : Joined<["-"], "module-link-name=">,
290290
Flags<[FrontendOption]>, Alias<module_link_name>;

branches/master-rebranch/lib/Frontend/ArgsToFrontendOutputsConverter.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -507,14 +507,16 @@ createFromTypeToPathMap(const TypeToPathMap *map) {
507507

508508
Optional<std::vector<SupplementaryOutputPaths>>
509509
SupplementaryOutputPathsComputer::readSupplementaryOutputFileMap() const {
510-
if (Arg *A = Args.getLastArg(options::OPT_emit_objc_header_path,
511-
options::OPT_emit_module_path,
512-
options::OPT_emit_module_doc_path,
513-
options::OPT_emit_dependencies_path,
514-
options::OPT_emit_reference_dependencies_path,
515-
options::OPT_serialize_diagnostics_path,
516-
options::OPT_emit_loaded_module_trace_path,
517-
options::OPT_emit_tbd_path)) {
510+
if (Arg *A = Args.getLastArg(
511+
options::OPT_emit_objc_header_path,
512+
options::OPT_emit_module_path,
513+
options::OPT_emit_module_doc_path,
514+
options::OPT_emit_dependencies_path,
515+
options::OPT_emit_reference_dependencies_path,
516+
options::OPT_serialize_diagnostics_path,
517+
options::OPT_emit_loaded_module_trace_path,
518+
options::OPT_emit_parseable_module_interface_path,
519+
options::OPT_emit_tbd_path)) {
518520
Diags.diagnose(SourceLoc(),
519521
diag::error_cannot_have_supplementary_outputs,
520522
A->getSpelling(), "-supplementary-output-file-map");

branches/master-rebranch/lib/Frontend/CompilerInvocation.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ static void PrintArg(raw_ostream &OS, const char *Arg, StringRef TempDir) {
159159
/// Save a copy of any flags marked as ParseableInterfaceOption, if running
160160
/// in a mode that is going to emit a .swiftinterface file.
161161
static void SaveParseableInterfaceArgs(ParseableInterfaceOptions &Opts,
162+
FrontendOptions &FOpts,
162163
ArgList &Args, DiagnosticEngine &Diags) {
163-
if (!Args.hasArg(options::OPT_emit_interface_path) &&
164-
!Args.hasArg(options::OPT_emit_parseable_module_interface_path))
164+
if (!FOpts.InputsAndOutputs.hasParseableInterfaceOutputPath())
165165
return;
166166
ArgStringList RenderedArgs;
167167
for (auto A : Args) {
@@ -1188,13 +1188,14 @@ bool CompilerInvocation::parseArgs(
11881188
return true;
11891189
}
11901190

1191-
SaveParseableInterfaceArgs(ParseableInterfaceOpts, ParsedArgs, Diags);
1192-
11931191
if (ParseFrontendArgs(FrontendOpts, ParsedArgs, Diags,
11941192
ConfigurationFileBuffers)) {
11951193
return true;
11961194
}
11971195

1196+
SaveParseableInterfaceArgs(ParseableInterfaceOpts, FrontendOpts,
1197+
ParsedArgs, Diags);
1198+
11981199
if (ParseLangArgs(LangOpts, ParsedArgs, Diags, FrontendOpts)) {
11991200
return true;
12001201
}

branches/master-rebranch/test/Driver/emit-interface.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@
1919
// CHECK-EXPLICIT-PATH: swift -frontend
2020
// CHECK-EXPLICIT-PATH-SAME: emit-interface.swift
2121
// CHECK-EXPLICIT-PATH-SAME: -emit-parseable-module-interface-path {{.+}}/unrelated.swiftinterface
22+
23+
// Ensure that we emit arguments when we force filelists as well
24+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-parseable-module-interface -o %t/foo -module-name foo -force-single-frontend-invocation -driver-filelist-threshold=0 2>&1 | %FileCheck -check-prefix=CHECK-FILELIST %s
25+
26+
// CHECK-FILELIST: swift -frontend
27+
// CHECK-FILELIST-SAME: -supplementary-output-file-map
28+
// CHECK-FILELIST-NOT: emit-interface.swift{{ }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
// RUN: %empty-directory(%t)
2+
13
// RUN: %target-swift-frontend -enable-resilience -emit-parseable-module-interface-path %t.swiftinterface -module-name t %s -emit-module -o /dev/null
24
// RUN: %FileCheck %s < %t.swiftinterface -check-prefix=CHECK-SWIFTINTERFACE
35
//
46
// CHECK-SWIFTINTERFACE: {{swift-module-flags:.* -enable-resilience}}
57

8+
// Make sure flags show up when filelists are enabled
9+
10+
// RUN: %target-build-swift %s -driver-filelist-threshold=0 -emit-parseable-module-interface -o %t/foo -module-name foo -module-link-name fooCore -force-single-frontend-invocation 2>&1
11+
// RUN: %FileCheck %s < %t/foo.swiftinterface --check-prefix CHECK-FILELIST-INTERFACE
12+
13+
// CHECK-FILELIST-INTERFACE: swift-module-flags:
14+
// CHECK-FILELIST-INTERFACE-SAME: -target
15+
// CHECK-FILELIST-INTERFACE-SAME: -module-link-name fooCore
16+
// CHECK-FILELIST-INTERFACE-SAME: -module-name foo
17+
618
public func foo() { }

0 commit comments

Comments
 (0)