summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-08-14 11:10:01 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-08-14 11:10:01 +0000
commit67694d35548b9752eab26b002e9d0f63111354f8 (patch)
tree6bd17ecb8cdad4bb238ce6d9ac939f5744b2698f /lib/CodeGen/ObjectFilePCHContainerOperations.cpp
parent5875aeb9efc4aca90b17fc1182ef226bb31f61f7 (diff)
downloadclang-67694d35548b9752eab26b002e9d0f63111354f8.tar.gz
[clang] - An update after LLVM change.
SectionRef::getName() was changed to return Expected<> (D66089) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
-rw-r--r--lib/CodeGen/ObjectFilePCHContainerOperations.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
index 15a2ab99fd..e9b7b36951 100644
--- a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
+++ b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
@@ -335,7 +335,11 @@ ObjectFilePCHContainerReader::ExtractPCH(llvm::MemoryBufferRef Buffer) const {
// Find the clang AST section in the container.
for (auto &Section : OF->sections()) {
StringRef Name;
- Section.getName(Name);
+ if (Expected<StringRef> NameOrErr = Section.getName())
+ Name = *NameOrErr;
+ else
+ consumeError(NameOrErr.takeError());
+
if ((!IsCOFF && Name == "__clangast") || (IsCOFF && Name == "clangast")) {
if (Expected<StringRef> E = Section.getContents())
return *E;