]> granicus.if.org Git - clang/commitdiff
[clang] - An update after LLVM change.
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 14 Aug 2019 11:10:01 +0000 (11:10 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 14 Aug 2019 11:10:01 +0000 (11:10 +0000)
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

lib/CodeGen/ObjectFilePCHContainerOperations.cpp
tools/clang-offload-bundler/ClangOffloadBundler.cpp

index 15a2ab99fdac20ac251c6b5166da88ffeb3883e7..e9b7b369513bed90dbf454432d804bd7c9f1133d 100644 (file)
@@ -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;
index 2a31f673a07069cecf219865dcc8e80af1ba98c2..a4ee282c4bd92c76c7d41e0176dfbd59ce1218c2 100644 (file)
@@ -390,7 +390,10 @@ class ObjectFileHandler final : public FileHandler {
   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;