[lld] r319926 - Convert a call to check to checkLazy.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 6 11:02:12 PST 2017
Author: rafael
Date: Wed Dec 6 11:02:12 2017
New Revision: 319926
URL: http://llvm.org/viewvc/llvm-project?rev=319926&view=rev
Log:
Convert a call to check to checkLazy.
Linking clang goes from 300.82MB to 292.68MB allocated.
Modified:
lld/trunk/ELF/InputFiles.cpp
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=319926&r1=319925&r2=319926&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Dec 6 11:02:12 2017
@@ -520,13 +520,14 @@ InputSectionBase *ObjFile<ELFT>::createI
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;
More information about the llvm-commits
mailing list