[lld] r276176 - [ELF][MIPS] Omit redundant arguments in the `getMipsEFlags` function. NFC
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 20 13:30:41 PDT 2016
Author: atanasyan
Date: Wed Jul 20 15:30:41 2016
New Revision: 276176
URL: http://llvm.org/viewvc/llvm-project?rev=276176&view=rev
Log:
[ELF][MIPS] Omit redundant arguments in the `getMipsEFlags` function. NFC
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=276176&r1=276175&r2=276176&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed Jul 20 15:30:41 2016
@@ -1166,15 +1166,14 @@ template <class ELFT> void Writer<ELFT>:
}
}
-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>:
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);
More information about the llvm-commits
mailing list