diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-16 16:23:38 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-16 16:23:38 +0000 |
commit | fe068b3c36797848aed8cf90cdd38338258191c9 (patch) | |
tree | f087ba4e337894f45fc407a9927ce8bb53c9edb6 /tools | |
parent | 7aa48441911e903803b75dfbcc148fbf80113819 (diff) |
llvm-dis: Simplify MemoryBuffer usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-dis/llvm-dis.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp index 43e05d77e0..1d36188517 100644 --- a/tools/llvm-dis/llvm-dis.cpp +++ b/tools/llvm-dis/llvm-dis.cpp @@ -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] << ": "; |