Skip to content

Commit 9c63218

Browse files
authored
Merge pull request #34048 from CodaFi/a-record-breaking-finish
Remove ~moduleonly Duplicate of Compilation Record
2 parents 9805f2b + 14188f4 commit 9c63218

File tree

8 files changed

+1
-218
lines changed

8 files changed

+1
-218
lines changed

include/swift/Driver/Compilation.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,6 @@ class Compilation {
206206
/// of date.
207207
bool EnableIncrementalBuild;
208208

209-
/// When true, emit duplicated compilation record file whose filename is
210-
/// suffixed with '~moduleonly'.
211-
///
212-
/// This compilation record is used by '-emit-module'-only incremental builds
213-
/// so that module-only builds do not affect compilation record file for
214-
/// normal builds, while module-only incremental builds are able to use
215-
/// artifacts of normal builds if they are already up to date.
216-
bool OutputCompilationRecordForModuleOnlyBuild = false;
217-
218209
/// Indicates whether groups of parallel frontend jobs should be merged
219210
/// together and run in composite "batch jobs" when possible, to reduce
220211
/// redundant work.
@@ -313,7 +304,6 @@ class Compilation {
313304
std::unique_ptr<llvm::opt::DerivedArgList> TranslatedArgs,
314305
InputFileList InputsWithTypes,
315306
std::string CompilationRecordPath,
316-
bool OutputCompilationRecordForModuleOnlyBuild,
317307
StringRef ArgsHash, llvm::sys::TimePoint<> StartTime,
318308
llvm::sys::TimePoint<> LastBuildTime,
319309
size_t FilelistThreshold,

lib/Driver/Compilation.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ Compilation::Compilation(DiagnosticEngine &Diags,
108108
std::unique_ptr<DerivedArgList> TranslatedArgs,
109109
InputFileList InputsWithTypes,
110110
std::string CompilationRecordPath,
111-
bool OutputCompilationRecordForModuleOnlyBuild,
112111
StringRef ArgsHash,
113112
llvm::sys::TimePoint<> StartTime,
114113
llvm::sys::TimePoint<> LastBuildTime,
@@ -140,8 +139,6 @@ Compilation::Compilation(DiagnosticEngine &Diags,
140139
BuildStartTime(StartTime),
141140
LastBuildTime(LastBuildTime),
142141
EnableIncrementalBuild(EnableIncrementalBuild),
143-
OutputCompilationRecordForModuleOnlyBuild(
144-
OutputCompilationRecordForModuleOnlyBuild),
145142
EnableBatchMode(EnableBatchMode),
146143
BatchSeed(BatchSeed),
147144
BatchCount(BatchCount),
@@ -1815,12 +1812,6 @@ int Compilation::performJobsImpl(bool &abnormalExit,
18151812
checkForOutOfDateInputs(Diags, InputInfo);
18161813
writeCompilationRecord(CompilationRecordPath, ArgsHash, BuildStartTime,
18171814
InputInfo);
1818-
1819-
if (OutputCompilationRecordForModuleOnlyBuild) {
1820-
// TODO: Optimize with clonefile(2) ?
1821-
llvm::sys::fs::copy_file(CompilationRecordPath,
1822-
CompilationRecordPath + "~moduleonly");
1823-
}
18241815
}
18251816
abnormalExit = State.hadAnyAbnormalExit();
18261817
return State.getResult();

lib/Driver/Driver.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,7 @@ class Driver::InputInfoMap
404404
using InputInfoMap = Driver::InputInfoMap;
405405

406406
/// Get the filename for build record. Returns true if failed.
407-
/// Additionally, set 'outputBuildRecordForModuleOnlyBuild' to true if this is
408-
/// full compilation with swiftmodule.
409407
static bool getCompilationRecordPath(std::string &buildRecordPath,
410-
bool &outputBuildRecordForModuleOnlyBuild,
411408
const OutputInfo &OI,
412409
const Optional<OutputFileMap> &OFM,
413410
DiagnosticEngine *Diags) {
@@ -430,17 +427,6 @@ static bool getCompilationRecordPath(std::string &buildRecordPath,
430427
return true;
431428
}
432429

433-
// In 'emit-module' only mode, use build-record filename suffixed with
434-
// '~moduleonly'. So that module-only mode doesn't mess up build-record
435-
// file for full compilation.
436-
if (OI.CompilerOutputType == file_types::TY_SwiftModuleFile) {
437-
buildRecordPath = buildRecordPath.append("~moduleonly");
438-
} else if (OI.ShouldTreatModuleAsTopLevelOutput) {
439-
// If we emit module along with full compilation, emit build record
440-
// file for '-emit-module' only mode as well.
441-
outputBuildRecordForModuleOnlyBuild = true;
442-
}
443-
444430
return false;
445431
}
446432

@@ -960,8 +946,7 @@ Driver::buildCompilation(const ToolChain &TC,
960946
computeIncremental(ArgList.get(), ShowIncrementalBuildDecisions);
961947

962948
std::string buildRecordPath;
963-
bool outputBuildRecordForModuleOnlyBuild = false;
964-
getCompilationRecordPath(buildRecordPath, outputBuildRecordForModuleOnlyBuild,
949+
getCompilationRecordPath(buildRecordPath,
965950
OI, OFM, Incremental ? &Diags : nullptr);
966951

967952
SmallString<32> ArgsHash;
@@ -1050,7 +1035,6 @@ Driver::buildCompilation(const ToolChain &TC,
10501035
std::move(TranslatedArgList),
10511036
std::move(Inputs),
10521037
buildRecordPath,
1053-
outputBuildRecordForModuleOnlyBuild,
10541038
ArgsHash,
10551039
StartTime,
10561040
LastBuildTime,

test/Driver/Dependencies/Inputs/moduleonly/bar.swift

Lines changed: 0 additions & 28 deletions
This file was deleted.

test/Driver/Dependencies/Inputs/moduleonly/baz.swift

Lines changed: 0 additions & 20 deletions
This file was deleted.

test/Driver/Dependencies/Inputs/moduleonly/foo.swift

Lines changed: 0 additions & 28 deletions
This file was deleted.

test/Driver/Dependencies/Inputs/moduleonly/output.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

test/Driver/Dependencies/moduleonly.swift

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)