Simplify.
authorRui Ueyama <ruiu@google.com>
Wed, 25 Oct 2017 18:09:54 +0000 (18:09 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 25 Oct 2017 18:09:54 +0000 (18:09 +0000)
ArrayRef<T>() equals to ArrayRef<T>(nullptr, 0), so it looks like
we don't need to handle size 0 as a special case.

llvm-svn: 316600

lld/ELF/InputSection.cpp

index 56b68da..7c3e2eb 100644 (file)
@@ -824,14 +824,10 @@ template <class ELFT> void EhInputSection::split() {
   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>