Allow users of the GCOV API to extend the FileInfo class to implement custom output...
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Thu, 26 Jul 2018 09:21:56 +0000 (09:21 +0000)
committerMarco Castelluccio <mcastelluccio@mozilla.com>
Thu, 26 Jul 2018 09:21:56 +0000 (09:21 +0000)
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

index d9ab39e..8500401 100644 (file)
@@ -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<raw_ostream> openCoveragePath(StringRef CoveragePath);
   void printFunctionSummary(raw_ostream &OS, const FunctionVector &Funcs) const;