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
// 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;
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;