llvm.org GIT mirror llvm / e91b7e8
Move function out of line. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285929 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 3 years ago
1 changed file(s) with 13 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
155155 ErrorOr getSection(uint32_t Index) const;
156156
157157 ErrorOr getSymbol(const Elf_Shdr *Sec,
158 uint32_t Index) const {
159 auto SymtabOrErr = symbols(Sec);
160 if (std::error_code EC = SymtabOrErr.getError())
161 return EC;
162 Elf_Sym_Range Symbols = *SymtabOrErr;
163 if (Index >= Symbols.size())
164 return object_error::invalid_symbol_index;
165 return &Symbols[Index];
166 }
158 uint32_t Index) const;
167159
168160 ErrorOr getSectionName(const Elf_Shdr *Section) const;
169161 ErrorOr getSectionName(const Elf_Shdr *Section,
234226 if (std::error_code EC = SectionsOrErr.getError())
235227 return EC;
236228 return object::getSection(*SectionsOrErr, Index);
229 }
230
231 template
232 ErrorOr
233 ELFFile::getSymbol(const Elf_Shdr *Sec, uint32_t Index) const {
234 auto SymtabOrErr = symbols(Sec);
235 if (std::error_code EC = SymtabOrErr.getError())
236 return EC;
237 Elf_Sym_Range Symbols = *SymtabOrErr;
238 if (Index >= Symbols.size())
239 return object_error::invalid_symbol_index;
240 return &Symbols[Index];
237241 }
238242
239243 template