Revert r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"

It broke clang BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/16455



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368813 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
George Rimar
2019-08-14 08:56:55 +00:00
parent 0d8949846a
commit 899e01b67d
40 changed files with 240 additions and 423 deletions
+2 -6
View File
@@ -392,13 +392,9 @@ ELFObjectFileBase::getPltAddresses() const {
return {};
Optional<SectionRef> Plt = None, RelaPlt = None, GotPlt = None;
for (const SectionRef &Section : sections()) {
Expected<StringRef> NameOrErr = Section.getName();
if (!NameOrErr) {
consumeError(NameOrErr.takeError());
StringRef Name;
if (Section.getName(Name))
continue;
}
StringRef Name = *NameOrErr;
if (Name == ".plt")
Plt = Section;
else if (Name == ".rela.plt" || Name == ".rel.plt")