mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
llvm-dis: Simplify MemoryBuffer usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121975 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7aa4844191
commit
fe068b3c36
@ -79,15 +79,13 @@ int main(int argc, char **argv) {
|
||||
cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n");
|
||||
|
||||
std::string ErrorMessage;
|
||||
error_code ec;
|
||||
std::auto_ptr<Module> M;
|
||||
OwningPtr<MemoryBuffer> BufferPtr;
|
||||
|
||||
if ((ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr)))
|
||||
if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))
|
||||
ErrorMessage = ec.message();
|
||||
else
|
||||
M.reset(ParseBitcodeFile(BufferPtr.get(), Context, &ErrorMessage));
|
||||
(void) BufferPtr.take();
|
||||
M.reset(ParseBitcodeFile(BufferPtr.take(), Context, &ErrorMessage));
|
||||
|
||||
if (M.get() == 0) {
|
||||
errs() << argv[0] << ": ";
|
||||
|
Loading…
Reference in New Issue
Block a user