aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-extract
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-06 09:29:57 +0000
committerChris Lattner <sabre@nondot.org>2007-05-06 09:29:57 +0000
commit44dadffe4bd58ab32961ca5fe537e8ba69c09243 (patch)
tree745eccd4ec6ba93e89d8c2d992db470dbd025134 /tools/llvm-extract
parent4bcca0f2ac85c918fc8617e34b7642e5e5233460 (diff)
switch tools to bitcode instead of bytecode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-extract')
-rw-r--r--tools/llvm-extract/Makefile2
-rw-r--r--tools/llvm-extract/llvm-extract.cpp31
2 files changed, 9 insertions, 24 deletions
diff --git a/tools/llvm-extract/Makefile b/tools/llvm-extract/Makefile
index 51416c6426..fafa1cb4cd 100644
--- a/tools/llvm-extract/Makefile
+++ b/tools/llvm-extract/Makefile
@@ -10,6 +10,6 @@
LEVEL = ../..
TOOLNAME = llvm-extract
-LINK_COMPONENTS := bcreader bcwriter ipo bitreader bitwriter
+LINK_COMPONENTS := ipo bitreader bitwriter
include $(LEVEL)/Makefile.common
diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp
index 60171c10e2..97c45f6dcc 100644
--- a/tools/llvm-extract/llvm-extract.cpp
+++ b/tools/llvm-extract/llvm-extract.cpp
@@ -15,23 +15,17 @@
#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Bytecode/Reader.h"
-#include "llvm/Bytecode/WriteBytecodePass.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compressor.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/Streams.h"
#include "llvm/System/Signals.h"
#include <iostream>
#include <memory>
#include <fstream>
using namespace llvm;
-cl::opt<bool> Bitcode("bitcode");
-
// InputFilename - The filename to read from.
static cl::opt<std::string>
InputFilename(cl::Positional, cl::desc("<input bytecode file>"),
@@ -63,20 +57,15 @@ int main(int argc, char **argv) {
std::auto_ptr<Module> M;
- if (Bitcode) {
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&InputFilename[0],
- InputFilename.size());
- if (Buffer == 0) {
- cerr << "Error reading file '" + InputFilename + "'";
- return 1;
- } else {
- M.reset(ParseBitcodeFile(Buffer));
- }
- delete Buffer;
+ MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&InputFilename[0],
+ InputFilename.size());
+ if (Buffer == 0) {
+ cerr << "Error reading file '" + InputFilename + "'";
+ return 1;
} else {
- M.reset(ParseBytecodeFile(InputFilename,
- Compressor::decompressToNewBuffer));
+ M.reset(ParseBitcodeFile(Buffer));
}
+ delete Buffer;
if (M.get() == 0) {
cerr << argv[0] << ": bytecode didn't read correctly.\n";
@@ -120,11 +109,7 @@ int main(int argc, char **argv) {
Out = &std::cout;
}
- OStream L(*Out);
- if (Bitcode)
- Passes.add(CreateBitcodeWriterPass(*Out));
- else
- Passes.add(new WriteBytecodePass(&L)); // Write bytecode to file...
+ Passes.add(CreateBitcodeWriterPass(*Out));
Passes.run(*M.get());
if (Out != &std::cout)