From e91b7e8657280fffb0f2e156857a552ee09acf45 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 3 Nov 2016 16:24:35 +0000 Subject: [PATCH] Move function out of line. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285929 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Object/ELF.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h index ef01735f13d..998e693770d 100644 --- a/include/llvm/Object/ELF.h +++ b/include/llvm/Object/ELF.h @@ -156,15 +156,7 @@ public: ErrorOr getSection(uint32_t Index) const; ErrorOr getSymbol(const Elf_Shdr *Sec, - uint32_t Index) const { - auto SymtabOrErr = symbols(Sec); - if (std::error_code EC = SymtabOrErr.getError()) - return EC; - Elf_Sym_Range Symbols = *SymtabOrErr; - if (Index >= Symbols.size()) - return object_error::invalid_symbol_index; - return &Symbols[Index]; - } + uint32_t Index) const; ErrorOr getSectionName(const Elf_Shdr *Section) const; ErrorOr getSectionName(const Elf_Shdr *Section, @@ -237,6 +229,18 @@ ELFFile::getSection(const Elf_Sym *Sym, const Elf_Shdr *SymTab, return object::getSection(*SectionsOrErr, Index); } +template +ErrorOr +ELFFile::getSymbol(const Elf_Shdr *Sec, uint32_t Index) const { + auto SymtabOrErr = symbols(Sec); + if (std::error_code EC = SymtabOrErr.getError()) + return EC; + Elf_Sym_Range Symbols = *SymtabOrErr; + if (Index >= Symbols.size()) + return object_error::invalid_symbol_index; + return &Symbols[Index]; +} + template template ErrorOr> -- 2.40.0