mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Let the frontend options handle multiple output files.
This will be needed for split-llvm code generation. If multiple -o options are specified and only a single output file is needed (currently always), the last one wins. This is NFC. Swift SVN r25884
This commit is contained in:
@@ -67,16 +67,17 @@ bool FrontendOptions::actionIsImmediate() const {
|
||||
|
||||
void FrontendOptions::forAllOutputPaths(
|
||||
std::function<void(const std::string &)> fn) const {
|
||||
if (RequestedAction != FrontendOptions::EmitModuleOnly) {
|
||||
for (const std::string &OutputFileName : OutputFilenames) {
|
||||
fn(OutputFileName);
|
||||
}
|
||||
}
|
||||
const std::string *outputs[] = {
|
||||
&OutputFilename,
|
||||
&ModuleOutputPath,
|
||||
&ModuleDocOutputPath,
|
||||
&ObjCHeaderOutputPath
|
||||
};
|
||||
for (const std::string *next : outputs) {
|
||||
if (RequestedAction == FrontendOptions::EmitModuleOnly &&
|
||||
next == &OutputFilename)
|
||||
continue;
|
||||
if (!next->empty())
|
||||
fn(*next);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user