diff options
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); |