[lld] r305112 - Simplify. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 9 14:09:08 PDT 2017
Author: ruiu
Date: Fri Jun 9 16:09:08 2017
New Revision: 305112
URL: http://llvm.org/viewvc/llvm-project?rev=305112&view=rev
Log:
Simplify. NFC.
Modified:
lld/trunk/ELF/Symbols.cpp
Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=305112&r1=305111&r2=305112&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Fri Jun 9 16:09:08 2017
@@ -264,15 +264,14 @@ Defined::Defined(Kind K, StringRefZ Name
: SymbolBody(K, Name, IsLocal, StOther, Type) {}
template <class ELFT> bool DefinedRegular::isMipsPIC() const {
+ typedef typename ELFT::Ehdr Elf_Ehdr;
if (!Section || !isFunc())
return false;
+
+ auto *Sec = cast<InputSectionBase>(Section);
+ const Elf_Ehdr *Hdr = Sec->template getFile<ELFT>()->getObj().getHeader();
return (this->StOther & STO_MIPS_MIPS16) == STO_MIPS_PIC ||
- (cast<InputSectionBase>(Section)
- ->template getFile<ELFT>()
- ->getObj()
- .getHeader()
- ->e_flags &
- EF_MIPS_PIC);
+ (Hdr->e_flags & EF_MIPS_PIC);
}
Undefined::Undefined(StringRefZ Name, bool IsLocal, uint8_t StOther,
More information about the llvm-commits
mailing list