diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-07-06 17:43:24 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-07-06 17:43:24 +0000 |
| commit | 860df574e7a0a3f1c4fa1a2eb8280c20e7f02027 (patch) | |
| tree | f97d1b48f6127f8ccc873b6d81bd7b1e550f9a2c /lib/Serialization/GlobalModuleIndex.cpp | |
| parent | bdb203a06d6972522eb56cf583421a20ebda4228 (diff) | |
| download | clang-860df574e7a0a3f1c4fa1a2eb8280c20e7f02027.tar.gz | |
Update for llvm api change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/GlobalModuleIndex.cpp')
| -rw-r--r-- | lib/Serialization/GlobalModuleIndex.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<llvm::MemoryBuffer> Buffer; - if (llvm::MemoryBuffer::getFile(IndexPath.c_str(), Buffer)) + llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> BufferOrErr = + llvm::MemoryBuffer::getFile(IndexPath.c_str()); + if (!BufferOrErr) return std::make_pair(nullptr, EC_NotFound); + std::unique_ptr<llvm::MemoryBuffer> 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(), |
