<div dir="ltr">It's getting too verbose. I'll try to do this in C macro.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 6, 2017 at 11:17 AM, Rafael Espindola via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Wed Dec  6 11:17:20 2017<br>
New Revision: 319932<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=319932&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=319932&view=rev</a><br>
Log:<br>
Convert a check to checkLazy.<br>
<br>
This brings memory allocations when linking clang from 270.96MB to<br>
267.80MB.<br>
<br>
Modified:<br>
    lld/trunk/ELF/InputFiles.cpp<br>
<br>
Modified: lld/trunk/ELF/InputFiles.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=319932&r1=319931&r2=319932&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>InputFiles.cpp?rev=319932&r1=<wbr>319931&r2=319932&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/InputFiles.cpp (original)<br>
+++ lld/trunk/ELF/InputFiles.cpp Wed Dec  6 11:17:20 2017<br>
@@ -279,8 +279,9 @@ template <class ELFT><br>
 ArrayRef<typename ObjFile<ELFT>::Elf_Word><br>
 ObjFile<ELFT>::<wbr>getShtGroupEntries(const Elf_Shdr &Sec) {<br>
   const ELFFile<ELFT> &Obj = this->getObj();<br>
-  ArrayRef<Elf_Word> Entries = check(<br>
-      Obj.template getSectionContentsAsArray<Elf_<wbr>Word>(&Sec), toString(this));<br>
+  ArrayRef<Elf_Word> Entries =<br>
+      checkLazy(Obj.template getSectionContentsAsArray<Elf_<wbr>Word>(&Sec),<br>
+                [=]() { return toString(this); });<br>
   if (Entries.empty() || Entries[0] != GRP_COMDAT)<br>
     fatal(toString(this) + ": unsupported SHT_GROUP format");<br>
   return Entries.slice(1);<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>