From 65b1f6fe0acea882cbfbb1992dc8a5b4b301d27e 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338013 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ProfileData/GCOV.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/llvm/ProfileData/GCOV.h b/include/llvm/ProfileData/GCOV.h index d9ab39e3946..8500401e44a 100644 --- a/include/llvm/ProfileData/GCOV.h +++ b/include/llvm/ProfileData/GCOV.h @@ -376,6 +376,7 @@ private: }; 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 @@ public: 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; -- 2.50.1