summaryrefslogtreecommitdiff
path: root/tools/opt
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-06 09:32:02 +0000
committerChris Lattner <sabre@nondot.org>2007-05-06 09:32:02 +0000
commit744879ea01779a48f898a801c847677b0bfa824a (patch)
tree1602b46ba1a9012436d5bb3b17e1109080394cfd /tools/opt
parent73a978a753f66003fb8959af40549ca18b612cd1 (diff)
downloadllvm-744879ea01779a48f898a801c847677b0bfa824a.tar.gz
llvm-744879ea01779a48f898a801c847677b0bfa824a.tar.bz2
llvm-744879ea01779a48f898a801c847677b0bfa824a.tar.xz
switch tools to bitcode from bytecode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt')
-rw-r--r--tools/opt/Makefile2
-rw-r--r--tools/opt/opt.cpp40
2 files changed, 12 insertions, 30 deletions
diff --git a/tools/opt/Makefile b/tools/opt/Makefile
index 76cb5b1272..f444fe338b 100644
--- a/tools/opt/Makefile
+++ b/tools/opt/Makefile
@@ -10,6 +10,6 @@ LEVEL = ../..
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
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 218e5f0b1d..99249b9442 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -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 @@ int main(int argc, char **argv) {
// 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 @@ int main(int argc, char **argv) {
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());