mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix per-file supplementary outputs in multi-threaded WMO mode
In multi-threaded WMO builds, the frontend didn't properly handle per-file supplementary outputs specified via output file maps or command-line arguments. This enables swift-driver to use -supplementary-output-file-map for per-file outputs in multi-threaded WMO, instead of generating multiple individual flags that the frontend rejects.
This commit is contained in:
@@ -3231,8 +3231,12 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
if (const Arg *A = Args.getLastArg(OPT_save_optimization_record_passes))
|
||||
Opts.OptRecordPasses = A->getValue();
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_save_optimization_record_path))
|
||||
Opts.OptRecordFile = A->getValue();
|
||||
// Only use getLastArg for single -save-optimization-record-path.
|
||||
// With multiple paths (multi-threaded WMO), FrontendTool will populate
|
||||
// OptRecordFile and AuxOptRecordFiles from command-line arguments.
|
||||
auto allOptRecordPaths = Args.getAllArgValues(OPT_save_optimization_record_path);
|
||||
if (allOptRecordPaths.size() == 1)
|
||||
Opts.OptRecordFile = allOptRecordPaths[0];
|
||||
|
||||
// If any of the '-g<kind>', except '-gnone', is given,
|
||||
// tell the SILPrinter to print debug info as well
|
||||
|
||||
Reference in New Issue
Block a user