[lld] r319334 - Replace a dyn_cast with a cast.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 10:32:57 PST 2017


Author: rafael
Date: Wed Nov 29 10:32:57 2017
New Revision: 319334

URL: http://llvm.org/viewvc/llvm-project?rev=319334&view=rev
Log:
Replace a dyn_cast with a cast.

It is always accessed, so there is no value in a dyn_cast.

Modified:
    lld/trunk/ELF/Thunks.cpp

Modified: lld/trunk/ELF/Thunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Thunks.cpp?rev=319334&r1=319333&r2=319334&view=diff
==============================================================================
--- lld/trunk/ELF/Thunks.cpp (original)
+++ lld/trunk/ELF/Thunks.cpp Wed Nov 29 10:32:57 2017
@@ -322,8 +322,8 @@ void MipsThunk::addSymbols(ThunkSection
 }
 
 InputSection *MipsThunk::getTargetInputSection() const {
-  auto *DR = dyn_cast<Defined>(&Destination);
-  return dyn_cast<InputSection>(DR->Section);
+  auto &DR = cast<Defined>(Destination);
+  return dyn_cast<InputSection>(DR.Section);
 }
 
 // Write microMIPS R2-R5 LA25 thunk code




More information about the llvm-commits mailing list