mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-29 14:40:39 +00:00
teach llvm-dis to read bitcode files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36334 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
27bb3af61c
commit
b3ca3622bb
@ -9,7 +9,7 @@
|
||||
LEVEL = ../..
|
||||
|
||||
TOOLNAME = llvm-dis
|
||||
LINK_COMPONENTS := bcreader
|
||||
LINK_COMPONENTS := bcreader bitreader
|
||||
REQUIRES_EH := 1
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/PassManager.h"
|
||||
#include "llvm/Bitcode/ReaderWriter.h"
|
||||
#include "llvm/Bytecode/Reader.h"
|
||||
#include "llvm/Assembly/PrintModulePass.h"
|
||||
#include "llvm/Support/Compressor.h"
|
||||
@ -52,9 +53,13 @@ int main(int argc, char **argv) {
|
||||
std::ostream *Out = &std::cout; // Default to printing to stdout.
|
||||
std::string ErrorMessage;
|
||||
|
||||
std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename,
|
||||
Compressor::decompressToNewBuffer,
|
||||
&ErrorMessage));
|
||||
std::auto_ptr<Module> M;
|
||||
|
||||
M.reset(ParseBitcodeFile(InputFilename, &ErrorMessage));
|
||||
|
||||
if (M.get() == 0)
|
||||
M.reset(ParseBytecodeFile(InputFilename,Compressor::decompressToNewBuffer,
|
||||
&ErrorMessage));
|
||||
if (M.get() == 0) {
|
||||
cerr << argv[0] << ": ";
|
||||
if (ErrorMessage.size())
|
||||
|
Loading…
Reference in New Issue
Block a user