summaryrefslogtreecommitdiff
path: root/tools/bugpoint/BugDriver.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-03 16:32:58 +0000
committerDan Gohman <gohman@apple.com>2009-09-03 16:32:58 +0000
commitdad45ea56ea8419f51cefb3ff6d2c9ad886ccbbb (patch)
tree675d115556ad363ebe787057e38b58c351c73a80 /tools/bugpoint/BugDriver.cpp
parent8fc5ad33691b2a0672a7487da1f56b6f7f675a1b (diff)
downloadllvm-dad45ea56ea8419f51cefb3ff6d2c9ad886ccbbb.tar.gz
llvm-dad45ea56ea8419f51cefb3ff6d2c9ad886ccbbb.tar.bz2
llvm-dad45ea56ea8419f51cefb3ff6d2c9ad886ccbbb.tar.xz
Make bugpoint use ParseIRFile instead of doing the same thing manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/BugDriver.cpp')
-rw-r--r--tools/bugpoint/BugDriver.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/tools/bugpoint/BugDriver.cpp b/tools/bugpoint/BugDriver.cpp
index bfc7058274..abf5d8ef72 100644
--- a/tools/bugpoint/BugDriver.cpp
+++ b/tools/bugpoint/BugDriver.cpp
@@ -18,8 +18,7 @@
#include "llvm/Linker.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
-#include "llvm/Assembly/Parser.h"
-#include "llvm/Bitcode/ReaderWriter.h"
+#include "llvm/Support/IRReader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -82,17 +81,11 @@ BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs,
///
Module *llvm::ParseInputFile(const std::string &Filename,
LLVMContext& Ctxt) {
- std::auto_ptr<MemoryBuffer> Buffer(MemoryBuffer::getFileOrSTDIN(Filename));
- Module *Result = 0;
- if (Buffer.get())
- Result = ParseBitcodeFile(Buffer.get(), Ctxt);
-
SMDiagnostic Err;
- if (!Result && !(Result = ParseAssemblyFile(Filename, Err, Ctxt))) {
- Err.Print("bugpoint", errs());
- Result = 0;
- }
-
+ Module *Result = ParseIRFile(Filename, Err, Ctxt);
+ if (!Result)
+ Err.Print("bugpoint", errs());
+
// If we don't have an override triple, use the first one to configure
// bugpoint, or use the host triple if none provided.
if (Result) {