From 860df574e7a0a3f1c4fa1a2eb8280c20e7f02027 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 6 Jul 2014 17:43:24 +0000 Subject: Update for llvm api change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212408 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Serialization/GlobalModuleIndex.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Serialization/GlobalModuleIndex.cpp') diff --git a/lib/Serialization/GlobalModuleIndex.cpp b/lib/Serialization/GlobalModuleIndex.cpp index a1bec89efb..9858122325 100644 --- a/lib/Serialization/GlobalModuleIndex.cpp +++ b/lib/Serialization/GlobalModuleIndex.cpp @@ -239,9 +239,11 @@ GlobalModuleIndex::readIndex(StringRef Path) { IndexPath += Path; llvm::sys::path::append(IndexPath, IndexFileName); - std::unique_ptr Buffer; - if (llvm::MemoryBuffer::getFile(IndexPath.c_str(), Buffer)) + llvm::ErrorOr> BufferOrErr = + llvm::MemoryBuffer::getFile(IndexPath.c_str()); + if (!BufferOrErr) return std::make_pair(nullptr, EC_NotFound); + std::unique_ptr Buffer = std::move(BufferOrErr.get()); /// \brief The bitstream reader from which we'll read the AST file. llvm::BitstreamReader Reader((const unsigned char *)Buffer->getBufferStart(), -- cgit v1.2.1