[lld] r299208 - Remove unnecessary cast and branch. NFC.

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 05:31:25 PDT 2017


Author: jhenderson
Date: Fri Mar 31 07:31:23 2017
New Revision: 299208

URL: http://llvm.org/viewvc/llvm-project?rev=299208&view=rev
Log:
Remove unnecessary cast and branch. NFC.

Modified:
    lld/trunk/ELF/Relocations.cpp

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=299208&r1=299207&r2=299208&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Fri Mar 31 07:31:23 2017
@@ -1003,11 +1003,7 @@ bool elf::createThunks(ArrayRef<OutputSe
   // We separate the creation of ThunkSections from the insertion of the
   // ThunkSections back into the OutputSection as ThunkSections are not always
   // inserted into the same OutputSection as the caller.
-  for (OutputSection *Base : OutputSections) {
-    auto *OS = dyn_cast<OutputSection>(Base);
-    if (OS == nullptr)
-      continue;
-
+  for (OutputSection *OS : OutputSections) {
     ThunkSection *OSTS = nullptr;
     for (InputSection *IS : OS->Sections) {
       for (Relocation &Rel : IS->Relocations) {




More information about the llvm-commits mailing list