summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/CoverageExporterJson.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-cov/CoverageExporterJson.cpp')
-rw-r--r--llvm/tools/llvm-cov/CoverageExporterJson.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/tools/llvm-cov/CoverageExporterJson.cpp b/llvm/tools/llvm-cov/CoverageExporterJson.cpp
index 3621f9ab97f..fc631ac6d83 100644
--- a/llvm/tools/llvm-cov/CoverageExporterJson.cpp
+++ b/llvm/tools/llvm-cov/CoverageExporterJson.cpp
@@ -117,10 +117,13 @@ void CoverageExporterJson::emitArrayEnd() {
OS << "]";
}
-void CoverageExporterJson::renderRoot() {
+void CoverageExporterJson::renderRoot(
+ const CoverageFilters &IgnoreFilenameFilters) {
std::vector<std::string> SourceFiles;
- for (StringRef SF : Coverage.getUniqueSourceFiles())
- SourceFiles.emplace_back(SF);
+ for (StringRef SF : Coverage.getUniqueSourceFiles()) {
+ if (!IgnoreFilenameFilters.matchesFilename(SF))
+ SourceFiles.emplace_back(SF);
+ }
renderRoot(SourceFiles);
}
@@ -218,11 +221,11 @@ void CoverageExporterJson::renderFiles(
void CoverageExporterJson::renderFile(const std::string &Filename,
const FileCoverageSummary &FileReport) {
- // Start File.
+ // Start File.
emitDictStart();
emitDictElement("filename", Filename);
-
+
if (!Options.ExportSummaryOnly) {
// Calculate and render detailed coverage information for given file.
auto FileCoverage = Coverage.getCoverageForFile(Filename);
OpenPOWER on IntegriCloud