From 6171c4105b582d13fb0723b179ea97f17e80ee42 Mon Sep 17 00:00:00 2001 From: David Ungar Date: Tue, 14 Jul 2020 15:09:04 -0700 Subject: [PATCH] Remove bogus assertion with explanation. --- lib/Driver/Compilation.cpp | 5 +---- lib/Driver/FineGrainedDependencyDriverGraph.cpp | 2 ++ .../Driver/TypeBodyFingerprintsDependencyGraphTests.cpp | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp index b4829ab4b402b..cf53235560519 100644 --- a/lib/Driver/Compilation.cpp +++ b/lib/Driver/Compilation.cpp @@ -2060,10 +2060,7 @@ void Compilation::sortJobsToMatchCompilationInputs( if (const CompileJobAction *CJA = dyn_cast(&J->getSource())) { const InputAction *IA = CJA->findSingleSwiftInput(); - auto R = - jobsByInput.insert(std::make_pair(IA->getInputArg().getValue(), J)); - assert(R.second); - (void)R; + jobsByInput.insert(std::make_pair(IA->getInputArg().getValue(), J)); } else sortedJobs.push_back(J); } diff --git a/lib/Driver/FineGrainedDependencyDriverGraph.cpp b/lib/Driver/FineGrainedDependencyDriverGraph.cpp index bc1cda3e359f7..8725924d68b27 100644 --- a/lib/Driver/FineGrainedDependencyDriverGraph.cpp +++ b/lib/Driver/FineGrainedDependencyDriverGraph.cpp @@ -196,6 +196,8 @@ std::vector ModuleDepGraph::getExternalDependencies() const { } // Add every (swiftdeps) use of the external dependency to foundJobs. +// Can return duplicates, but it doesn't break anything, and they will be +// canonicalized later. std::vector ModuleDepGraph::findExternallyDependentUntracedJobs( StringRef externalDependency) { FrontendStatsTracer tracer( diff --git a/unittests/Driver/TypeBodyFingerprintsDependencyGraphTests.cpp b/unittests/Driver/TypeBodyFingerprintsDependencyGraphTests.cpp index c47007edc4297..9e572b0c5fca4 100644 --- a/unittests/Driver/TypeBodyFingerprintsDependencyGraphTests.cpp +++ b/unittests/Driver/TypeBodyFingerprintsDependencyGraphTests.cpp @@ -13,6 +13,8 @@ // would be excluded in the coarse-grained graph. But since these will be jobs // that have already been scheduled, downstream mechanisms will filter them out. +// \c \c findExternallyDependentUntracedJobs may also return duplicates + // To debug a test, create the \c ModuleDepGraph and pass true as the second // argument to the constructor, then find the dot files in the directory // where the tests run,