switch tools to bitcode instead of bytecode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36868 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2007-05-06 09:29:57 +00:00
parent 4bcca0f2ac
commit 44dadffe4b
22 changed files with 69 additions and 235 deletions
+7 -15
View File
@@ -17,7 +17,6 @@
#include "llvm/Module.h"
#include "llvm/Assembly/AsmAnnotationWriter.h"
#include "llvm/Analysis/ProfileInfoLoader.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
@@ -32,7 +31,6 @@
using namespace llvm;
namespace {
cl::opt<bool> Bitcode("bitcode");
cl::opt<std::string>
BytecodeFile(cl::Positional, cl::desc("<program bytecode file>"),
cl::Required);
@@ -120,19 +118,13 @@ int main(int argc, char **argv) {
// Read in the bytecode file...
std::string ErrorMessage;
Module *M;
if (Bitcode) {
MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&BytecodeFile[0],
BytecodeFile.size());
if (Buffer == 0)
ErrorMessage = "Error reading file '" + BytecodeFile + "'";
else
M = ParseBitcodeFile(Buffer, &ErrorMessage);
delete Buffer;
} else {
M = ParseBytecodeFile(BytecodeFile,
Compressor::decompressToNewBuffer,
&ErrorMessage);
}
MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&BytecodeFile[0],
BytecodeFile.size());
if (Buffer == 0)
ErrorMessage = "Error reading file '" + BytecodeFile + "'";
else
M = ParseBitcodeFile(Buffer, &ErrorMessage);
delete Buffer;
if (M == 0) {
std::cerr << argv[0] << ": " << BytecodeFile << ": "
<< ErrorMessage << "\n";