forked from OSchip/llvm-project
Remove unnecessary code.
Discarded section's Repl always points to itself, so returning Sec is not different from returning Sec->Repl. llvm-svn: 316880
This commit is contained in:
parent
ea1398eeb3
commit
27f95a9ac3
|
@ -517,12 +517,9 @@ InputSectionBase *ObjFile<ELFT>::getSection(uint32_t Index) const {
|
|||
if (Index >= this->Sections.size())
|
||||
fatal(toString(this) + ": invalid section index: " + Twine(Index));
|
||||
|
||||
InputSectionBase *Sec = this->Sections[Index];
|
||||
if (!Sec)
|
||||
return nullptr;
|
||||
if (Sec == &InputSection::Discarded)
|
||||
return Sec;
|
||||
return Sec->Repl;
|
||||
if (InputSectionBase *Sec = this->Sections[Index])
|
||||
return Sec->Repl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
|
|
Loading…
Reference in New Issue