forked from OSchip/llvm-project
Convert a check to checkLazy.
This brings memory allocations when linking clang from 270.96MB to 267.80MB. llvm-svn: 319932
This commit is contained in:
parent
273d261b8f
commit
b6e2ca4597
|
@ -279,8 +279,9 @@ template <class ELFT>
|
|||
ArrayRef<typename ObjFile<ELFT>::Elf_Word>
|
||||
ObjFile<ELFT>::getShtGroupEntries(const Elf_Shdr &Sec) {
|
||||
const ELFFile<ELFT> &Obj = this->getObj();
|
||||
ArrayRef<Elf_Word> Entries = check(
|
||||
Obj.template getSectionContentsAsArray<Elf_Word>(&Sec), toString(this));
|
||||
ArrayRef<Elf_Word> Entries =
|
||||
checkLazy(Obj.template getSectionContentsAsArray<Elf_Word>(&Sec),
|
||||
[=]() { return toString(this); });
|
||||
if (Entries.empty() || Entries[0] != GRP_COMDAT)
|
||||
fatal(toString(this) + ": unsupported SHT_GROUP format");
|
||||
return Entries.slice(1);
|
||||
|
|
Loading…
Reference in New Issue