Skip to content

Commit 4657e53

Browse files
committed
Add plugin dependencies just once.
1 parent ddf1983 commit 4657e53

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

lib/Frontend/Frontend.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,11 @@ void CompilerInstance::setupDependencyTrackerIfNeeded() {
386386
return;
387387

388388
DepTracker = std::make_unique<DependencyTracker>(*collectionMode);
389+
390+
// Collect compiler plugin dependencies.
391+
auto &searchPathOpts = Invocation.getSearchPathOptions();
392+
for (auto &path : searchPathOpts.getCompilerPluginLibraryPaths())
393+
DepTracker->addDependency(path, /*isSystem=*/false);
389394
}
390395

391396
bool CompilerInstance::setup(const CompilerInvocation &Invoke,

lib/Serialization/SerializedModuleLoader.cpp

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,25 +1256,18 @@ SerializedModuleLoaderBase::loadModule(SourceLoc importLoc,
12561256
M->setFailedToLoad();
12571257
}
12581258

1259-
if (dependencyTracker) {
1260-
if (file) {
1261-
auto DepPath = file->getFilename();
1262-
// Don't record cached artifacts as dependencies.
1263-
if (!isCached(DepPath)) {
1264-
if (M->hasIncrementalInfo()) {
1265-
dependencyTracker->addIncrementalDependency(DepPath,
1266-
M->getFingerprint());
1267-
} else {
1268-
dependencyTracker->addDependency(DepPath, /*isSystem=*/false);
1269-
}
1259+
if (dependencyTracker && file) {
1260+
auto DepPath = file->getFilename();
1261+
// Don't record cached artifacts as dependencies.
1262+
if (!isCached(DepPath)) {
1263+
if (M->hasIncrementalInfo()) {
1264+
dependencyTracker->addIncrementalDependency(DepPath,
1265+
M->getFingerprint());
1266+
} else {
1267+
dependencyTracker->addDependency(DepPath, /*isSystem=*/false);
12701268
}
12711269
}
1272-
// Collect compiler plugin dependencies.
1273-
for (auto &path : Ctx.SearchPathOpts.getCompilerPluginLibraryPaths()) {
1274-
dependencyTracker->addDependency(path, /*isSystem=*/false);
1275-
}
12761270
}
1277-
12781271
return M;
12791272
}
12801273

0 commit comments

Comments
 (0)