Add MemoryBufferRef(MemoryBuffer&) constructor.
[oota-llvm.git] / include / llvm / Support / GCOV.h
index c2e34bd3eaeb49a19663e82344c654bfc7e79e7e..544434f036a4a8fb74a79d3a063db9c7fa0e65aa 100644 (file)
@@ -30,12 +30,11 @@ class GCOVBlock;
 class FileInfo;
 
 namespace GCOV {
-enum GCOVVersion { V402, V404 };
-} // end GCOV namespace
+enum GCOVVersion { V402, V404, V704 };
 
-/// 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.
@@ -90,6 +90,11 @@ public:
       Version = GCOV::V404;
       return true;
     }
+    if (VersionStr == "*704") {
+      Cursor += 4;
+      Version = GCOV::V704;
+      return true;
+    }
     errs() << "Unexpected version: " << VersionStr << ".\n";
     return false;
   }
@@ -390,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) {
@@ -424,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;