[llvm-commits] CVS: llvm/tools/llvm-link/Makefile llvm-link.cpp
Chris Lattner
sabre at nondot.org
Sun May 6 02:31:07 PDT 2007
Changes in directory llvm/tools/llvm-link:
Makefile updated: 1.16 -> 1.17
llvm-link.cpp updated: 1.64 -> 1.65
---
Log message:
switch tools to bitcode instead of bytecode
---
Diffs of the changes: (+10 -26)
Makefile | 2 +-
llvm-link.cpp | 34 +++++++++-------------------------
2 files changed, 10 insertions(+), 26 deletions(-)
Index: llvm/tools/llvm-link/Makefile
diff -u llvm/tools/llvm-link/Makefile:1.16 llvm/tools/llvm-link/Makefile:1.17
--- llvm/tools/llvm-link/Makefile:1.16 Sun May 6 00:08:22 2007
+++ llvm/tools/llvm-link/Makefile Sun May 6 04:29:57 2007
@@ -9,6 +9,6 @@
LEVEL = ../..
TOOLNAME = llvm-link
-LINK_COMPONENTS = linker bcreader bcwriter bitreader bitwriter
+LINK_COMPONENTS = linker bitreader bitwriter
include $(LEVEL)/Makefile.common
Index: llvm/tools/llvm-link/llvm-link.cpp
diff -u llvm/tools/llvm-link/llvm-link.cpp:1.64 llvm/tools/llvm-link/llvm-link.cpp:1.65
--- llvm/tools/llvm-link/llvm-link.cpp:1.64 Sun May 6 00:08:22 2007
+++ llvm/tools/llvm-link/llvm-link.cpp Sun May 6 04:29:57 2007
@@ -16,12 +16,9 @@
#include "llvm/Module.h"
#include "llvm/Analysis/Verifier.h"
#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Bytecode/Reader.h"
-#include "llvm/Bytecode/Writer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/Streams.h"
#include "llvm/System/Signals.h"
#include "llvm/System/Path.h"
#include <fstream>
@@ -29,8 +26,6 @@
#include <memory>
using namespace llvm;
-cl::opt<bool> Bitcode("bitcode");
-
static cl::list<std::string>
InputFilenames(cl::Positional, cl::OneOrMore,
cl::desc("<input bytecode files>"));
@@ -65,20 +60,14 @@
if (Verbose) cerr << "Loading '" << Filename.c_str() << "'\n";
Module* Result = 0;
- if (Bitcode) {
- const std::string &FNStr = Filename.toString();
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&FNStr[0],
- FNStr.size());
- if (Buffer == 0)
- ErrorMessage = "Error reading file '" + FNStr + "'";
- else
- Result = ParseBitcodeFile(Buffer, &ErrorMessage);
- delete Buffer;
- } else {
- Result = ParseBytecodeFile(Filename.toString(),
- Compressor::decompressToNewBuffer,
- &ErrorMessage);
- }
+ const std::string &FNStr = Filename.toString();
+ MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&FNStr[0],
+ FNStr.size());
+ if (Buffer == 0)
+ ErrorMessage = "Error reading file '" + FNStr + "'";
+ else
+ Result = ParseBitcodeFile(Buffer, &ErrorMessage);
+ delete Buffer;
if (Result) return std::auto_ptr<Module>(Result); // Load successful!
if (Verbose) {
@@ -159,12 +148,7 @@
}
if (Verbose) cerr << "Writing bytecode...\n";
- if (Bitcode) {
- WriteBitcodeToFile(Composite.get(), *Out);
- } else {
- OStream L(*Out);
- WriteBytecodeToFile(Composite.get(), L, !NoCompress);
- }
+ WriteBitcodeToFile(Composite.get(), *Out);
if (Out != &std::cout) delete Out;
return 0;
More information about the llvm-commits
mailing list