<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 8, 2015 at 11:46 AM, Teresa Johnson <span dir="ltr"><<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Jun 8, 2015 at 11:33 AM, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br>
> The clang patch lgtm, and I had some comments on the LLVM patch. Duncan, do<br>
> you want to say more there?<br>
><br>
> --- include/llvm/Transforms/IPO/PassManagerBuilder.h (revision 237590)<br>
> +++ include/llvm/Transforms/IPO/PassManagerBuilder.h (working copy)<br>
> @@ -121,6 +121,7 @@ class PassManagerBuilder {<br>
> bool VerifyInput;<br>
> bool VerifyOutput;<br>
> bool MergeFunctions;<br>
> + bool LTO;<br>
><br>
> While in the context of clang it makes sense that "LTO" means "generate an<br>
> object file appropriate for later LTO", but in the context of LLVM, it might<br>
> be taken to mean "we are doing LTO optimizations now". I think we probably<br>
> want to name the boolean something more specific (PreLTO? CompileForLTO?).<br>
> Later if we customize further we can split the codepath as is done for<br>
> populateLTOPassManager.<br>
<br>
</span>Yeah, I was concerned that the name might be confusing in this<br>
context, so if we opt to go with a single llvm option to mean -flto I<br>
like the idea of something like CompileForLTO (or maybe<br>
PrepareForLTO?).</blockquote><div><br></div><div>I like PrepareForLTO!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> Do you need to set the linkage of global variables to external? I noticed<br>
> that Function::deleteBody() does this but setInitializer(nullptr) does not.<br>
> Ditto for aliases.<br>
<br>
</span>Hmm, I am not sure - I basically am doing the same things GlobalDCE<br>
does (aside from erasing them from the function/variable/alias list).<br>
I guess it didn't matter in the GlobalDCE case since they were being<br>
completely erased rather than leaving a decl behind. Will make that<br>
change and retest.<br></blockquote><div><br></div><div>Sounds good.</div></div></div></div>