From 03b696376219945d67caffda1995d12e3410f05b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 May 2007 05:47:06 +0000 Subject: add bitcode support git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36849 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/OptimizerDriver.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tools/bugpoint/OptimizerDriver.cpp') diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index 210f348f35..e5435ed1bc 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 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 &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); -- cgit v1.2.3-70-g09d2