X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FGCOV.cpp;h=1667401f88d0c1bed672d21e530a65d5541ad83b;hb=0cccab7515080b5a9b3efd23ee19343e05fa4453;hp=f2099d6baf132d6aef5608ddd8c879b815b7cf42;hpb=459a8aaee2e590e54fb94708c147a9248777c899;p=oota-llvm.git diff --git a/lib/IR/GCOV.cpp b/lib/IR/GCOV.cpp index f2099d6baf1..1667401f88d 100644 --- a/lib/IR/GCOV.cpp +++ b/lib/IR/GCOV.cpp @@ -19,8 +19,8 @@ #include "llvm/Support/Format.h" #include "llvm/Support/MemoryObject.h" #include "llvm/Support/Path.h" -#include "llvm/Support/system_error.h" #include +#include using namespace llvm; //===----------------------------------------------------------------------===// @@ -438,11 +438,15 @@ class LineConsumer { StringRef Remaining; public: LineConsumer(StringRef Filename) { - if (error_code EC = MemoryBuffer::getFileOrSTDIN(Filename, Buffer)) { + ErrorOr> BufferOrErr = + MemoryBuffer::getFileOrSTDIN(Filename); + if (std::error_code EC = BufferOrErr.getError()) { errs() << Filename << ": " << EC.message() << "\n"; Remaining = ""; - } else + } else { + Buffer = std::move(BufferOrErr.get()); Remaining = Buffer->getBuffer(); + } } bool empty() { return Remaining.empty(); } void printNext(raw_ostream &OS, uint32_t LineNum) {