This revision was automatically updated to reflect the committed changes. Closed by commit rL320533: [Coverage] Always emit unused coverage mappings in the same order. (authored by efriedma, committed by ).
Changed prior to commit: https://reviews.llvm.org/D41140?vs=126640&id=126644#toc Repository: rL LLVM https://reviews.llvm.org/D41140 Files: cfe/trunk/lib/CodeGen/CodeGenModule.cpp cfe/trunk/lib/CodeGen/CodeGenModule.h Index: cfe/trunk/lib/CodeGen/CodeGenModule.cpp =================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp @@ -4286,20 +4286,10 @@ } 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: Index: cfe/trunk/lib/CodeGen/CodeGenModule.h =================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.h +++ cfe/trunk/lib/CodeGen/CodeGenModule.h @@ -490,7 +490,7 @@ /// @} - llvm::DenseMap<const Decl *, bool> DeferredEmptyCoverageMappingDecls; + llvm::MapVector<const Decl *, bool> DeferredEmptyCoverageMappingDecls; std::unique_ptr<CoverageMappingModuleGen> CoverageMapping;
Index: cfe/trunk/lib/CodeGen/CodeGenModule.cpp =================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp @@ -4286,20 +4286,10 @@ } 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: Index: cfe/trunk/lib/CodeGen/CodeGenModule.h =================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.h +++ cfe/trunk/lib/CodeGen/CodeGenModule.h @@ -490,7 +490,7 @@ /// @} - llvm::DenseMap<const Decl *, bool> DeferredEmptyCoverageMappingDecls; + llvm::MapVector<const Decl *, bool> DeferredEmptyCoverageMappingDecls; std::unique_ptr<CoverageMappingModuleGen> CoverageMapping;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits