<div dir="ltr">On Fri, Jun 7, 2013 at 2:22 PM, Manish Verma <span dir="ltr"><<a href="mailto:manish.verma@arm.com" target="_blank" class="cremed">manish.verma@arm.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br></blockquote><div><br></div><div style>Hi,</div><div style>I am the person working on the dynamic layer (ASTMatchers/Dynamic/) on top the matcher library.</div>
<div style> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I have been discussing the same issue on llvm-commit mailing-list.<br>
<a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130603/177054.
html" target="_blank" class="cremed">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130603/177054.<br>
html</a><br>
<br>
At the moment, the debug build of LLVM/Clang is broken on Windows.<br>
This is because when compiling ASTMatchers/Dynamic/Registry.cpp,<br>
the compilers hit the allowed limit of 2^16 sections in the<br>
COFF file.<br></blockquote><div><br></div><div style>Looking at the sections, it seems that we have way too many functions defined in the compilation unit.</div><div style>The matchers in ASTMatchers.h rely a lot on templates and macros and most of the matcher code is directly on the ASTMatchers.h file.</div>
<div style>Each matcher instantiation seem to generate a couple hundred.</div><div style>The dynamic registry is instantiating all* the matchers in Registry.cpp. I think only the test file (ASTMatchersTest.cpp) would instantiate that many matchers together in one compilation unit before.<br>
</div><div style> <br></div><div style>I see a few solutions for this:</div><div style> 1. For any non-template matcher, move its code to an ASTMatchers.cpp to be created. This would take away a big chunk of the size of Registry.cpp. I don't know if this will just move the problem to ASTMatchers.cpp instead.</div>
<div style> 2. Split Registry.cpp in smaller compilation units, each with a subset of the matchers. It should be easier than (1).</div><div style><br></div><div style>* the goal is to have them all, but we are not there yet, so the problem would get worse later.</div>
<div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For MSVC it is possible to work around this problem by compiling<br>
with /bigobj command line option. However, I don't know of an<br>
equivalent command line option for Min-GW gcc.<br>
<br>
On Linux, Registry.o (debug-mode) is about 34M in size and has<br>
36986 sections. I can expect it impacting the link-time and memory<br>
usage.<br></blockquote><div><br></div><div style>This library is separate from ASTMatchers on purpose to prevent bloat to anyone not explicitly requiring the dynamic implementation.</div><div style>If this is being built/linked for clang/clang++ then it is a mistake.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The last commit has resulted in the build failure, but I don't think<br>
it is responsible for the failure.<br></blockquote><div><br></div><div style>On the last commit (or one of the latest) I expanded the list of matchers to more than 150. I expect this is what caused it to go over the limit.</div>
<div style> <br></div><div style>_Sam</div><div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I don't know what should be the correct solution. Hence, I am raising<br>
it here for discussion. </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Regards,<br>
Manish<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" class="cremed">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>