summaryrefslogtreecommitdiff
path: root/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:29:14 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:29:14 +0000
commit3ff9563c3e391954b2e224afcf8b2b0fcc3888aa (patch)
treecccde9111a73ba5895f6cefbfb280290fa6c469d /tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
parentb29b20e7deb7297f6a10b2d6922feeca8c6df055 (diff)
downloadllvm-3ff9563c3e391954b2e224afcf8b2b0fcc3888aa.tar.gz
llvm-3ff9563c3e391954b2e224afcf8b2b0fcc3888aa.tar.bz2
llvm-3ff9563c3e391954b2e224afcf8b2b0fcc3888aa.tar.xz
MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp')
-rw-r--r--tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
index e6c82a326a..604477e79c 100644
--- a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
+++ b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
@@ -27,6 +27,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/ADT/OwningPtr.h"
#include "llvm/Analysis/Verifier.h"
#include "llvm/Bitcode/BitstreamReader.h"
#include "llvm/Bitcode/LLVMBitCodes.h"
@@ -58,7 +59,7 @@ static cl::opt<bool> NoHistogram("disable-histogram",
static cl::opt<bool>
NonSymbolic("non-symbolic",
- cl::desc("Emit numberic info in dump even if"
+ cl::desc("Emit numeric info in dump even if"
" symbolic info is available"));
namespace {
@@ -481,11 +482,10 @@ static void PrintSize(uint64_t Bits) {
/// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename.
static int AnalyzeBitcode() {
// Read the input file.
- error_code ec;
- MemoryBuffer *MemBuf =
- MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), ec);
+ OwningPtr<MemoryBuffer> MemBuf;
- if (MemBuf == 0)
+ if (error_code ec =
+ MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), MemBuf))
return Error("Error reading '" + InputFilename + "': " + ec.message());
if (MemBuf->getBufferSize() & 3)