aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp')
-rw-r--r--tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
index dfdaa03..15567cf 100644
--- a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
+++ b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
@@ -38,10 +38,10 @@
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/system_error.h"
#include <algorithm>
#include <cctype>
#include <map>
+#include <system_error>
using namespace llvm;
static cl::opt<std::string>
@@ -478,11 +478,11 @@ static void PrintSize(uint64_t Bits) {
/// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename.
static int AnalyzeBitcode() {
// Read the input file.
- std::unique_ptr<MemoryBuffer> MemBuf;
-
- if (error_code ec =
- MemoryBuffer::getFileOrSTDIN(InputFilename, MemBuf))
- return Error("Error reading '" + InputFilename + "': " + ec.message());
+ ErrorOr<std::unique_ptr<MemoryBuffer>> MemBufOrErr =
+ MemoryBuffer::getFileOrSTDIN(InputFilename);
+ if (std::error_code EC = MemBufOrErr.getError())
+ return Error("Error reading '" + InputFilename + "': " + EC.message());
+ std::unique_ptr<MemoryBuffer> MemBuf = std::move(MemBufOrErr.get());
if (MemBuf->getBufferSize() & 3)
return Error("Bitcode stream should be a multiple of 4 bytes in length");