mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
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:
@ -18,7 +18,6 @@
|
||||
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Bitcode/ReaderWriter.h"
|
||||
#include "llvm/Bytecode/Reader.h"
|
||||
#include "llvm/Analysis/Verifier.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/ManagedStatic.h"
|
||||
@ -31,8 +30,6 @@
|
||||
#include <memory>
|
||||
using namespace llvm;
|
||||
|
||||
cl::opt<bool> Bitcode("bitcode");
|
||||
|
||||
static cl::opt<std::string>
|
||||
InputFilename(cl::Positional, cl::desc("<input LLVM bytecode file>"),
|
||||
cl::init("-"));
|
||||
@ -54,18 +51,12 @@ int main(int argc, char **argv) {
|
||||
std::string ErrorMessage;
|
||||
|
||||
std::auto_ptr<Module> M;
|
||||
if (Bitcode) {
|
||||
std::auto_ptr<MemoryBuffer> Buffer(
|
||||
MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size()));
|
||||
if (Buffer.get())
|
||||
M.reset(ParseBitcodeFile(Buffer.get(), &ErrorMessage));
|
||||
else
|
||||
ErrorMessage = "Error reading file '" + InputFilename + "'";
|
||||
} else {
|
||||
M.reset(ParseBytecodeFile(InputFilename,
|
||||
Compressor::decompressToNewBuffer,
|
||||
&ErrorMessage));
|
||||
}
|
||||
std::auto_ptr<MemoryBuffer> Buffer(
|
||||
MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size()));
|
||||
if (Buffer.get())
|
||||
M.reset(ParseBitcodeFile(Buffer.get(), &ErrorMessage));
|
||||
else
|
||||
ErrorMessage = "Error reading file '" + InputFilename + "'";
|
||||
if (M.get() == 0) {
|
||||
std::cerr << argv[0] << ": ";
|
||||
if (ErrorMessage.size())
|
||||
|
Reference in New Issue
Block a user