<div dir="ltr">CGCleanup.h needs full definitions for these types.  This was the minimal set of headers I needed to make CGCleanup.h compile if it is included first in the TU, as is done in CGCleanup.cpp.<div><br></div><div style>
Previously it was compiling because CodeGenFunction.h was pulling this and other stuff in first.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 9, 2013 at 1:30 PM, Tobias Grosser <span dir="ltr"><<a href="mailto:tobias@grosser.es" target="_blank">tobias@grosser.es</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 06/09/2013 09:56 AM, Reid Kleckner wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: rnk<br>
Date: Sun Jun  9 11:56:53 2013<br>
New Revision: 183632<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=183632&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=183632&view=rev</a><br>
Log:<br>
[CodeGen] Make CGCleanup.h include what it now uses<br>
<br>
Also move CGCleanup.h to the top of CGCleanup.cpp to verify that<br>
CGCleanup.h really includes what it needs.<br>
</blockquote>
<br></div>
[...]<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-namespace llvm {<br>
-  class Value;<br>
-  class BasicBlock;<br>
-  class BranchInst;<br>
-}<br>
+#include "llvm/IR/BasicBlock.h"<br>
+#include "llvm/IR/Value.h"<br>
+#include "llvm/IR/Instructions.h"<br>
</blockquote>
<br></div>
Hi Reid,<br>
<br>
out of interest, why is this an improvement? It seems to be against the 'include as little as possible rule' [1].<br>
<br>
Also, is the 'include what it now uses' a reference to the 'include what you use' tool [2]. This tool states the following:<br>
<br>
"Include what you use" means this: for every symbol (type, function variable, or macro) that you use in foo.cc, either foo.cc or foo.h should #include a .h file that exports the declaration of that symbol."<br>

<br>
It does not say anything about the case where a full symbol is not needed and hence an include is not necessary.<br>
<br>
Could you give me some insights about your reasoning?<br>
<br>
Cheers,<br>
Tobi<br>
<br>
[1] <a href="http://llvm.org/docs/CodingStandards.html#include-as-little-as-possible" target="_blank">http://llvm.org/docs/<u></u>CodingStandards.html#include-<u></u>as-little-as-possible</a><br>
[2] <a href="http://code.google.com/p/include-what-you-use/" target="_blank">http://code.google.com/p/<u></u>include-what-you-use/</a><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div>