[lld] r316600 - Simplify.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 11:09:54 PDT 2017


Author: ruiu
Date: Wed Oct 25 11:09:54 2017
New Revision: 316600

URL: http://llvm.org/viewvc/llvm-project?rev=316600&view=rev
Log:
Simplify.

ArrayRef<T>() equals to ArrayRef<T>(nullptr, 0), so it looks like
we don't need to handle size 0 as a special case.

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=316600&r1=316599&r2=316600&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Wed Oct 25 11:09:54 2017
@@ -824,14 +824,10 @@ template <class ELFT> void EhInputSectio
   if (!this->Pieces.empty())
     return;
 
-  if (this->NumRelocations) {
-    if (this->AreRelocsRela)
-      split<ELFT>(this->relas<ELFT>());
-    else
-      split<ELFT>(this->rels<ELFT>());
-    return;
-  }
-  split<ELFT>(makeArrayRef<typename ELFT::Rela>(nullptr, nullptr));
+  if (this->AreRelocsRela)
+    split<ELFT>(this->relas<ELFT>());
+  else
+    split<ELFT>(this->rels<ELFT>());
 }
 
 template <class ELFT, class RelTy>




More information about the llvm-commits mailing list