Simplify. NFC.

llvm-svn: 303959
This commit is contained in:
Rui Ueyama 2017-05-26 02:17:30 +00:00
parent 9e6f268054
commit 240b9515e2
1 changed files with 6 additions and 4 deletions

View File

@ -281,18 +281,20 @@ bool elf::ObjectFile<ELFT>::shouldMerge(const Elf_Shdr &Sec) {
template <class ELFT>
void elf::ObjectFile<ELFT>::initializeSections(
DenseSet<CachedHashStringRef> &ComdatGroups) {
const ELFFile<ELFT> &Obj = this->getObj();
ArrayRef<Elf_Shdr> ObjSections =
check(this->getObj().sections(), toString(this));
const ELFFile<ELFT> &Obj = this->getObj();
uint64_t Size = ObjSections.size();
this->Sections.resize(Size);
unsigned I = -1;
StringRef SectionStringTable =
check(Obj.getSectionStringTable(ObjSections), toString(this));
for (const Elf_Shdr &Sec : ObjSections) {
++I;
for (size_t I = 0, E = ObjSections.size(); I < E; I++) {
if (this->Sections[I] == &InputSection::Discarded)
continue;
const Elf_Shdr &Sec = ObjSections[I];
// SHF_EXCLUDE'ed sections are discarded by the linker. However,
// if -r is given, we'll let the final link discard such sections.