[llvm] r250258 - Rename one of our two llvm::GCOVOptions classes to llvm::GCOV::Options. We used
Richard Smith via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 13 17:04:20 PDT 2015
Author: rsmith
Date: Tue Oct 13 19:04:19 2015
New Revision: 250258
URL: http://llvm.org/viewvc/llvm-project?rev=250258&view=rev
Log:
Rename one of our two llvm::GCOVOptions classes to llvm::GCOV::Options. We used
to get away with this because llvm/Support/GCOV.h was an implementation detail
of the llvm-gcov tool, but it's now being used by FDO.
Modified:
llvm/trunk/include/llvm/Support/GCOV.h
llvm/trunk/include/llvm/module.modulemap
llvm/trunk/lib/IR/GCOV.cpp
llvm/trunk/tools/llvm-cov/gcov.cpp
Modified: llvm/trunk/include/llvm/Support/GCOV.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GCOV.h?rev=250258&r1=250257&r2=250258&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/GCOV.h (original)
+++ llvm/trunk/include/llvm/Support/GCOV.h Tue Oct 13 19:04:19 2015
@@ -31,11 +31,10 @@ class FileInfo;
namespace GCOV {
enum GCOVVersion { V402, V404, V704 };
-} // end GCOV namespace
-/// GCOVOptions - A struct for passing gcov options between functions.
-struct GCOVOptions {
- GCOVOptions(bool A, bool B, bool C, bool F, bool P, bool U, bool L, bool N)
+/// \brief A struct for passing gcov options between functions.
+struct Options {
+ Options(bool A, bool B, bool C, bool F, bool P, bool U, bool L, bool N)
: AllBlocks(A), BranchInfo(B), BranchCount(C), FuncCoverage(F),
PreservePaths(P), UncondBranch(U), LongFileNames(L), NoOutput(N) {}
@@ -48,6 +47,7 @@ struct GCOVOptions {
bool LongFileNames;
bool NoOutput;
};
+} // end GCOV namespace
/// GCOVBuffer - A wrapper around MemoryBuffer to provide GCOV specific
/// read operations.
@@ -395,7 +395,7 @@ class FileInfo {
};
public:
- FileInfo(const GCOVOptions &Options)
+ FileInfo(const GCOV::Options &Options)
: Options(Options), LineInfo(), RunCount(0), ProgramCount(0) {}
void addBlockLine(StringRef Filename, uint32_t Line, const GCOVBlock *Block) {
@@ -429,7 +429,7 @@ private:
void printFuncCoverage(raw_ostream &OS) const;
void printFileCoverage(raw_ostream &OS) const;
- const GCOVOptions &Options;
+ const GCOV::Options &Options;
StringMap<LineData> LineInfo;
uint32_t RunCount;
uint32_t ProgramCount;
Modified: llvm/trunk/include/llvm/module.modulemap
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/module.modulemap?rev=250258&r1=250257&r2=250258&view=diff
==============================================================================
--- llvm/trunk/include/llvm/module.modulemap (original)
+++ llvm/trunk/include/llvm/module.modulemap Tue Oct 13 19:04:19 2015
@@ -190,10 +190,6 @@ module LLVM_Utils {
// Exclude this; it's fundamentally non-modular.
exclude header "Support/PluginLoader.h"
- // Exclude this; it's a weirdly-factored part of llvm-gcov and conflicts
- // with the Analysis module (which also defines an llvm::GCOVOptions).
- exclude header "Support/GCOV.h"
-
// FIXME: Mislayered?
exclude header "Support/TargetRegistry.h"
Modified: llvm/trunk/lib/IR/GCOV.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/GCOV.cpp?rev=250258&r1=250257&r2=250258&view=diff
==============================================================================
--- llvm/trunk/lib/IR/GCOV.cpp (original)
+++ llvm/trunk/lib/IR/GCOV.cpp Tue Oct 13 19:04:19 2015
@@ -448,7 +448,7 @@ static uint32_t branchDiv(uint64_t Numer
namespace {
struct formatBranchInfo {
- formatBranchInfo(const GCOVOptions &Options, uint64_t Count, uint64_t Total)
+ formatBranchInfo(const GCOV::Options &Options, uint64_t Count, uint64_t Total)
: Options(Options), Count(Count), Total(Total) {}
void print(raw_ostream &OS) const {
@@ -460,7 +460,7 @@ struct formatBranchInfo {
OS << "taken " << branchDiv(Count, Total) << "%";
}
- const GCOVOptions &Options;
+ const GCOV::Options &Options;
uint64_t Count;
uint64_t Total;
};
Modified: llvm/trunk/tools/llvm-cov/gcov.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/gcov.cpp?rev=250258&r1=250257&r2=250258&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/gcov.cpp (original)
+++ llvm/trunk/tools/llvm-cov/gcov.cpp Tue Oct 13 19:04:19 2015
@@ -26,7 +26,7 @@ using namespace llvm;
static void reportCoverage(StringRef SourceFile, StringRef ObjectDir,
const std::string &InputGCNO,
const std::string &InputGCDA, bool DumpGCOV,
- const GCOVOptions &Options) {
+ const GCOV::Options &Options) {
SmallString<128> CoverageFileStem(ObjectDir);
if (CoverageFileStem.empty()) {
// If no directory was specified with -o, look next to the source file.
@@ -143,8 +143,8 @@ int gcovMain(int argc, const char *argv[
cl::ParseCommandLineOptions(argc, argv, "LLVM code coverage tool\n");
- GCOVOptions Options(AllBlocks, BranchProb, BranchCount, FuncSummary,
- PreservePaths, UncondBranch, LongNames, NoOutput);
+ GCOV::Options Options(AllBlocks, BranchProb, BranchCount, FuncSummary,
+ PreservePaths, UncondBranch, LongNames, NoOutput);
for (const auto &SourceFile : SourceFiles)
reportCoverage(SourceFile, ObjectDir, InputGCNO, InputGCDA, DumpGCOV,
More information about the llvm-commits
mailing list