SectionRef::getName() was changed to return Expected<> (D66089)
llvm-svn: 368825
// 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;