diff options
Diffstat (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
-rw-r--r-- | clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index db53959ea0b..db6e73f4097 100644 --- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -337,8 +337,14 @@ ObjectFilePCHContainerReader::ExtractPCH(llvm::MemoryBufferRef Buffer) const { StringRef Name; Section.getName(Name); if ((!IsCOFF && Name == "__clangast") || (IsCOFF && Name == "clangast")) { - Section.getContents(PCH); - return PCH; + if (Expected<StringRef> E = Section.getContents()) + return *E; + else { + handleAllErrors(E.takeError(), [&](const llvm::ErrorInfoBase &EIB) { + EIB.log(llvm::errs()); + }); + return ""; + } } } } |