[lld] r345208 - Do not call computeIsPreemptible() if its result is discarded. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 24 15:15:32 PDT 2018


Author: ruiu
Date: Wed Oct 24 15:15:32 2018
New Revision: 345208

URL: http://llvm.org/viewvc/llvm-project?rev=345208&view=rev
Log:
Do not call computeIsPreemptible() if its result is discarded. 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=345208&r1=345207&r2=345208&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed Oct 24 15:15:32 2018
@@ -1559,6 +1559,7 @@ static void removeUnusedSyntheticSection
 // with the same name defined in other ELF executable or DSO.
 static bool computeIsPreemptible(const Symbol &B) {
   assert(!B.isLocal());
+
   // Only symbols that appear in dynsym can be preempted.
   if (!B.includeInDynsym())
     return false;
@@ -1624,7 +1625,8 @@ template <class ELFT> void Writer<ELFT>:
   finalizeSynthetic(In.EhFrame);
 
   for (Symbol *S : Symtab->getSymbols())
-    S->IsPreemptible |= computeIsPreemptible(*S);
+    if (!S->IsPreemptible)
+      S->IsPreemptible = computeIsPreemptible(*S);
 
   // Scan relocations. This must be done after every symbol is declared so that
   // we can correctly decide if a dynamic relocation is needed.




More information about the llvm-commits mailing list