From 0e5df9fc156b248eecc1ac54ca51518de4d8914b 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. llvm-svn: 285929 --- llvm/include/llvm/Object/ELF.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h index ef01735f13d2..998e693770d6 100644 --- a/llvm/include/llvm/Object/ELF.h +++ b/llvm/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.34.1