[lld] r281426 - Turn a no-op assignment into an assertion.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 17:09:50 PDT 2016


Author: ruiu
Date: Tue Sep 13 19:09:50 2016
New Revision: 281426

URL: http://llvm.org/viewvc/llvm-project?rev=281426&view=rev
Log:
Turn a no-op assignment into an assertion.

r279456 guarantees that this condition is always satisfied.

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=281426&r1=281425&r2=281426&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Tue Sep 13 19:09:50 2016
@@ -429,7 +429,7 @@ template <class ELFT> void InputSection<
 
 template <class ELFT>
 void InputSection<ELFT>::replace(InputSection<ELFT> *Other) {
-  this->Alignment = std::max(this->Alignment, Other->Alignment);
+  assert(Other->Alignment <= this->Alignment);
   Other->Repl = this->Repl;
   Other->Live = false;
 }




More information about the llvm-commits mailing list