diff options
author | Chris Lattner <sabre@nondot.org> | 2007-05-06 05:47:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-05-06 05:47:06 +0000 |
commit | 03b696376219945d67caffda1995d12e3410f05b (patch) | |
tree | 8ea1373739d0fa82791130f9e878819a0b1601e5 /tools/bugpoint/OptimizerDriver.cpp | |
parent | e3c55a52f888701c9003fb4bacd866fda06ae113 (diff) | |
download | external_llvm-03b696376219945d67caffda1995d12e3410f05b.zip external_llvm-03b696376219945d67caffda1995d12e3410f05b.tar.gz external_llvm-03b696376219945d67caffda1995d12e3410f05b.tar.bz2 |
add bitcode support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | tools/bugpoint/OptimizerDriver.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index 210f348..e5435ed 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/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); |