diff --git a/llvm/docs/CommandGuide/llvm-cov.rst b/llvm/docs/CommandGuide/llvm-cov.rst index 61db8f641b04..319835de168a 100644 --- a/llvm/docs/CommandGuide/llvm-cov.rst +++ b/llvm/docs/CommandGuide/llvm-cov.rst @@ -271,13 +271,6 @@ OPTIONS the file should start with `allowlist_fun:`, immediately followed by the name of the function to accept. This name can be a wildcard expression. -.. option:: -name-whitelist= - - Show code coverage only for functions listed in the given file. Each line in - the file should start with `whitelist_fun:`, immediately followed by the name - of the function to accept. This name can be a wildcard expression. This option - will be deprecated for `-name-allowlist=` in future releases. - .. option:: -name-regex= Show code coverage only for functions that match the given regular expression. diff --git a/llvm/test/tools/llvm-cov/name_whitelist.test b/llvm/test/tools/llvm-cov/name_whitelist.test deleted file mode 100644 index 3eb21e5d3328..000000000000 --- a/llvm/test/tools/llvm-cov/name_whitelist.test +++ /dev/null @@ -1,21 +0,0 @@ -RUN: llvm-profdata merge %S/Inputs/name_whitelist.proftext -o %t.profdata - -RUN: llvm-cov show %S/Inputs/name_whitelist.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S/Inputs -name-whitelist=%S/Inputs/whitelist1.txt %S/Inputs/name_whitelist.cpp > %t.one_list -RUN: FileCheck -input-file=%t.one_list -check-prefix=ONE_WHITELIST %s -RUN: FileCheck -input-file=%t.one_list -check-prefix=ONE_WHITELIST_NEG %s -ONE_WHITELIST: _Z5func1v: -ONE_WHITELIST: _Z5func2v: -ONE_WHITELIST_NEG-NOT: _Z5func3v: -ONE_WHITELIST_NEG-NOT: _Z5func4v: -ONE_WHITELIST_NEG-NOT: _Z5func5v: -ONE_WHITELIST_NEG-NOT: _Z5func6v: - -RUN: llvm-cov show %S/Inputs/name_whitelist.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S/Inputs -name-whitelist=%S/Inputs/whitelist1.txt -name-whitelist=%S/Inputs/whitelist2.txt %S/Inputs/name_whitelist.cpp > %t.two_list -RUN: FileCheck -input-file=%t.two_list -check-prefix=TWO_WHITELIST %s -RUN: FileCheck -input-file=%t.two_list -check-prefix=TWO_WHITELIST_NEG %s -TWO_WHITELIST: _Z5func1v: -TWO_WHITELIST: _Z5func2v: -TWO_WHITELIST: _Z5func3v: -TWO_WHITELIST: _Z5func4v: -TWO_WHITELIST_NEG-NOT: _Z5func5v: -TWO_WHITELIST_NEG-NOT: _Z5func6v: diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp index 13b6c3002216..c963a6052d48 100644 --- a/llvm/tools/llvm-cov/CodeCoverage.cpp +++ b/llvm/tools/llvm-cov/CodeCoverage.cpp @@ -671,13 +671,6 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { "file"), cl::cat(FilteringCategory)); - // Allow for accepting previous option name. - cl::list NameFilterFilesDeprecated( - "name-whitelist", cl::Optional, cl::Hidden, - cl::desc("Show code coverage only for functions listed in the given " - "file. Deprecated, use -name-allowlist instead"), - cl::cat(FilteringCategory)); - cl::list NameRegexFilters( "name-regex", cl::Optional, cl::desc("Show code coverage only for functions that match the given " @@ -815,16 +808,10 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { } // Read in -name-allowlist files. - if (!NameFilterFiles.empty() || !NameFilterFilesDeprecated.empty()) { + if (!NameFilterFiles.empty()) { std::string SpecialCaseListErr; - if (!NameFilterFiles.empty()) - NameAllowlist = SpecialCaseList::create( - NameFilterFiles, *vfs::getRealFileSystem(), SpecialCaseListErr); - if (!NameFilterFilesDeprecated.empty()) - NameAllowlist = SpecialCaseList::create(NameFilterFilesDeprecated, - *vfs::getRealFileSystem(), - SpecialCaseListErr); - + NameAllowlist = SpecialCaseList::create( + NameFilterFiles, *vfs::getRealFileSystem(), SpecialCaseListErr); if (!NameAllowlist) error(SpecialCaseListErr); } @@ -834,14 +821,9 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { auto NameFilterer = std::make_unique(); for (const auto &Name : NameFilters) NameFilterer->push_back(std::make_unique(Name)); - if (NameAllowlist) { - if (!NameFilterFiles.empty()) - NameFilterer->push_back( - std::make_unique(*NameAllowlist)); - if (!NameFilterFilesDeprecated.empty()) - NameFilterer->push_back( - std::make_unique(*NameAllowlist)); - } + if (NameAllowlist && !NameFilterFiles.empty()) + NameFilterer->push_back( + std::make_unique(*NameAllowlist)); for (const auto &Regex : NameRegexFilters) NameFilterer->push_back( std::make_unique(Regex)); diff --git a/llvm/tools/llvm-cov/CoverageFilters.cpp b/llvm/tools/llvm-cov/CoverageFilters.cpp index b7998647cc57..bc1ddb41087f 100644 --- a/llvm/tools/llvm-cov/CoverageFilters.cpp +++ b/llvm/tools/llvm-cov/CoverageFilters.cpp @@ -40,13 +40,6 @@ bool NameAllowlistCoverageFilter::matches( return Allowlist.inSection("llvmcov", "allowlist_fun", Function.Name); } -// TODO: remove this when -name-whitelist option is removed. -bool NameWhitelistCoverageFilter::matches( - const coverage::CoverageMapping &, - const coverage::FunctionRecord &Function) const { - return Whitelist.inSection("llvmcov", "whitelist_fun", Function.Name); -} - bool RegionCoverageFilter::matches( const coverage::CoverageMapping &CM, const coverage::FunctionRecord &Function) const { diff --git a/llvm/tools/llvm-cov/CoverageFilters.h b/llvm/tools/llvm-cov/CoverageFilters.h index 3040fe74f7cf..5345b0c87cc2 100644 --- a/llvm/tools/llvm-cov/CoverageFilters.h +++ b/llvm/tools/llvm-cov/CoverageFilters.h @@ -79,18 +79,6 @@ public: const coverage::FunctionRecord &Function) const override; }; -// TODO: Remove this class when -name-whitelist option is removed. -class NameWhitelistCoverageFilter : public CoverageFilter { - const SpecialCaseList &Whitelist; - -public: - NameWhitelistCoverageFilter(const SpecialCaseList &Whitelist) - : Whitelist(Whitelist) {} - - bool matches(const coverage::CoverageMapping &CM, - const coverage::FunctionRecord &Function) const override; -}; - /// Matches numbers that pass a certain threshold. template class StatisticThresholdFilter { public: