[llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp Makefile OptimizerDriver.cpp
Chris Lattner
sabre at nondot.org
Sun May 6 02:32:36 PDT 2007
Changes in directory llvm/tools/bugpoint:
BugDriver.cpp updated: 1.52 -> 1.53
Makefile updated: 1.22 -> 1.23
OptimizerDriver.cpp updated: 1.51 -> 1.52
---
Log message:
switch tools to bitcode from bytecode
---
Diffs of the changes: (+11 -28)
BugDriver.cpp | 17 ++++++-----------
Makefile | 2 +-
OptimizerDriver.cpp | 20 ++++----------------
3 files changed, 11 insertions(+), 28 deletions(-)
Index: llvm/tools/bugpoint/BugDriver.cpp
diff -u llvm/tools/bugpoint/BugDriver.cpp:1.52 llvm/tools/bugpoint/BugDriver.cpp:1.53
--- llvm/tools/bugpoint/BugDriver.cpp:1.52 Sun May 6 00:47:06 2007
+++ llvm/tools/bugpoint/BugDriver.cpp Sun May 6 04:32:02 2007
@@ -20,9 +20,7 @@
#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>
@@ -75,16 +73,13 @@
/// return it, or return null if not possible.
///
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());
- }
+ std::auto_ptr<MemoryBuffer> Buffer(
+ MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size()));
+ Module *Result = 0;
+ if (Buffer.get())
+ Result = ParseBitcodeFile(Buffer.get());
+ ParseError Err;
if (!Result && !(Result = ParseAssemblyFile(InputFilename,&Err))) {
std::cerr << "bugpoint: " << Err.getMessage() << "\n";
Result = 0;
Index: llvm/tools/bugpoint/Makefile
diff -u llvm/tools/bugpoint/Makefile:1.22 llvm/tools/bugpoint/Makefile:1.23
--- llvm/tools/bugpoint/Makefile:1.22 Sun May 6 00:47:06 2007
+++ llvm/tools/bugpoint/Makefile Sun May 6 04:32:02 2007
@@ -10,7 +10,7 @@
TOOLNAME = bugpoint
-LINK_COMPONENTS := bcreader bcwriter asmparser instrumentation scalaropts ipo \
+LINK_COMPONENTS := asmparser instrumentation scalaropts ipo \
linker bitreader bitwriter
REQUIRES_EH := 1
Index: llvm/tools/bugpoint/OptimizerDriver.cpp
diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.51 llvm/tools/bugpoint/OptimizerDriver.cpp:1.52
--- llvm/tools/bugpoint/OptimizerDriver.cpp:1.51 Sun May 6 00:47:06 2007
+++ llvm/tools/bugpoint/OptimizerDriver.cpp Sun May 6 04:32:02 2007
@@ -23,7 +23,6 @@
#include "llvm/Module.h"
#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"
@@ -39,8 +38,6 @@
#include <fstream>
using namespace llvm;
-static bool Bitcode = false;
-
namespace {
// ChildOutput - This option captures the name of the child output file that
@@ -59,12 +56,8 @@
std::ios::binary;
std::ofstream Out(Filename.c_str(), io_mode);
if (!Out.good()) return true;
- try {
- OStream L(Out);
- WriteBytecodeToFile(M ? M : Program, L, /*compression=*/false);
- } catch (...) {
- return true;
- }
+
+ WriteBitcodeToFile(M, Out);
return false;
}
@@ -113,11 +106,7 @@
PM.add(createVerifierPass());
// Write bytecode out to disk as the last step...
- OStream L(OutFile);
- if (Bitcode)
- PM.add(CreateBitcodeWriterPass(OutFile));
- else
- PM.add(new WriteBytecodePass(&L));
+ PM.add(CreateBitcodeWriterPass(OutFile));
// Run all queued passes.
PM.run(*Program);
@@ -161,8 +150,7 @@
cerr << "Error opening bytecode file: " << inputFilename << "\n";
return(1);
}
- OStream L(InFile);
- WriteBytecodeToFile(Program,L,false);
+ WriteBitcodeToFile(Program, InFile);
InFile.close();
// setup the child process' arguments
More information about the llvm-commits
mailing list