aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-08-21 20:52:03 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-08-21 20:52:03 +0000
commit4542c43761d64d40425df8a4de7631a09cc17ba3 (patch)
treee323426acec40b76c57af9ecc335da41d873488a /lib/Bytecode
parent572c2565191f2d7d5cf46f8325b2795db2d6f466 (diff)
downloadexternal_llvm-4542c43761d64d40425df8a4de7631a09cc17ba3.zip
external_llvm-4542c43761d64d40425df8a4de7631a09cc17ba3.tar.gz
external_llvm-4542c43761d64d40425df8a4de7631a09cc17ba3.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Reader/ReaderWrappers.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/lib/Bytecode/Reader/ReaderWrappers.cpp b/lib/Bytecode/Reader/ReaderWrappers.cpp
index a6983d0..7a37d39 100644
--- a/lib/Bytecode/Reader/ReaderWrappers.cpp
+++ b/lib/Bytecode/Reader/ReaderWrappers.cpp
@@ -58,7 +58,7 @@ BytecodeFileReader::BytecodeFileReader(const std::string &Filename,
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 @@ BytecodeBufferReader::BytecodeBufferReader(const unsigned char *Buf,
MustDelete = false;
}
try {
- ParseBytecode(ParseBegin, Length, ModuleID, H != 0);
+ ParseBytecode(ParseBegin, Length, ModuleID);
} catch (...) {
if (MustDelete) delete [] Buffer;
throw;
@@ -163,7 +163,7 @@ BytecodeStdinReader::BytecodeStdinReader( BytecodeHandler* H )
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 @@ Module *llvm::ParseBytecodeFile(const std::string &Filename,
}
// 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 @@ Module* llvm::AnalyzeBytecodeFile(const std::string &Filename,
// 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();