Frontend: Add a new -sil-merge-partial-modules flag

Previously we would drop all serialized SIL from partial swiftmodule
files generated while compiling source in non-WMO mode; all that was
missing was linking it in.

This adds a frontend flag, and a test; driver change is coming up
next.

Progress on <rdar://problem/18913977>.
This commit is contained in:
Slava Pestov
2017-03-31 20:24:58 -07:00
parent 9c7b0d8aa2
commit 00d5b45733
9 changed files with 120 additions and 0 deletions

View File

@@ -1218,6 +1218,9 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
llvm_unreachable("Unknown SIL linking option!");
}
if (Args.hasArg(OPT_sil_merge_partial_modules))
Opts.MergePartialModules = true;
// Parse the optimization level.
if (const Arg *A = Args.getLastArg(OPT_O_Group)) {
if (A->getOption().matches(OPT_Onone)) {