Convert a call to check to checkLazy.

Linking clang goes from 300.82MB to 292.68MB allocated.

llvm-svn: 319926
This commit is contained in:
Rafael Espindola 2017-12-06 19:02:12 +00:00
parent c221dc71b1
commit 5b491a29fb
1 changed files with 4 additions and 3 deletions

View File

@ -520,13 +520,14 @@ InputSectionBase *ObjFile<ELFT>::createInputSection(const Elf_Shdr &Sec) {
size_t NumRelocations;
if (Sec.sh_type == SHT_RELA) {
ArrayRef<Elf_Rela> Rels =
check(this->getObj().relas(&Sec), toString(this));
ArrayRef<Elf_Rela> Rels = checkLazy(this->getObj().relas(&Sec),
[=]() { return toString(this); });
Target->FirstRelocation = Rels.begin();
NumRelocations = Rels.size();
Target->AreRelocsRela = true;
} else {
ArrayRef<Elf_Rel> Rels = check(this->getObj().rels(&Sec), toString(this));
ArrayRef<Elf_Rel> Rels = checkLazy(this->getObj().rels(&Sec),
[=]() { return toString(this); });
Target->FirstRelocation = Rels.begin();
NumRelocations = Rels.size();
Target->AreRelocsRela = false;