From: George Rimar Date: Wed, 14 Aug 2019 11:10:01 +0000 (+0000) Subject: [clang] - An update after LLVM change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67694d35548b9752eab26b002e9d0f63111354f8;p=clang [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 --- 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 NameOrErr = Section.getName()) + Name = *NameOrErr; + else + consumeError(NameOrErr.takeError()); + if ((!IsCOFF && Name == "__clangast") || (IsCOFF && Name == "clangast")) { if (Expected E = Section.getContents()) return *E; diff --git a/tools/clang-offload-bundler/ClangOffloadBundler.cpp b/tools/clang-offload-bundler/ClangOffloadBundler.cpp index 2a31f673a0..a4ee282c4b 100644 --- a/tools/clang-offload-bundler/ClangOffloadBundler.cpp +++ b/tools/clang-offload-bundler/ClangOffloadBundler.cpp @@ -390,7 +390,10 @@ class ObjectFileHandler final : public FileHandler { static bool IsOffloadSection(SectionRef CurSection, StringRef &OffloadTriple) { StringRef SectionName; - CurSection.getName(SectionName); + if (Expected NameOrErr = CurSection.getName()) + SectionName = *NameOrErr; + else + consumeError(NameOrErr.takeError()); if (SectionName.empty()) return false;