diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2016-07-20 20:30:41 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2016-07-20 20:30:41 +0000 |
| commit | 4f90c2f9df50d244a238e845c39886e8e6ddc2dd (patch) | |
| tree | c86e358fa4e1a1ebfbf1fb7e90e9d4710b203096 | |
| parent | 2197311c31ced1aff8d965294e190aaae1ac729b (diff) | |
| download | bcm5719-llvm-4f90c2f9df50d244a238e845c39886e8e6ddc2dd.tar.gz bcm5719-llvm-4f90c2f9df50d244a238e845c39886e8e6ddc2dd.zip | |
[ELF][MIPS] Omit redundant arguments in the `getMipsEFlags` function. NFC
llvm-svn: 276176
| -rw-r--r-- | lld/ELF/Writer.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index ceff38c4e68..7124c01caf2 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1166,15 +1166,14 @@ template <class ELFT> void Writer<ELFT>::setPhdrs() { } } -template <class ELFT> -static uint32_t getMipsEFlags(bool Is64Bits, - const ELFFileBase<ELFT> &FirstElf) { +template <class ELFT> static uint32_t getMipsEFlags() { // FIXME: ELF flags depends on ELF flags of all input object files and // selected emulation. For now pick the arch flag from the fisrt input file // and use hard coded values for other flags. - uint32_t FirstElfFlags = FirstElf.getObj().getHeader()->e_flags; + uint32_t FirstElfFlags = + cast<ELFFileBase<ELFT>>(Config->FirstElf)->getObj().getHeader()->e_flags; uint32_t ElfFlags = FirstElfFlags & EF_MIPS_ARCH; - if (Is64Bits) + if (ELFT::Is64Bits) ElfFlags |= EF_MIPS_CPIC | EF_MIPS_PIC; else { ElfFlags |= EF_MIPS_CPIC | EF_MIPS_ABI_O32; @@ -1258,7 +1257,7 @@ template <class ELFT> void Writer<ELFT>::writeHeader() { EHdr->e_shstrndx = Out<ELFT>::ShStrTab->SectionIndex; if (Config->EMachine == EM_MIPS) - EHdr->e_flags = getMipsEFlags(ELFT::Is64Bits, FirstObj); + EHdr->e_flags = getMipsEFlags<ELFT>(); if (!Config->Relocatable) { EHdr->e_phoff = sizeof(Elf_Ehdr); |

