Clean up documentation and make it possible for the BytecodeAnalyzer to
authorReid Spencer <rspencer@reidspencer.com>
Tue, 8 Jun 2004 05:55:53 +0000 (05:55 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Tue, 8 Jun 2004 05:55:53 +0000 (05:55 +0000)
store the output of the bytecode dumper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14058 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Bytecode/Analyzer.h

index d3e1b9550339ffc727103b41e5fae97835fa72ab..e6df72fd790695e2c1770d959aa3da28808831db 100644 (file)
@@ -1,4 +1,4 @@
-//===-- llvm/Bytecode/Analyzer.h - Analyzer for bytecode files --*- C++ -*-===//
+//===-- llvm/Bytecode/Analyzer.h - Analyzer for Bytecode files --*- C++ -*-===//
 // 
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,10 +8,11 @@
 //===----------------------------------------------------------------------===//
 //
 // This functionality is implemented by the lib/Bytecode/Analysis library.
-// This library is used to read VM bytecode files from an iostream and print
-// out a diagnostic analysis of the contents of the file. It is intended for
-// three uses: (a) understanding the bytecode format, (b) ensuring correctness
-// of bytecode format, (c) statistical analysis of generated bytecode files.
+// This library is used to read VM bytecode files from a file or memory buffer
+// and print out a diagnostic analysis of the contents of the file. It is 
+// intended for three uses: (a) understanding the bytecode format, (b) ensuring 
+// correctness of bytecode format, (c) statistical analysis of generated 
+// bytecode files.
 //
 //===----------------------------------------------------------------------===//
 
@@ -61,8 +62,12 @@ struct BytecodeAnalysis {
   /// function.
   std::map<std::string,BytecodeFunctionInfo> FunctionInfo; 
 
+  /// The content of the bytecode dump
+  std::string BytecodeDump;
+
   /// Flags for what should be done
-  bool dumpBytecode;
+  bool dumpBytecode;     ///< If true, BytecodeDump has contents
+  bool detailedResults;  ///< If true, FunctionInfo has contents 
 };
 
 /// This function is the main entry point into the bytecode analysis library. It
@@ -92,6 +97,12 @@ void AnalyzeBytecodeBuffer(
 /// @brief Print BytecodeAnalysis structure to an ostream
 void PrintBytecodeAnalysis(BytecodeAnalysis& bca, std::ostream& Out );
 
+/// @brief std::ostream inserter for BytecodeAnalysis structure
+inline std::ostream& operator<<(std::ostream& Out, BytecodeAnalysis& bca ) {
+    PrintBytecodeAnalysis(bca,Out);
+    return Out;
+}
+
 } // End llvm namespace
 
 #endif