Convert a few uses of check to checkLazy.

Linking clang goes from 292.68MB to 281.80MB allocated.

llvm-svn: 319927
This commit is contained in:
Rafael Espindola 2017-12-06 19:08:10 +00:00
parent 5b491a29fb
commit aca3df5479
1 changed files with 8 additions and 6 deletions

View File

@ -253,13 +253,15 @@ StringRef ObjFile<ELFT>::getShtGroupSignature(ArrayRef<Elf_Shdr> Sections,
// Group signatures are stored as symbol names in object files. // Group signatures are stored as symbol names in object files.
// sh_info contains a symbol index, so we fetch a symbol and read its name. // sh_info contains a symbol index, so we fetch a symbol and read its name.
if (this->ELFSyms.empty()) if (this->ELFSyms.empty())
this->initSymtab( this->initSymtab(Sections,
Sections, checkLazy(object::getSection<ELFT>(Sections, Sec.sh_link),
check(object::getSection<ELFT>(Sections, Sec.sh_link), toString(this))); [=]() { return toString(this); }));
const Elf_Sym *Sym = check( const Elf_Sym *Sym =
object::getSymbol<ELFT>(this->ELFSyms, Sec.sh_info), toString(this)); checkLazy(object::getSymbol<ELFT>(this->ELFSyms, Sec.sh_info),
StringRef Signature = check(Sym->getName(this->StringTable), toString(this)); [=]() { return toString(this); });
StringRef Signature = checkLazy(Sym->getName(this->StringTable),
[=]() { return toString(this); });
// As a special case, if a symbol is a section symbol and has no name, // As a special case, if a symbol is a section symbol and has no name,
// we use a section name as a signature. // we use a section name as a signature.