move AnalyzeBytecodeFile out of ReaderWrappers.cpp into Analyzer.cpp. Now
authorChris Lattner <sabre@nondot.org>
Wed, 7 Feb 2007 23:46:55 +0000 (23:46 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 7 Feb 2007 23:46:55 +0000 (23:46 +0000)
lli doesn't link in Analyzer.cpp.

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

lib/Bytecode/Reader/Analyzer.cpp
lib/Bytecode/Reader/Reader.h
lib/Bytecode/Reader/ReaderWrappers.cpp

index 8db5f77a6a24acd11760bfd97ba9c366e6e4e34b..68d0a9295745678e75187c970df90c765e239e6d 100644 (file)
@@ -534,7 +534,7 @@ public:
   }
 
 };
-
+} // end anonymous namespace
 
 /// @brief Utility for printing a titled unsigned value with
 /// an aligned colon.
@@ -574,14 +574,10 @@ inline static void print(std::ostream&Out, const char*title,
       << 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 @@ void PrintBytecodeAnalysis(BytecodeAnalysis& bca, std::ostream& Out )
     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 516a116f8b539d9f4298e4afec5939c1ae7e71dd..8acf6c042f8ebc3f6923fd3c4bbda47419148d4e 100644 (file)
@@ -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 @@ private:
 /// @}
 };
 
-/// @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 84fa836508decf4f43119ae1008fa4b432e8cd67..07094f2510e93037a56bdb4a91f68c62ac6b9c70 100644 (file)
@@ -255,21 +255,6 @@ Module *llvm::ParseBytecodeFile(const std::string &Filename,
   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,