[llvm-cov] Create directory structure when filtering using -name*= options
Before this change using any of the -name*= command line options with an output
directory would result in a single file (functions.txt/functions.html)
containing the coverage for those specific functions. Now you get the same
directory structure as when not using any -name*= options.
Differential Revision: https://reviews.llvm.org/D38280
llvm-svn: 314396
diff --git a/llvm/tools/llvm-cov/CoverageReport.h b/llvm/tools/llvm-cov/CoverageReport.h
index 242dc7f..d78f2e4 100644
--- a/llvm/tools/llvm-cov/CoverageReport.h
+++ b/llvm/tools/llvm-cov/CoverageReport.h
@@ -14,6 +14,7 @@
#ifndef LLVM_COV_COVERAGEREPORT_H
#define LLVM_COV_COVERAGEREPORT_H
+#include "CoverageFilters.h"
#include "CoverageSummaryInfo.h"
#include "CoverageViewOptions.h"
@@ -40,13 +41,16 @@
static std::vector<FileCoverageSummary>
prepareFileReports(const coverage::CoverageMapping &Coverage,
FileCoverageSummary &Totals, ArrayRef<std::string> Files,
- const CoverageViewOptions &Options);
+ const CoverageViewOptions &Options,
+ const CoverageFilter &Filters = CoverageFiltersMatchAll());
/// Render file reports for every unique file in the coverage mapping.
void renderFileReports(raw_ostream &OS) const;
- /// Render file reports for the files specified in \p Files.
- void renderFileReports(raw_ostream &OS, ArrayRef<std::string> Files) const;
+ /// Render file reports for the files specified in \p Files and the functions
+ /// in \p Filters.
+ void renderFileReports(raw_ostream &OS, ArrayRef<std::string> Files,
+ const CoverageFilter &Filters) const;
};
} // end namespace llvm