<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">+cfe-dev.<div class=""><br class=""></div><div class="">Splitting this header up makes sense to me. Types.h was not intended to be the 7000 line monster it is now :-). </div><div class=""><br class=""></div><div class="">Splitting QualType out to its own header makes a lot of sense to me, but would it make sense to further split it up somehow? For example, one could split the C-like types, from the C++-like types, from the extensions. I’m not sure if that would be useful though.</div><div class=""><br class=""></div><div class="">-Chris<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 7, 2020, at 10:27 AM, Reid Kleckner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello Clang folks,<br class=""><div class=""><br class=""></div><div class="">I was using -ftime-trace to see where the compiler spends time parsing clang's own headers, and it pointed me to Type.h. Many AST headers need QualType to be complete, but they do not need the full type class hierarchy. To improve compile time, I have attempted to create a new header, QualType.h, that defines only the QualType wrapper class. I have started to transition popular clang headers (Decl.h, Expr.h, ASTContext.h, etc) to just use QualType.h. I got pretty far with this, and pushed the results to github:</div><div class=""><a href="https://github.com/llvm/llvm-project/compare/master...rnk:split-qual-type-prune" class="">https://github.com/llvm/llvm-project/compare/master...rnk:split-qual-type-prune</a><br class=""></div><div class=""><br class=""></div><div class="">You can see it is pretty involved / invasive. Many inline methods had to be sunk to cpp files, and this may affect performance. So far, I have nothing to show for it in build time gains, because there are still too many Type.h includes.</div><div class=""><br class=""></div><div class="">At this point I am wondering if this is worth doing at all. I figured I would take a break and ask for some opinions. If people generally feel this is worth pursuing, I'll break that branch up and upload it to phab in incremental pieces.</div><div class=""><br class=""></div><div class=""><div class="">The next most popular header seems to be CanonicalType.h, and it appears to be pretty strongly coupled to Type.h. It essentially reiterates all of the derived classes of Type, so I'm not sure how to break this link yet.</div><div class=""><br class=""></div><div class="">Reid</div><div class=""></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>