[lld] r247691 - Replace isa+cast with dyn_cast. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 07:08:12 PDT 2015


Author: rafael
Date: Tue Sep 15 09:08:11 2015
New Revision: 247691

URL: http://llvm.org/viewvc/llvm-project?rev=247691&view=rev
Log:
Replace isa+cast with dyn_cast. 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=247691&r1=247690&r2=247691&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Sep 15 09:08:11 2015
@@ -478,12 +478,13 @@ template <class ELFT> void OutputSection
         if (!Body)
           continue;
         // Skip unsupported for now.
-        if (!isa<DefinedRegular<ELFT>>(Body))
+        auto *DR = dyn_cast<DefinedRegular<ELFT>>(Body);
+        if (!DR)
           continue;
         uintX_t Offset = RI.r_offset;
         uint32_t Type = RI.getType(EObj->isMips64EL());
         uintX_t P = this->getVA() + C->getOutputSectionOff();
-        uintX_t SymVA = getSymVA<ELFT>(cast<DefinedRegular<ELFT>>(Body));
+        uintX_t SymVA = getSymVA<ELFT>(DR);
         uint8_t *Location = Base + Offset;
         switch (Type) {
         case llvm::ELF::R_X86_64_PC32:




More information about the llvm-commits mailing list