mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Frontend] Emit tbd as an extra output, not a frontend action.
This means it can be emitted during an -emit-module frontend job, which is the most common place it will be used, so reusing work like this is important for performance. For now, this has to happen as part of a single frontend invocation, i.e. -wmo or -force-single-frontend-invocation.
This commit is contained in:
@@ -742,12 +742,12 @@ static bool performCompile(CompilerInstance &Instance,
|
||||
return Context.hadError();
|
||||
}
|
||||
|
||||
if (Action == FrontendOptions::EmitTBD) {
|
||||
if (!opts.TBDPath.empty()) {
|
||||
const auto &silOpts = Invocation.getSILOptions();
|
||||
auto hasMultipleIRGenThreads = silOpts.NumThreads > 1;
|
||||
return writeTBD(Instance.getMainModule(), hasMultipleIRGenThreads,
|
||||
silOpts.SILSerializeWitnessTables,
|
||||
opts.getSingleOutputFilename());
|
||||
if (writeTBD(Instance.getMainModule(), hasMultipleIRGenThreads,
|
||||
silOpts.SILSerializeWitnessTables, opts.TBDPath))
|
||||
return true;
|
||||
}
|
||||
|
||||
assert(Action >= FrontendOptions::EmitSILGen &&
|
||||
|
||||
Reference in New Issue
Block a user