diff options
author | George Rimar <grimar@accesssoftek.com> | 2019-08-09 10:53:12 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2019-08-09 10:53:12 +0000 |
commit | e3d81fdf6f019c4774f8f513d880fcdd4f3a0239 (patch) | |
tree | 53edacd88216b454b9bd53ab1f7a35a3afdb8991 /llvm/tools/llvm-readobj/ARMEHABIPrinter.h | |
parent | ac42e741e01b0c2d91c3ae1d92a5b9685a05baf7 (diff) | |
download | bcm5719-llvm-e3d81fdf6f019c4774f8f513d880fcdd4f3a0239.tar.gz bcm5719-llvm-e3d81fdf6f019c4774f8f513d880fcdd4f3a0239.zip |
[llvm-readobj] - Remove deprecated unwrapOrError(Expected<T> EO).
This patch changes the code to use a modern unwrapOrError(StringRef Input, Expected<T> EO)
version that contains the input source name and removes the deprecated version.
Differential revision: https://reviews.llvm.org/D65946
llvm-svn: 368428
Diffstat (limited to 'llvm/tools/llvm-readobj/ARMEHABIPrinter.h')
-rw-r--r-- | llvm/tools/llvm-readobj/ARMEHABIPrinter.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/tools/llvm-readobj/ARMEHABIPrinter.h b/llvm/tools/llvm-readobj/ARMEHABIPrinter.h index 11f9d6166a5..df05f272d39 100644 --- a/llvm/tools/llvm-readobj/ARMEHABIPrinter.h +++ b/llvm/tools/llvm-readobj/ARMEHABIPrinter.h @@ -329,6 +329,7 @@ class PrinterContext { ScopedPrinter &SW; const object::ELFFile<ET> *ELF; + StringRef FileName; const Elf_Shdr *Symtab; ArrayRef<Elf_Word> ShndxTable; @@ -352,8 +353,8 @@ class PrinterContext { public: PrinterContext(ScopedPrinter &SW, const object::ELFFile<ET> *ELF, - const Elf_Shdr *Symtab) - : SW(SW), ELF(ELF), Symtab(Symtab) {} + StringRef FileName, const Elf_Shdr *Symtab) + : SW(SW), ELF(ELF), FileName(FileName), Symtab(Symtab) {} void PrintUnwindInformation() const; }; @@ -372,7 +373,7 @@ PrinterContext<ET>::FunctionAtAddress(unsigned Section, error(StrTableOrErr.takeError()); StringRef StrTable = *StrTableOrErr; - for (const Elf_Sym &Sym : unwrapOrError(ELF->symbols(Symtab))) + for (const Elf_Sym &Sym : unwrapOrError(FileName, ELF->symbols(Symtab))) if (Sym.st_shndx == Section && Sym.st_value == Address && Sym.getType() == ELF::STT_FUNC) { auto NameOrErr = Sym.getName(StrTable); @@ -398,7 +399,7 @@ PrinterContext<ET>::FindExceptionTable(unsigned IndexSectionIndex, /// handling table. Use this symbol to recover the actual exception handling /// table. - for (const Elf_Shdr &Sec : unwrapOrError(ELF->sections())) { + for (const Elf_Shdr &Sec : unwrapOrError(FileName, ELF->sections())) { if (Sec.sh_type != ELF::SHT_REL || Sec.sh_info != IndexSectionIndex) continue; @@ -407,7 +408,7 @@ PrinterContext<ET>::FindExceptionTable(unsigned IndexSectionIndex, error(SymTabOrErr.takeError()); const Elf_Shdr *SymTab = *SymTabOrErr; - for (const Elf_Rel &R : unwrapOrError(ELF->rels(&Sec))) { + for (const Elf_Rel &R : unwrapOrError(FileName, ELF->rels(&Sec))) { if (R.r_offset != static_cast<unsigned>(IndexTableOffset)) continue; @@ -417,7 +418,7 @@ PrinterContext<ET>::FindExceptionTable(unsigned IndexSectionIndex, RelA.r_addend = 0; const Elf_Sym *Symbol = - unwrapOrError(ELF->getRelocationSymbol(&RelA, SymTab)); + unwrapOrError(FileName, ELF->getRelocationSymbol(&RelA, SymTab)); auto Ret = ELF->getSection(Symbol, SymTab, ShndxTable); if (!Ret) @@ -570,7 +571,7 @@ void PrinterContext<ET>::PrintUnwindInformation() const { DictScope UI(SW, "UnwindInformation"); int SectionIndex = 0; - for (const Elf_Shdr &Sec : unwrapOrError(ELF->sections())) { + for (const Elf_Shdr &Sec : unwrapOrError(FileName, ELF->sections())) { if (Sec.sh_type == ELF::SHT_ARM_EXIDX) { DictScope UIT(SW, "UnwindIndexTable"); |