<div dir="ltr">Hello Clang folks,<br><div><br></div><div>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><a href="https://github.com/llvm/llvm-project/compare/master...rnk:split-qual-type-prune">https://github.com/llvm/llvm-project/compare/master...rnk:split-qual-type-prune</a><br></div><div><br></div><div>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><br></div><div>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><br></div><div><div>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><br></div><div>Reid</div><div></div></div></div>