[llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp

Reid Spencer reid at x10sys.com
Sat Aug 21 13:52:14 PDT 2004



Changes in directory llvm/lib/Bytecode/Reader:

ReaderWrappers.cpp updated: 1.26 -> 1.27
---
Log message:

Two Changes:
- Pass the output stream to the analyzer so it can write its output there
  directly instead of buffering it.
- Don't pass a boolean to ParseBytecode because its not needed any more.


---
Diffs of the changes:  (+18 -14)

Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.26 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.27
--- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.26	Wed Aug  4 17:56:46 2004
+++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp	Sat Aug 21 15:52:03 2004
@@ -58,7 +58,7 @@
 
   try {
     // Parse the bytecode we mmapped in
-    ParseBytecode(Buffer, Length, Filename, H != 0);
+    ParseBytecode(Buffer, Length, Filename);
   } catch (...) {
     UnmapFileFromAddressSpace(Buffer, Length);
     throw;
@@ -114,7 +114,7 @@
     MustDelete = false;
   }
   try {
-    ParseBytecode(ParseBegin, Length, ModuleID, H != 0);
+    ParseBytecode(ParseBegin, Length, ModuleID);
   } catch (...) {
     if (MustDelete) delete [] Buffer;
     throw;
@@ -163,7 +163,7 @@
     throw std::string("Standard Input empty!");
 
   FileBuf = &FileData[0];
-  ParseBytecode(FileBuf, FileData.size(), "<stdin>", H != 0 );
+  ParseBytecode(FileBuf, FileData.size(), "<stdin>");
 }
 
 //===----------------------------------------------------------------------===//
@@ -292,12 +292,15 @@
 }
 
 // AnalyzeBytecodeFile - analyze one file
-Module* llvm::AnalyzeBytecodeFile(const std::string &Filename, 
-                               BytecodeAnalysis& bca,
-                               std::string *ErrorStr) 
+Module* llvm::AnalyzeBytecodeFile(
+  const std::string &Filename,  ///< File to analyze
+  BytecodeAnalysis& bca,        ///< Statistical output
+  std::string *ErrorStr,        ///< Error output
+  std::ostream* output          ///< Dump output
+) 
 {
   try {
-    BytecodeHandler* analyzerHandler = createBytecodeAnalyzerHandler(bca);
+    BytecodeHandler* analyzerHandler = createBytecodeAnalyzerHandler(bca,output);
     std::auto_ptr<ModuleProvider> AMP(
       getBytecodeModuleProvider(Filename,analyzerHandler));
     return AMP->releaseModule();
@@ -309,15 +312,16 @@
 
 // AnalyzeBytecodeBuffer - analyze a buffer
 Module* llvm::AnalyzeBytecodeBuffer(
-       const unsigned char* Buffer, ///< Pointer to start of bytecode buffer
-       unsigned Length,             ///< Size of the bytecode buffer
-       const std::string& ModuleID, ///< Identifier for the module
-       BytecodeAnalysis& bca,       ///< The results of the analysis
-       std::string* ErrorStr        ///< Errors, if any.
-     ) 
+  const unsigned char* Buffer, ///< Pointer to start of bytecode buffer
+  unsigned Length,             ///< Size of the bytecode buffer
+  const std::string& ModuleID, ///< Identifier for the module
+  BytecodeAnalysis& bca,       ///< The results of the analysis
+  std::string* ErrorStr,       ///< Errors, if any.
+  std::ostream* output         ///< Dump output, if any
+) 
 {
   try {
-    BytecodeHandler* hdlr = createBytecodeAnalyzerHandler(bca);
+    BytecodeHandler* hdlr = createBytecodeAnalyzerHandler(bca, output);
     std::auto_ptr<ModuleProvider>
       AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID, hdlr));
     return AMP->releaseModule();






More information about the llvm-commits mailing list