[lld] r315653 - Simplify a boolean expression by the De Morgan's laws.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 17:35:44 PDT 2017


Author: ruiu
Date: Thu Oct 12 17:35:44 2017
New Revision: 315653

URL: http://llvm.org/viewvc/llvm-project?rev=315653&view=rev
Log:
Simplify a boolean expression by the De Morgan's laws.

I don't really understand what exactly this expression means,
but at least I can mechanically transform it.

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=315653&r1=315652&r2=315653&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Thu Oct 12 17:35:44 2017
@@ -815,7 +815,7 @@ static void addGotEntry(SymbolBody &Sym,
     DynType = Target->GotRel;
   }
 
-  bool Constant = !Preemptible && !(Config->Pic && !isAbsolute(Sym));
+  bool Constant = !Preemptible && (!Config->Pic || isAbsolute(Sym));
   if (!Constant)
     In<ELFT>::RelaDyn->addReloc(
         {DynType, InX::Got, Off, !Preemptible, &Sym, 0});




More information about the llvm-commits mailing list