[lld] r221603 - [Mips] Replace the redundant condition by assert call

Simon Atanasyan simon at atanasyan.com
Mon Nov 10 07:50:22 PST 2014


Author: atanasyan
Date: Mon Nov 10 09:50:22 2014
New Revision: 221603

URL: http://llvm.org/viewvc/llvm-project?rev=221603&view=rev
Log:
[Mips] Replace the redundant condition by assert call

No functional changes.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h?rev=221603&r1=221602&r2=221603&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h Mon Nov 10 09:50:22 2014
@@ -164,10 +164,10 @@ public:
     // creation code in the class MipsRelocationPass. Let's update atomLayout
     // fields for such symbols.
     for (auto &ste : this->_symbolTable) {
-      if (!ste._atom || ste._atomLayout)
+      if (!ste._atom)
         continue;
-      auto *layout = pltSection.findPLTLayout(ste._atom);
-      if (layout) {
+      if (auto *layout = pltSection.findPLTLayout(ste._atom)) {
+        assert(!ste._atomLayout);
         ste._symbol.st_value = layout->_virtualAddr;
         ste._symbol.st_other |= ELF::STO_MIPS_PLT;
       }





More information about the llvm-commits mailing list