[lld] r338723 - [LLD][ELF] - Remove dead check from adjustSplitStackFunctionPrologues().

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 07:44:39 PDT 2018


Author: grimar
Date: Thu Aug  2 07:44:39 2018
New Revision: 338723

URL: http://llvm.org/viewvc/llvm-project?rev=338723&view=rev
Log:
[LLD][ELF] - Remove dead check from adjustSplitStackFunctionPrologues().

In according to the comment, undefined symbol should never reach there.
So, should be able to remove the check. I am assuming this is NFC. 

Modified:
    lld/trunk/ELF/InputSection.cpp

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=338723&r1=338722&r2=338723&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Thu Aug  2 07:44:39 2018
@@ -888,13 +888,8 @@ void InputSectionBase::adjustSplitStackF
     if (Rel.Sym->isLocal())
       continue;
 
-    Defined *D = dyn_cast<Defined>(Rel.Sym);
-    // A reference to an undefined symbol was an error, and should not
-    // have gotten to this point.
-    if (!D)
-      continue;
-
     // Ignore calls into the split-stack api.
+    Defined *D = cast<Defined>(Rel.Sym);
     if (D->getName().startswith("__morestack")) {
       if (D->getName().equals("__morestack"))
         MorestackCalls.push_back(&Rel);




More information about the llvm-commits mailing list