Fix for emit_reference_dependencies_without_primary_file warning required after changes to introduce multiple primary files to CompilerInstance.

Revealed by test Frontend/dependencies.swift.
This commit is contained in:
David Ungar
2017-12-22 14:03:11 -08:00
parent 42c4a4d452
commit 4a0a7f2e82
2 changed files with 4 additions and 5 deletions

View File

@@ -734,6 +734,9 @@ static bool performCompile(CompilerInstance &Instance,
opts);
if (shouldTrackReferences) {
if (Instance.getPrimarySourceFiles().empty())
Context.Diags.diagnose(
SourceLoc(), diag::emit_reference_dependencies_without_primary_file);
for (auto *SF : Instance.getPrimarySourceFiles()) {
emitReferenceDependencies(Context.Diags, SF,
*Instance.getDependencyTracker(), opts);