[lld] r319924 - Replace one use of check with checkLazy.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 10:56:22 PST 2017


Author: rafael
Date: Wed Dec  6 10:56:22 2017
New Revision: 319924

URL: http://llvm.org/viewvc/llvm-project?rev=319924&view=rev
Log:
Replace one use of check with checkLazy.

Reduce total allocation when linking clang from 320.04MB to 300.82MB.

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=319924&r1=319923&r2=319924&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Dec  6 10:56:22 2017
@@ -595,8 +595,8 @@ InputSectionBase *ObjFile<ELFT>::createI
 
 template <class ELFT>
 StringRef ObjFile<ELFT>::getSectionName(const Elf_Shdr &Sec) {
-  return check(this->getObj().getSectionName(&Sec, SectionStringTable),
-               toString(this));
+  return checkLazy(this->getObj().getSectionName(&Sec, SectionStringTable),
+                   [=]() { return toString(this); });
 }
 
 template <class ELFT> void ObjFile<ELFT>::initializeSymbols() {




More information about the llvm-commits mailing list