minor cleanups. Add provisions for a new standard BLOCKINFO_BLOCK
[oota-llvm.git] / include / llvm / Bytecode / Analyzer.h
index 912cbfd1fe34b6dcbd23e2b8990b7544fb96e09a..7d02f68eeeb6a365c8b6f30cde63bf2f212d5a59 100644 (file)
 #define LLVM_BYTECODE_ANALYZER_H
 
 #include "llvm/Bytecode/Format.h"
+#include "llvm/Bytecode/Reader.h"
 #include <string>
 #include <map>
-#include <ostream>
+#include <iosfwd>
 
 namespace llvm {
 
@@ -63,10 +64,6 @@ struct BytecodeAnalysis {
   double   functionDensity; ///< Average density of functions (bytes/function)
   unsigned instructionSize; ///< Size of instructions in bytes
   unsigned longInstructions;///< Number of instructions > 4 bytes
-  unsigned vbrCount32;      ///< Number of 32-bit vbr values
-  unsigned vbrCount64;      ///< Number of 64-bit vbr values
-  unsigned vbrCompBytes;    ///< Number of vbr bytes (compressed)
-  unsigned vbrExpdBytes;    ///< Number of vbr bytes (expanded)
 
   typedef std::map<BytecodeFormat::BytecodeBlockIdentifiers,unsigned>
       BlockSizeMap;
@@ -85,10 +82,6 @@ struct BytecodeAnalysis {
     double   density;         ///< Density of function
     unsigned instructionSize; ///< Size of instructions in bytes
     unsigned longInstructions;///< Number of instructions > 4 bytes
-    unsigned vbrCount32;      ///< Number of 32-bit vbr values
-    unsigned vbrCount64;      ///< Number of 64-bit vbr values
-    unsigned vbrCompBytes;    ///< Number of vbr bytes (compressed)
-    unsigned vbrExpdBytes;    ///< Number of vbr bytes (expanded)
   };
 
   /// A mapping of function slot numbers to the collected information about
@@ -110,23 +103,11 @@ struct BytecodeAnalysis {
 Module* AnalyzeBytecodeFile(
       const std::string& Filename, ///< The name of the bytecode file to read
       BytecodeAnalysis& Results,   ///< The results of the analysis
+      BCDecompressor_t *BCDC = 0,     ///< Optional decompressor to use.
       std::string* ErrorStr = 0,   ///< Errors, if any.
       std::ostream* output = 0     ///< Stream for dump output, if wanted
     );
 
-/// This function is an alternate entry point into the bytecode analysis
-/// library. It allows you to provide an arbitrary memory buffer which is
-/// assumed to contain a complete bytecode file. The \p Buffer is analyzed and
-/// the \p Results are filled in.
-/// @brief Analyze contents of a bytecode buffer.
-Module* AnalyzeBytecodeBuffer(
-       const unsigned char* Buffer, ///< Pointer to start of bytecode buffer
-       unsigned BufferSize,         ///< Size of the bytecode buffer
-       const std::string& ModuleID, ///< Identifier for the module
-       BytecodeAnalysis& Results,   ///< The results of the analysis
-       std::string* ErrorStr = 0,   ///< Errors, if any.
-       std::ostream* output = 0     ///< Stream for dump output, if wanted
-     );
 
 /// This function prints the contents of rhe BytecodeAnalysis structure in
 /// a human legible form.