diff options
author | Eli Friedman <efriedma@codeaurora.org> | 2017-12-13 00:14:17 +0000 |
---|---|---|
committer | Eli Friedman <efriedma@codeaurora.org> | 2017-12-13 00:14:17 +0000 |
commit | 93d27e381244aa4c5782ad418812f9612bb12b39 (patch) | |
tree | 9183aba44a057d5e61d91ea8bc391c043f3801c7 /lib/CodeGen/CodeGenModule.cpp | |
parent | be56d0e7af81e7eac2b1c6fcf75cc5cec0de4b23 (diff) |
[Coverage] Always emit unused coverage mappings in the same order.
Non-determinism is confusing at best.
Differential Revision: https://reviews.llvm.org/D41140
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 7f64fd062d..421a1ad3d0 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -4286,20 +4286,10 @@ void CodeGenModule::ClearUnusedCoverageMapping(const Decl *D) { } void CodeGenModule::EmitDeferredUnusedCoverageMappings() { - std::vector<const Decl *> DeferredDecls; - for (const auto &I : DeferredEmptyCoverageMappingDecls) { - if (!I.second) + for (const auto &Entry : DeferredEmptyCoverageMappingDecls) { + if (!Entry.second) continue; - DeferredDecls.push_back(I.first); - } - // Sort the declarations by their location to make sure that the tests get a - // predictable order for the coverage mapping for the unused declarations. - if (CodeGenOpts.DumpCoverageMapping) - std::sort(DeferredDecls.begin(), DeferredDecls.end(), - [] (const Decl *LHS, const Decl *RHS) { - return LHS->getLocStart() < RHS->getLocStart(); - }); - for (const auto *D : DeferredDecls) { + const Decl *D = Entry.first; switch (D->getKind()) { case Decl::CXXConversion: case Decl::CXXMethod: |