<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Ah, actually, I was thinking of ModulePass::doFinalization. I’m not certain of the history of FunctionPass::doFinalization<div class=""><br class=""></div><div class="">—Owen</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 6, 2015, at 9:55 AM, John Criswell <<a href="mailto:jtcriswel@gmail.com" class="">jtcriswel@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" class="">
<div bgcolor="#FFFFFF" text="#000000" class="">
<div class="moz-cite-prefix">Dear Owen,<br class="">
<br class="">
First, to be sure we're on the same page, are we talking about
doFinalization() in a FunctionPass or the doFinalization() method
of another type of pass? I've been assuming that we're talking
about FunctionPasses.<br class="">
<br class="">
Second, according to the documentation,
FunctionPass::doInitialization() is allowed to modify the IR. The
documentation on doFinalization() does not say anything either way
on the matter.<br class="">
<br class="">
It sounds like there's a bug in the documentation. Would you like
me to file a bug report?<br class="">
<br class="">
Regards,<br class="">
<br class="">
John Criswell<br class="">
<br class="">
<br class="">
On 5/6/15 12:45 PM, Owen Anderson wrote:<br class="">
</div>
<blockquote cite="mid:61392EAF-8FCC-41DF-832C-C91D1AC9581D@mac.com" type="cite" class="">
<meta http-equiv="Context-Type" content="text/html;
charset=windows-1252" class="">
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On May 6, 2015, at 7:28 AM, John Criswell <<a moz-do-not-send="true" href="mailto:jtcriswel@gmail.com" class="">jtcriswel@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span class="">My understanding is that
doInitialization() and doFinalization() are designed
specifically for modifying the LLVM IR (otherwise, why
would a mutable reference to the Function be provided)?</span><br class="">
</div>
</blockquote>
</div>
<br class="">
<div class="">As the person whose use case motivated added them,
we definitely didn’t intend them to be used for modifying IR.</div>
<div class=""><br class="">
</div>
<div class="">—Owen</div>
</blockquote>
<br class="">
<br class="">
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</div>
</div></blockquote></div><br class=""></div></body></html>