summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/BugDriver.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-06 23:45:49 +0000
committerChris Lattner <sabre@nondot.org>2007-05-06 23:45:49 +0000
commit9e9a34c6bf64b76226a60dc6e20529e879cabd87 (patch)
tree6936a472da5c7ffe1097d053ff9fd33a5add3e22 /llvm/tools/bugpoint/BugDriver.cpp
parent275757a05ef6a506303fd3a240ea389c476a9777 (diff)
downloadbcm5719-llvm-9e9a34c6bf64b76226a60dc6e20529e879cabd87.tar.gz
bcm5719-llvm-9e9a34c6bf64b76226a60dc6e20529e879cabd87.zip
use the new MemoryBuffer interfaces to simplify error reporting in clients.
llvm-svn: 36900
Diffstat (limited to 'llvm/tools/bugpoint/BugDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/BugDriver.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.cpp b/llvm/tools/bugpoint/BugDriver.cpp
index 00dfc32774a..7ce1e689431 100644
--- a/llvm/tools/bugpoint/BugDriver.cpp
+++ b/llvm/tools/bugpoint/BugDriver.cpp
@@ -72,18 +72,18 @@ BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs,
/// ParseInputFile - Given a bytecode or assembly input filename, parse and
/// return it, or return null if not possible.
///
-Module *llvm::ParseInputFile(const std::string &InputFilename) {
- std::auto_ptr<MemoryBuffer> Buffer(
- MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size()));
+Module *llvm::ParseInputFile(const std::string &Filename) {
+ std::auto_ptr<MemoryBuffer> Buffer(MemoryBuffer::getFileOrSTDIN(Filename));
Module *Result = 0;
if (Buffer.get())
Result = ParseBitcodeFile(Buffer.get());
ParseError Err;
- if (!Result && !(Result = ParseAssemblyFile(InputFilename,&Err))) {
+ if (!Result && !(Result = ParseAssemblyFile(Filename, &Err))) {
std::cerr << "bugpoint: " << Err.getMessage() << "\n";
Result = 0;
}
+
return Result;
}
@@ -100,6 +100,7 @@ bool BugDriver::addSources(const std::vector<std::string> &Filenames) {
// Load the first input file.
Program = ParseInputFile(Filenames[0]);
if (Program == 0) return true;
+
if (!run_as_child)
std::cout << "Read input file : '" << Filenames[0] << "'\n";
OpenPOWER on IntegriCloud