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

Chris Lattner sabre at nondot.org
Wed Feb 7 15:47:11 PST 2007



Changes in directory llvm/lib/Bytecode/Reader:

Analyzer.cpp updated: 1.34 -> 1.35
Reader.h updated: 1.47 -> 1.48
ReaderWrappers.cpp updated: 1.64 -> 1.65
---
Log message:

move AnalyzeBytecodeFile out of ReaderWrappers.cpp into Analyzer.cpp.  Now
lli doesn't link in Analyzer.cpp.


---
Diffs of the changes:  (+15 -36)

 Analyzer.cpp       |   28 +++++++++++++++-------------
 Reader.h           |    8 --------
 ReaderWrappers.cpp |   15 ---------------
 3 files changed, 15 insertions(+), 36 deletions(-)


Index: llvm/lib/Bytecode/Reader/Analyzer.cpp
diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.34 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.35
--- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.34	Wed Feb  7 01:19:19 2007
+++ llvm/lib/Bytecode/Reader/Analyzer.cpp	Wed Feb  7 17:46:55 2007
@@ -534,7 +534,7 @@
   }
 
 };
-
+} // end anonymous namespace
 
 /// @brief Utility for printing a titled unsigned value with
 /// an aligned colon.
@@ -574,14 +574,10 @@
       << std::left << val << (nl ? "\n" : "");
 }
 
-}
-
-namespace llvm {
-
 /// This function prints the contents of rhe BytecodeAnalysis structure in
 /// a human legible form.
 /// @brief Print BytecodeAnalysis structure to an ostream
-void PrintBytecodeAnalysis(BytecodeAnalysis& bca, std::ostream& Out )
+void llvm::PrintBytecodeAnalysis(BytecodeAnalysis& bca, std::ostream& Out )
 {
   Out << "\nSummary Analysis Of " << bca.ModuleId << ": \n\n";
   print(Out, "Bytecode Analysis Of Module",     bca.ModuleId);
@@ -673,11 +669,17 @@
     Out << bca.VerifyInfo;
 }
 
-BytecodeHandler* createBytecodeAnalyzerHandler(BytecodeAnalysis& bca,
-                                               std::ostream* output)
-{
-  return new AnalyzerHandler(bca,output);
-}
-
+// AnalyzeBytecodeFile - analyze one file
+Module* llvm::AnalyzeBytecodeFile(const std::string &Filename,  ///< File to analyze
+                                  BytecodeAnalysis& bca,        ///< Statistical output
+                                  BCDecompressor_t *BCDC,
+                                  std::string *ErrMsg,          ///< Error output
+                                  std::ostream* output          ///< Dump output
+                                  ) {
+  BytecodeHandler* AH = new AnalyzerHandler(bca, output);
+  ModuleProvider* MP = getBytecodeModuleProvider(Filename, BCDC, ErrMsg, AH);
+  if (!MP) return 0;
+  Module *M = MP->releaseModule(ErrMsg);
+  delete MP;
+  return M;
 }
-


Index: llvm/lib/Bytecode/Reader/Reader.h
diff -u llvm/lib/Bytecode/Reader/Reader.h:1.47 llvm/lib/Bytecode/Reader/Reader.h:1.48
--- llvm/lib/Bytecode/Reader/Reader.h:1.47	Wed Feb  7 15:41:01 2007
+++ llvm/lib/Bytecode/Reader/Reader.h	Wed Feb  7 17:46:55 2007
@@ -18,8 +18,6 @@
 
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Function.h"
 #include "llvm/ModuleProvider.h"
 #include "llvm/Bytecode/Analyzer.h"
 #include "llvm/ADT/SmallVector.h"
@@ -455,12 +453,6 @@
 /// @}
 };
 
-/// @brief A function for creating a BytecodeAnalzer as a handler
-/// for the Bytecode reader.
-BytecodeHandler* createBytecodeAnalyzerHandler(BytecodeAnalysis& bca,
-                                               std::ostream* output );
-
-
 } // End llvm namespace
 
 // vim: sw=2


Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.64 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.65
--- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.64	Wed Feb  7 15:41:01 2007
+++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp	Wed Feb  7 17:46:55 2007
@@ -255,21 +255,6 @@
   return M;
 }
 
-// AnalyzeBytecodeFile - analyze one file
-Module* llvm::AnalyzeBytecodeFile(
-  const std::string &Filename,  ///< File to analyze
-  BytecodeAnalysis& bca,        ///< Statistical output
-  BCDecompressor_t *BCDC,
-  std::string *ErrMsg,          ///< Error output
-  std::ostream* output          ///< Dump output
-) {
-  BytecodeHandler* AH = createBytecodeAnalyzerHandler(bca,output);
-  ModuleProvider* MP = getBytecodeModuleProvider(Filename, BCDC, ErrMsg, AH);
-  if (!MP) return 0;
-  Module *M = MP->releaseModule(ErrMsg);
-  delete MP;
-  return M;
-}
 
 bool llvm::GetBytecodeDependentLibraries(const std::string &fname,
                                          Module::LibraryListType& deplibs,






More information about the llvm-commits mailing list