[llvm] r285929 - Move function out of line. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 3 09:24:35 PDT 2016
Author: rafael
Date: Thu Nov 3 11:24:35 2016
New Revision: 285929
URL: http://llvm.org/viewvc/llvm-project?rev=285929&view=rev
Log:
Move function out of line. NFC.
Modified:
llvm/trunk/include/llvm/Object/ELF.h
Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=285929&r1=285928&r2=285929&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Thu Nov 3 11:24:35 2016
@@ -156,15 +156,7 @@ public:
ErrorOr<const Elf_Shdr *> getSection(uint32_t Index) const;
ErrorOr<const Elf_Sym *> 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<StringRef> getSectionName(const Elf_Shdr *Section) const;
ErrorOr<StringRef> getSectionName(const Elf_Shdr *Section,
@@ -238,6 +230,18 @@ ELFFile<ELFT>::getSection(const Elf_Sym
}
template <class ELFT>
+ErrorOr<const typename ELFT::Sym *>
+ELFFile<ELFT>::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 <class ELFT>
template <typename T>
ErrorOr<ArrayRef<T>>
ELFFile<ELFT>::getSectionContentsAsArray(const Elf_Shdr *Sec) const {
More information about the llvm-commits
mailing list