Skip to content

Commit 5778864

Browse files
committed
[Frontend] Emit incr compilation info from emit-module jobs
Enable emitting the module-level incremental fine-grained compilation information from the emit-module job for incremental compilation to work with emit-module-separately.
1 parent d75b34b commit 5778864

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,9 +1494,19 @@ static bool performCompileStepsPostSILGen(CompilerInstance &Instance,
14941494
SerializationOptions serializationOpts =
14951495
Invocation.computeSerializationOptions(outs, Instance.getMainModule());
14961496

1497+
// Infer if this is an emit-module job part of an incremental build,
1498+
// vs a partial emit-module job (with primary files) or other kinds.
1499+
// We may want to rely on a flag instead to differentiate them.
1500+
const bool isEmitModuleSeparately =
1501+
Action == FrontendOptions::ActionType::EmitModuleOnly &&
1502+
MSF.is<ModuleDecl *>() &&
1503+
Instance.getInvocation()
1504+
.getTypeCheckerOptions()
1505+
.SkipFunctionBodies == FunctionBodySkipping::NonInlinableWithoutTypes;
14971506
const bool canEmitIncrementalInfoIntoModule =
14981507
!serializationOpts.DisableCrossModuleIncrementalInfo &&
1499-
(Action == FrontendOptions::ActionType::MergeModules);
1508+
(Action == FrontendOptions::ActionType::MergeModules ||
1509+
isEmitModuleSeparately);
15001510
if (canEmitIncrementalInfoIntoModule) {
15011511
const auto alsoEmitDotFile =
15021512
Instance.getInvocation()

0 commit comments

Comments
 (0)