Inline a small function. NFC.

llvm-svn: 299590
This commit is contained in:
Rui Ueyama 2017-04-05 21:08:47 +00:00
parent 1ec5dd85a2
commit f2dc4362c0
1 changed files with 2 additions and 8 deletions

View File

@ -1628,12 +1628,6 @@ template <class ELFT> typename ELFT::uint Writer<ELFT>::getEntryAddr() {
return 0;
}
template <class ELFT> static uint8_t getELFEncoding() {
if (ELFT::TargetEndianness == llvm::support::little)
return ELFDATA2LSB;
return ELFDATA2MSB;
}
static uint16_t getELFType() {
if (Config->Pic)
return ET_DYN;
@ -1705,8 +1699,8 @@ template <class ELFT> void Writer<ELFT>::writeHeader() {
// Write the ELF header.
auto *EHdr = reinterpret_cast<Elf_Ehdr *>(Buf);
EHdr->e_ident[EI_CLASS] = ELFT::Is64Bits ? ELFCLASS64 : ELFCLASS32;
EHdr->e_ident[EI_DATA] = getELFEncoding<ELFT>();
EHdr->e_ident[EI_CLASS] = Config->Is64 ? ELFCLASS64 : ELFCLASS32;
EHdr->e_ident[EI_DATA] = Config->IsLE ? ELFDATA2LSB : ELFDATA2MSB;
EHdr->e_ident[EI_VERSION] = EV_CURRENT;
EHdr->e_ident[EI_OSABI] = Config->OSABI;
EHdr->e_type = getELFType();