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) {}
bool LongFileNames;
bool NoOutput;
};
+} // end GCOV namespace
/// GCOVBuffer - A wrapper around MemoryBuffer to provide GCOV specific
/// read operations.
};
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) {
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;
// 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"
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 {
OS << "taken " << branchDiv(Count, Total) << "%";
}
- const GCOVOptions &Options;
+ const GCOV::Options &Options;
uint64_t Count;
uint64_t Total;
};
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.
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,