diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-07 23:46:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-07 23:46:55 +0000 |
commit | daba41cfb948ca90043630c251e2de8302001292 (patch) | |
tree | 4c7775b5a4d0ad64e9667b3e886d17aba69bd142 /llvm/lib/Bytecode/Reader/Analyzer.cpp | |
parent | 8ff9a0691ce36fa7b5a5fc1dbc3f8a5db2e03cec (diff) | |
download | bcm5719-llvm-daba41cfb948ca90043630c251e2de8302001292.tar.gz bcm5719-llvm-daba41cfb948ca90043630c251e2de8302001292.zip |
move AnalyzeBytecodeFile out of ReaderWrappers.cpp into Analyzer.cpp. Now
lli doesn't link in Analyzer.cpp.
llvm-svn: 34020
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Analyzer.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Reader/Analyzer.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/llvm/lib/Bytecode/Reader/Analyzer.cpp b/llvm/lib/Bytecode/Reader/Analyzer.cpp index 8db5f77a6a2..68d0a929574 100644 --- a/llvm/lib/Bytecode/Reader/Analyzer.cpp +++ b/llvm/lib/Bytecode/Reader/Analyzer.cpp @@ -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; } - |