<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 12, 2016, at 8:50 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Jan 12, 2016 at 8:41 AM, Mehdi Amini <span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">You need to be careful that an LTO build won’t inline and eliminate this.</div></blockquote><div class=""><br class=""></div><div class="">fair - but these calls, if they'd executed, would've been totally bogus, right? (they would've crashed/null dereferenced, etc)<br class=""><br class="">So somehow this code is live without it actually executing.<br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>Sure it won’t execute because of the guard:   if (std::getenv("bar") != (char*) -1) return;</div><div><br class=""></div><div>But my point was more than taking the address and not doing anything with it is not the same as calling a function, I mentioned it because I’m not sure what you had in mind to make sure the pointer always escape (printf like Tobias suggested should work).</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class="">To come back to the underlying issue: What is it we're trying to solve here? What entities are we trying to preserve & why are more traditional/normal ways of preserving them insufficient? (sorry if this is too much of a derailment/the rest  of you have enough context here, feel free to go on without me ;))</div></div></div></div></div></blockquote><div><br class=""></div><div>What is a “more traditional/normal way of preserving” symbols? Export lists?</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class="h5"><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 12, 2016, at 8:02 AM, David Blaikie via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Do you need to call anything? Could you just take the address of the function and return it, stuff it in a global, or otherwise escape it?</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Jan 12, 2016 at 12:02 AM, Dimitry Andric via llvm-commits <span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dim added a subscriber: grosser.<br class="">
<br class="">
================<br class="">
Comment at: include/llvm/LinkAllPasses.h:191<br class="">
@@ -190,3 +196,3 @@<br class="">
<span class="">       llvm::RGPassManager RGM;<br class="">
-      ((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM);<br class="">
</span>       llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)nullptr);<br class="">
----------------<br class="">
@grosser, you originally added this part in rL117263 ("Reference RegionPass to stop it being eliminated"), do you have any suggestions? If the goal is to to unsure RegionPass.cpp is linked in, I think we can call `RegionPass::createPrinterPass()` instead.<br class="">
<div class=""><div class=""><br class="">
<br class="">
<a href="http://reviews.llvm.org/D15996" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D15996</a><br class="">
<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class=""></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>