Skip to content

Commit 821de1f

Browse files
committed
Front-end: disable interface file locking for the -compile-module-from-interface action
The situations where we use this action, e.g. explicit module building and generating prebuilt module cache, don't need synchronization. We should avoid using lock files for them. rdar://65005528
1 parent 0e314e6 commit 821de1f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ bool ArgsToFrontendOptionsConverter::convert(
8989
Opts.RemarkOnRebuildFromModuleInterface |=
9090
Args.hasArg(OPT_Rmodule_interface_rebuild);
9191

92-
Opts.DisableInterfaceFileLock |= Args.hasArg(OPT_disable_interface_lockfile);
93-
9492
computePrintStatsOptions();
9593
computeDebugTimeOptions();
9694
computeTBDOptions();
@@ -143,6 +141,15 @@ bool ArgsToFrontendOptionsConverter::convert(
143141
Opts.RequestedAction = determineRequestedAction(Args);
144142
}
145143

144+
if (Opts.RequestedAction == FrontendOptions::ActionType::CompileModuleFromInterface) {
145+
// The situations where we use this action, e.g. explicit module building and
146+
// generating prebuilt module cache, don't need synchronization. We should avoid
147+
// using lock files for them.
148+
Opts.DisableInterfaceFileLock = true;
149+
} else {
150+
Opts.DisableInterfaceFileLock |= Args.hasArg(OPT_disable_interface_lockfile);
151+
}
152+
146153
if (Opts.RequestedAction == FrontendOptions::ActionType::Immediate &&
147154
Opts.InputsAndOutputs.hasPrimaryInputs()) {
148155
Diags.diagnose(SourceLoc(), diag::error_immediate_mode_primary_file);

0 commit comments

Comments
 (0)