[PATCH] D37111: [llvm-cov] Read in function names for filtering from a text file.

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 10:39:37 PDT 2017


vsk added inline comments.


================
Comment at: tools/llvm-cov/CodeCoverage.cpp:656
+    // Read in -name-whitelist files.
+    for (const auto &NameFile : NameFilterFiles) {
+      auto BufOrError = MemoryBuffer::getFile(NameFile);
----------------
seaneveson wrote:
> vsk wrote:
> > In the future, we might benefit from the flexibility offered by llvm::SpecialCaseList. Could you use that to parse the whitelist?
> Thanks for the review!
> 
> Having to specify a section for each item seems redundant for an option that only filters on function names, e.g.
> 
> ```
> fun:foo
> fun:bar
> ```
> 
> Are you considering having a more general `-whitelist` rather than a `-name-whitelist`? Otherwise I'm not sure what other sections there would be. The wildcard handling would be useful though.
I agree that it's a little redundant, but think that it shouldn't be too onerous. E.g the section names can be added in by a quick shell one-liner. The potential benefit is that you can have one file for {white, black}listing {functions, files, directories}. To that end, I suggest using more specific section names like "whitelist_fun:".


https://reviews.llvm.org/D37111





More information about the llvm-commits mailing list