[llvm-cov] Emit a summary in the report directory's index
llvm-cov writes out an index file in '-output-dir' mode, albeit not a
very informative one. Try to fix that by using the CoverageReport API to
include some basic summary information in the index file.
llvm-svn: 281011
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewHTML.h b/llvm/tools/llvm-cov/SourceCoverageViewHTML.h
index edbe7c4..bcf2793 100644
--- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.h
+++ b/llvm/tools/llvm-cov/SourceCoverageViewHTML.h
@@ -18,6 +18,8 @@
namespace llvm {
+struct FileCoverageSummary;
+
/// \brief A coverage printer for html output.
class CoveragePrinterHTML : public CoveragePrinter {
public:
@@ -26,10 +28,16 @@
void closeViewFile(OwnedStream OS) override;
- Error createIndexFile(ArrayRef<StringRef> SourceFiles) override;
+ Error createIndexFile(ArrayRef<StringRef> SourceFiles,
+ const coverage::CoverageMapping &Coverage) override;
CoveragePrinterHTML(const CoverageViewOptions &Opts)
: CoveragePrinter(Opts) {}
+
+private:
+ void emitFileSummary(raw_ostream &OS, StringRef SF,
+ const FileCoverageSummary &FCS,
+ bool IsTotals = false) const;
};
/// \brief A code coverage view which supports html-based rendering.