[llvm] r338013 - Allow users of the GCOV API to extend the FileInfo class to implement custom output formats

Marco Castelluccio via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 02:21:56 PDT 2018


Author: marco
Date: Thu Jul 26 02:21:56 2018
New Revision: 338013

URL: http://llvm.org/viewvc/llvm-project?rev=338013&view=rev
Log:
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

Modified:
    llvm/trunk/include/llvm/ProfileData/GCOV.h

Modified: llvm/trunk/include/llvm/ProfileData/GCOV.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/GCOV.h?rev=338013&r1=338012&r2=338013&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/GCOV.h (original)
+++ llvm/trunk/include/llvm/ProfileData/GCOV.h Thu Jul 26 02:21:56 2018
@@ -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;




More information about the llvm-commits mailing list