[lld] 8d01ac7 - [ELF] Replace an unneeded dyn_cast_or_null with dyn_cast. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 28 00:50:11 PST 2022


Author: Fangrui Song
Date: 2022-02-28T00:50:06-08:00
New Revision: 8d01ac75e7f33be0c17ea24cb43e96b777eb642e

URL: https://github.com/llvm/llvm-project/commit/8d01ac75e7f33be0c17ea24cb43e96b777eb642e
DIFF: https://github.com/llvm/llvm-project/commit/8d01ac75e7f33be0c17ea24cb43e96b777eb642e.diff

LOG: [ELF] Replace an unneeded dyn_cast_or_null with dyn_cast. NFC

Added: 
    

Modified: 
    lld/ELF/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 62c4d0b5a366e..b9d118488b863 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1429,7 +1429,7 @@ template <class ELFT> void Writer<ELFT>::sortSections() {
   sortInputSections();
 
   for (SectionCommand *cmd : script->sectionCommands)
-    if (auto *osec = dyn_cast_or_null<OutputSection>(cmd))
+    if (auto *osec = dyn_cast<OutputSection>(cmd))
       osec->sortRank = getSectionRank(osec);
   if (!script->hasSectionsCommand) {
     // We know that all the OutputSections are contiguous in this case.


        


More information about the llvm-commits mailing list