From 89f1a8c9318622b2b002287bb9f641da1cacb07f Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 26 Jul 2018 09:21:56 +0000 Subject: [PATCH] Allow users of the GCOV API to extend the FileInfo class to implement custom output formats Summary: The GCOV API can be used to parse gcda/gcno files, but in order to implement custom output formats, users need to reimplement everything. If the FileInfo members were protected instead of private, they'd be able to reuse the code. Reviewers: bogner, davide, scott.smith Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41802 llvm-svn: 338013 --- llvm/include/llvm/ProfileData/GCOV.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/ProfileData/GCOV.h b/llvm/include/llvm/ProfileData/GCOV.h index d9ab39e3946e9..8500401e44ad5 100644 --- a/llvm/include/llvm/ProfileData/GCOV.h +++ b/llvm/include/llvm/ProfileData/GCOV.h @@ -376,6 +376,7 @@ class GCOVBlock { }; class FileInfo { +protected: // It is unlikely--but possible--for multiple functions to be on the same // line. // Therefore this typedef allows LineData.Functions to store multiple @@ -428,7 +429,7 @@ class FileInfo { void print(raw_ostream &OS, StringRef MainFilename, StringRef GCNOFile, StringRef GCDAFile); -private: +protected: std::string getCoveragePath(StringRef Filename, StringRef MainFilename); std::unique_ptr openCoveragePath(StringRef CoveragePath); void printFunctionSummary(raw_ostream &OS, const FunctionVector &Funcs) const;