<div dir="auto">Do other compilers behave similarly in terms if memory consumption for your example code?</div><div class="gmail_extra"><br><div class="gmail_quote">On Apr 26, 2017 4:20 PM, "mateusz janek via cfe-dev" <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>Before I'll begin, I want to say that I don't want to implement below 'feature' in a clang production code. I want to create my own custom build for my own needs.</div><div><br></div><div>Abstract:</div><div>I'm developing a hobby project which creates a lot of types in a compile time, in one .cpp file. Really a lot. I tried to compile next version, but it was compiling whole night and took ~30G of memory (16G RAM + swap) and wasn't able to finish. I know that almost all of these types are 'used' only once, they're kind of helpers.</div><div>Basically what I want to achieve is to decrease memory usage to not need to use the swap, because it increases compilation time a lot.</div><div><br></div><div>Question:</div><div>Is there a way to implement a removing no longer used types? E.g.</div><div><br></div><div>template <typename FooParam></div><div>struct Foo</div><div>{</div><div> using FooResult = typename Bar<FooParam>::BarResult;</div><div>};</div><div><br></div><div>And I'd want to remove the 'Bar<FooParam>' type from a 'ASTContext' because I know that I won't need it anymore. (then, if there will again occur an initialization of very same 'Bar<FooParam>', I'm ok with that I'll need to create it from the scratch).</div><div>So basically is there any way to detect if type is still referenced somewhere, so I can remove it if it isn't?</div><div><br></div><div>I hope I've described my problem well. I know that in fact I'm asking for a explanation how types in clang are related to each other - that's a lot, but I'd really like to learn and understand that (:</div><div><br></div><div>Thanks in advance for help!</div><div><br></div><div>Stryku</div></div>
<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div></div>