<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 7 Apr 2020, at 16:18, Reid Kleckner wrote:</p>
</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">On Tue, Apr 7, 2020 at 11:35 AM Chris Lattner <clattner@nondot.org> wrote:<br>
</p>
<blockquote style="border-left:2px solid #777; color:#999; margin:0 0 5px; padding-left:5px; border-left-color:#999"><p dir="auto">+cfe-dev.<br>
</p>
</blockquote><p dir="auto">Sorry about it going to llvm-dev. I typed cfe-dev<enter> into the To: box<br>
and got llvm-dev.<br>
<br>
</p>
<blockquote style="border-left:2px solid #777; color:#999; margin:0 0 5px; padding-left:5px; border-left-color:#999"><p dir="auto">Splitting this header up makes sense to me. Types.h was not intended to<br>
be the 7000 line monster it is now :-).<br>
<br>
Splitting QualType out to its own header makes a lot of sense to me, but<br>
would it make sense to further split it up somehow? For example, one could<br>
split the C-like types, from the C++-like types, from the extensions. I’m<br>
not sure if that would be useful though.<br>
</p>
</blockquote><p dir="auto">I think that's a good idea. I think there are some key types that everyone<br>
uses (ReferenceType, PointerType, FunctionType). The Decl and Stmt class<br>
hierarchy currently often use these types from inline methods.<br>
<br>
On Tue, Apr 7, 2020 at 10:34 AM John McCall <rjmccall@apple.com> wrote:<br>
</p>
<blockquote style="border-left:2px solid #777; color:#999; margin:0 0 5px; padding-left:5px; border-left-color:#999"><p dir="auto">How many translation units actually don’t ultimately need the type<br>
definitions? Because this achieves nothing if almost every translation<br>
unit ends up including Type.h anyway.</p>
</blockquote><p dir="auto">It's hard to know this without doing it. My plan was to do it, hope to get<br>
early good results, and use that to motivate finishing the project. But, my<br>
lack of results is making me reconsider the whole project.<br>
<br>
The IWYU tool exists, but the results are generally considered unusable. We<br>
could try to run it on the codebase and see how often it thinks Type.h<br>
should be included. Part of the project is refactoring the code to not use<br>
Type.h.</p>
</blockquote></div>
<div style="white-space:normal">
<p dir="auto">My guess would be that 90% or more of the translation units that depend<br>
on the AST end up doing some type-specific analysis and so will need the<br>
full <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">Type.h</code> anyway. Now, if you break <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">Type.h</code> up into the C base, then<br>
sure, most of those translation units are just checking for <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">RecordType</code> or<br>
<code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">PointerType</code>.</p>
<p dir="auto">John.</p>
</div>
</div>
</body>
</html>