diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp index 7098b51ce7d..8afae2294eb 100644 --- a/tools/llvm-cov/CodeCoverage.cpp +++ b/tools/llvm-cov/CodeCoverage.cpp @@ -612,19 +612,19 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { // Create the function filters if (!NameFilters.empty() || !NameRegexFilters.empty()) { - auto NameFilterer = new CoverageFilters; + auto NameFilterer = llvm::make_unique(); for (const auto &Name : NameFilters) NameFilterer->push_back(llvm::make_unique(Name)); for (const auto &Regex : NameRegexFilters) NameFilterer->push_back( llvm::make_unique(Regex)); - Filters.push_back(std::unique_ptr(NameFilterer)); + Filters.push_back(std::move(NameFilterer)); } if (RegionCoverageLtFilter.getNumOccurrences() || RegionCoverageGtFilter.getNumOccurrences() || LineCoverageLtFilter.getNumOccurrences() || LineCoverageGtFilter.getNumOccurrences()) { - auto StatFilterer = new CoverageFilters; + auto StatFilterer = llvm::make_unique(); if (RegionCoverageLtFilter.getNumOccurrences()) StatFilterer->push_back(llvm::make_unique( RegionCoverageFilter::LessThan, RegionCoverageLtFilter)); @@ -637,7 +637,7 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { if (LineCoverageGtFilter.getNumOccurrences()) StatFilterer->push_back(llvm::make_unique( RegionCoverageFilter::GreaterThan, LineCoverageGtFilter)); - Filters.push_back(std::unique_ptr(StatFilterer)); + Filters.push_back(std::move(StatFilterer)); } if (!Arches.empty()) {