Simplify LinkerScript::addOrphanSections. NFCI.
authorRui Ueyama <ruiu@google.com>
Fri, 6 Oct 2017 23:06:55 +0000 (23:06 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 6 Oct 2017 23:06:55 +0000 (23:06 +0000)
commitd2f225fdef3120443b8f92382de5bacfc2985ba7
tree93b359c30e99200e5af68aee6d63b748c90d8cfc
parentedafba200f8da2b67a41bfec3d104a2e02bec0e0
Simplify LinkerScript::addOrphanSections. NFCI.

This patch moves a std::find to a new function. It also removes
the following piece of code. I believe it should be fine because all
tests still pass.

  unsigned Index = std::distance(Opt.Commands.begin(), I);
  assert(Sec->SectionIndex == INT_MAX || Sec->SectionIndex == Index);
  Sec->SectionIndex = Index;

llvm-svn: 315125
lld/ELF/LinkerScript.cpp