summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/OptimizerDriver.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/OptimizerDriver.cpp
parentadc9e30a72f305979dd1175a342cd4b17d36f000 (diff)
downloadbcm5719-llvm-f6dd4d7fca71f98c8dcedbacc85cfb668b0208a4.tar.gz
bcm5719-llvm-f6dd4d7fca71f98c8dcedbacc85cfb668b0208a4.zip
add bitcode support
llvm-svn: 36849
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/OptimizerDriver.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp
index 210f348f354..e5435ed1bc0 100644
--- a/llvm/tools/bugpoint/OptimizerDriver.cpp
+++ b/llvm/tools/bugpoint/OptimizerDriver.cpp
@@ -24,6 +24,7 @@
#include "llvm/PassManager.h"
#include "llvm/Analysis/Verifier.h"
#include "llvm/Bytecode/WriteBytecodePass.h"
+#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/CommandLine.h"
@@ -38,6 +39,9 @@
#include <fstream>
using namespace llvm;
+static bool Bitcode = false;
+
+
namespace {
// ChildOutput - This option captures the name of the child output file that
// is set up by the parent bugpoint process
@@ -110,7 +114,10 @@ int BugDriver::runPassesAsChild(const std::vector<const PassInfo*> &Passes) {
// Write bytecode out to disk as the last step...
OStream L(OutFile);
- PM.add(new WriteBytecodePass(&L));
+ if (Bitcode)
+ PM.add(CreateBitcodeWriterPass(OutFile));
+ else
+ PM.add(new WriteBytecodePass(&L));
// Run all queued passes.
PM.run(*Program);
OpenPOWER on IntegriCloud