[lld] r304330 - Simplify. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 12:26:38 PDT 2017


Author: rafael
Date: Wed May 31 14:26:37 2017
New Revision: 304330

URL: http://llvm.org/viewvc/llvm-project?rev=304330&view=rev
Log:
Simplify. NFC.

Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=304330&r1=304329&r2=304330&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed May 31 14:26:37 2017
@@ -765,8 +765,7 @@ static uint64_t getMipsPageCount(uint64_
 
 uint64_t MipsGotSection::getPageEntryOffset(const SymbolBody &B,
                                             int64_t Addend) const {
-  const OutputSection *OutSec =
-      cast<DefinedRegular>(&B)->Section->getOutputSection();
+  const OutputSection *OutSec = B.getOutputSection();
   uint64_t SecAddr = getMipsPageAddr(OutSec->Addr);
   uint64_t SymAddr = getMipsPageAddr(B.getVA(Addend));
   uint64_t Index = PageIndexMap.lookup(OutSec) + (SymAddr - SecAddr) / 0xffff;
@@ -1343,8 +1342,7 @@ size_t SymbolTableBaseSection::getSymbol
     // This is used for -r, so we have to handle multiple section
     // symbols being combined.
     if (Body->Type == STT_SECTION && E.Symbol->Type == STT_SECTION)
-      return cast<DefinedRegular>(Body)->Section->getOutputSection() ==
-             cast<DefinedRegular>(E.Symbol)->Section->getOutputSection();
+      return Body->getOutputSection() == E.Symbol->getOutputSection();
     return false;
   });
   if (I == Symbols.end())




More information about the llvm-commits mailing list