[llvm-commits] [llvm] r80927 - /llvm/trunk/tools/bugpoint/BugDriver.cpp
Dan Gohman
gohman at apple.com
Thu Sep 3 09:32:58 PDT 2009
Author: djg
Date: Thu Sep 3 11:32:58 2009
New Revision: 80927
URL: http://llvm.org/viewvc/llvm-project?rev=80927&view=rev
Log:
Make bugpoint use ParseIRFile instead of doing the same thing manually.
Modified:
llvm/trunk/tools/bugpoint/BugDriver.cpp
Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=80927&r1=80926&r2=80927&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/BugDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/BugDriver.cpp Thu Sep 3 11:32:58 2009
@@ -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 @@
///
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) {
More information about the llvm-commits
mailing list