summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/BugDriver.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-06 05:47:06 +0000
committerChris Lattner <sabre@nondot.org>2007-05-06 05:47:06 +0000
commitf6dd4d7fca71f98c8dcedbacc85cfb668b0208a4 (patch)
tree3403b5e971daac91e27aa5cddce48fac1349404c /llvm/tools/bugpoint/BugDriver.cpp
parentadc9e30a72f305979dd1175a342cd4b17d36f000 (diff)
downloadbcm5719-llvm-f6dd4d7fca71f98c8dcedbacc85cfb668b0208a4.tar.gz
bcm5719-llvm-f6dd4d7fca71f98c8dcedbacc85cfb668b0208a4.zip
add bitcode support
llvm-svn: 36849
Diffstat (limited to 'llvm/tools/bugpoint/BugDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/BugDriver.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.cpp b/llvm/tools/bugpoint/BugDriver.cpp
index b2a8f030c5f..fe290805e4b 100644
--- a/llvm/tools/bugpoint/BugDriver.cpp
+++ b/llvm/tools/bugpoint/BugDriver.cpp
@@ -19,13 +19,14 @@
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Assembly/Parser.h"
+#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compressor.h"
#include "llvm/Support/FileUtilities.h"
+#include "llvm/Support/MemoryBuffer.h"
#include <iostream>
#include <memory>
-
using namespace llvm;
// Anonymous namespace to define command line options for debugging.
@@ -77,6 +78,13 @@ Module *llvm::ParseInputFile(const std::string &InputFilename) {
ParseError Err;
Module *Result = ParseBytecodeFile(InputFilename,
Compressor::decompressToNewBuffer);
+ if (!Result) {
+ std::auto_ptr<MemoryBuffer> Buffer(
+ MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size()));
+ if (Buffer.get())
+ Result = ParseBitcodeFile(Buffer.get());
+ }
+
if (!Result && !(Result = ParseAssemblyFile(InputFilename,&Err))) {
std::cerr << "bugpoint: " << Err.getMessage() << "\n";
Result = 0;
OpenPOWER on IntegriCloud