[llvm-commits] CVS: llvm/tools/opt/Makefile opt.cpp
Chris Lattner
sabre at nondot.org
Sun May 6 02:32:31 PDT 2007
Changes in directory llvm/tools/opt:
Makefile updated: 1.62 -> 1.63
opt.cpp updated: 1.139 -> 1.140
---
Log message:
switch tools to bitcode from bytecode
---
Diffs of the changes: (+12 -30)
Makefile | 2 +-
opt.cpp | 40 +++++++++++-----------------------------
2 files changed, 12 insertions(+), 30 deletions(-)
Index: llvm/tools/opt/Makefile
diff -u llvm/tools/opt/Makefile:1.62 llvm/tools/opt/Makefile:1.63
--- llvm/tools/opt/Makefile:1.62 Sat May 5 21:42:03 2007
+++ llvm/tools/opt/Makefile Sun May 6 04:32:02 2007
@@ -10,6 +10,6 @@
TOOLNAME = opt
REQUIRES_EH := 1
-LINK_COMPONENTS := bcreader bcwriter bitreader bitwriter instrumentation scalaropts ipo
+LINK_COMPONENTS := bitreader bitwriter instrumentation scalaropts ipo
include $(LEVEL)/Makefile.common
Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.139 llvm/tools/opt/opt.cpp:1.140
--- llvm/tools/opt/opt.cpp:1.139 Sat May 5 23:43:00 2007
+++ llvm/tools/opt/opt.cpp Sun May 6 04:32:02 2007
@@ -14,8 +14,6 @@
#include "llvm/Module.h"
#include "llvm/PassManager.h"
-#include "llvm/Bytecode/Reader.h"
-#include "llvm/Bytecode/WriteBytecodePass.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Assembly/PrintModulePass.h"
#include "llvm/Analysis/Verifier.h"
@@ -37,17 +35,12 @@
#include <algorithm>
using namespace llvm;
-static cl::opt<bool> Bitcode("bitcode");
-
// The OptimizationList is automatically populated with registered Passes by the
// PassNameParser.
//
static cl::list<const PassInfo*, bool, PassNameParser>
PassList(cl::desc("Optimizations available:"));
-static cl::opt<bool> NoCompress("disable-compression", cl::init(true),
- cl::desc("Don't compress the generated bytecode"));
-
// Other command line options...
//
static cl::opt<std::string>
@@ -267,21 +260,15 @@
// Load the input module...
std::auto_ptr<Module> M;
- if (Bitcode) {
- MemoryBuffer *Buffer
- = MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size());
-
- if (Buffer == 0)
- ErrorMessage = "Error reading file '" + InputFilename + "'";
- else
- M.reset(ParseBitcodeFile(Buffer, &ErrorMessage));
-
- delete Buffer;
- } else {
- M.reset(ParseBytecodeFile(InputFilename,
- Compressor::decompressToNewBuffer,
- &ErrorMessage));
- }
+ MemoryBuffer *Buffer
+ = MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size());
+
+ if (Buffer == 0)
+ ErrorMessage = "Error reading file '" + InputFilename + "'";
+ else
+ M.reset(ParseBitcodeFile(Buffer, &ErrorMessage));
+
+ delete Buffer;
if (M.get() == 0) {
cerr << argv[0] << ": ";
if (ErrorMessage.size())
@@ -372,13 +359,8 @@
Passes.add(createVerifierPass());
// Write bytecode out to disk or cout as the last step...
- OStream L(*Out);
- if (!NoOutput && !AnalyzeOnly) {
- if (Bitcode)
- Passes.add(CreateBitcodeWriterPass(*Out));
- else
- Passes.add(new WriteBytecodePass(&L, false, !NoCompress));
- }
+ if (!NoOutput && !AnalyzeOnly)
+ Passes.add(CreateBitcodeWriterPass(*Out));
// Now that we have all of the passes ready, run them.
Passes.run(*M.get());
More information about the llvm-commits
mailing list