r368825 - [clang] - An update after LLVM change.
George Rimar via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 14 04:10:01 PDT 2019
Author: grimar
Date: Wed Aug 14 04:10:01 2019
New Revision: 368825
URL: http://llvm.org/viewvc/llvm-project?rev=368825&view=rev
Log:
[clang] - An update after LLVM change.
SectionRef::getName() was changed to return Expected<> (D66089)
Modified:
cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp
Modified: cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp?rev=368825&r1=368824&r2=368825&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp (original)
+++ cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp Wed Aug 14 04:10:01 2019
@@ -335,7 +335,11 @@ ObjectFilePCHContainerReader::ExtractPCH
// 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;
Modified: cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp?rev=368825&r1=368824&r2=368825&view=diff
==============================================================================
--- cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp (original)
+++ cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp Wed Aug 14 04:10:01 2019
@@ -390,7 +390,10 @@ class ObjectFileHandler final : public F
static bool IsOffloadSection(SectionRef CurSection,
StringRef &OffloadTriple) {
StringRef SectionName;
- CurSection.getName(SectionName);
+ if (Expected<StringRef> NameOrErr = CurSection.getName())
+ SectionName = *NameOrErr;
+ else
+ consumeError(NameOrErr.takeError());
if (SectionName.empty())
return false;
More information about the cfe-commits
mailing list