<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt">Since you diligently scan the mailing list, could you please review? :)<br><br>- Jan<br><div><span><br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Chandler Carruth <chandlerc@google.com><br> <b><span style="font-weight: bold;">To:</span></b> Jan Sjodin <jan_sjodin@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "Villmow, Micah" <Micah.Villmow@amd.com>; Duncan Sands <baldrick@free.fr>; "llvm-commits@cs.uiuc.edu"
 <llvm-commits@cs.uiuc.edu> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, September 28, 2012 5:07 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [llvm-commits] Patch to add flag in llvm-extract for including aliases in the extraction.<br> </font> </div> <br>
<div id="yiv1697051171"><div class="yiv1697051171gmail_extra"><div class="yiv1697051171gmail_quote">On Fri, Sep 28, 2012 at 2:04 PM, Jan Sjodin <span dir="ltr"><<a rel="nofollow" ymailto="mailto:jan_sjodin@yahoo.com" target="_blank" href="mailto:jan_sjodin@yahoo.com" class="yiv1697051171cremed">jan_sjodin@yahoo.com</a>></span> wrote:<br>
<blockquote class="yiv1697051171gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size:10pt;font-family:arial, helvetica, sans-serif;">I don't see any complaints from anyone, so I will go ahead and commit this by the end of today, or tomorrow.</div>
</div></blockquote><div><br></div><div>That is *not* how commit-after-approval works. You need to get an actual review and explicit OK for your patches. Please don't abuse our development process...</div><div> <br></div>
<blockquote class="yiv1697051171gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size:10pt;font-family:arial, helvetica, sans-serif;"><br>- Jan<br><div><span></span><br><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;margin-top:5px;padding-left:5px;">
  <div style="font-family:arial, helvetica, sans-serif;font-size:10pt;"> <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div dir="ltr"> <font face="Arial"><div class="yiv1697051171im"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Jan Sjodin <<a rel="nofollow" ymailto="mailto:jan_sjodin@yahoo.com" target="_blank" href="mailto:jan_sjodin@yahoo.com" class="yiv1697051171cremed">jan_sjodin@yahoo.com</a>><br>
 </div><b><span style="font-weight:bold;">To:</span></b> "Villmow, Micah" <<a rel="nofollow" ymailto="mailto:Micah.Villmow@amd.com" target="_blank" href="mailto:Micah.Villmow@amd.com" class="yiv1697051171cremed">Micah.Villmow@amd.com</a>>; Duncan Sands <<a rel="nofollow" ymailto="mailto:baldrick@free.fr" target="_blank" href="mailto:baldrick@free.fr" class="yiv1697051171cremed">baldrick@free.fr</a>>; "<a rel="nofollow" ymailto="mailto:llvm-commits@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits@cs.uiuc.edu</a>" <<a rel="nofollow" ymailto="mailto:llvm-commits@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits@cs.uiuc.edu</a>> <br>
 <b><span style="font-weight:bold;">Sent:</span></b> Tuesday,
 September 25, 2012 1:48 PM<div><div class="yiv1697051171h5"><br> <b><span style="font-weight:bold;">Subject:</span></b> Re: [llvm-commits] Patch to add flag in llvm-extract for including aliases in the extraction.<br> </div></div></font> </div>
<div><div class="yiv1697051171h5"> <br>
I tried that, but eraseFromParent makes the alias_iterator fail, since the underlying data structure is modified. <br><br><br>- Jan<br><br><br><br>----- Original Message -----<br>> From: "Villmow, Micah" <<a rel="nofollow" ymailto="mailto:Micah.Villmow@amd.com" target="_blank" href="mailto:Micah.Villmow@amd.com" class="yiv1697051171cremed">Micah.Villmow@amd.com</a>><br>
> To: Jan Sjodin <<a rel="nofollow" ymailto="mailto:jan_sjodin@yahoo.com" target="_blank" href="mailto:jan_sjodin@yahoo.com" class="yiv1697051171cremed">jan_sjodin@yahoo.com</a>>; Duncan Sands <<a rel="nofollow" ymailto="mailto:baldrick@free.fr" target="_blank" href="mailto:baldrick@free.fr" class="yiv1697051171cremed">baldrick@free.fr</a>>; "<a rel="nofollow" ymailto="mailto:llvm-commits@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits@cs.uiuc.edu</a>" <<a rel="nofollow" ymailto="mailto:llvm-commits@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits@cs.uiuc.edu</a>><br>
> Cc: <br>> Sent: Tuesday, September 25, 2012 11:34 AM<br>> Subject: RE: [llvm-commits] Patch to add flag in llvm-extract for including aliases in the
 extraction.<br>> <br>> So, the patch itself looks fine in its current form, however is there not a way <br>> to delete the alias's without requiring to store them first?<br>> Maybe something like this would work?<br>
> +static void extractAliases(Module* M,<br>> +                           SetVector<GlobalValue *> &GVs) {+  <br>> +  // Find aliases to be erased<br>> +  for (Module::alias_iterator I = M->alias_begin(), E = M->alias_end();<br>
> +       I != E; ) {<br>> +    GlobalAlias *GA = I++;<br>> +    GlobalValue *GV =<br>> +      const_cast<GlobalValue*>((GA).resolveAliasedGlobal(false));<br>> +    if ((GVs.count(GV) != 0) == DeleteFn)<br>
> +      GA->eraseFromParent();<br>> +  }<br>> +}<br>>
 <br>>>  -----Original Message-----<br>>>  From: <a rel="nofollow" ymailto="mailto:llvm-commits-bounces@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits-bounces@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits-bounces@cs.uiuc.edu</a> [mailto:<a rel="nofollow" ymailto="mailto:llvm-commits-" target="_blank" href="mailto:llvm-commits-" class="yiv1697051171cremed">llvm-commits-</a><br>
>>  <a rel="nofollow" ymailto="mailto:bounces@cs.uiuc.edu" target="_blank" href="mailto:bounces@cs.uiuc.edu" class="yiv1697051171cremed">bounces@cs.uiuc.edu</a>] On Behalf Of Jan Sjodin<br>>>  Sent: Tuesday, September 25, 2012 6:23 AM<br>>>  To: Duncan Sands; <a rel="nofollow" ymailto="mailto:llvm-commits@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits@cs.uiuc.edu</a><br>
>>  Subject: Re: [llvm-commits] Patch to add flag in llvm-extract for<br>>>  including aliases in the extraction.<br>>> <br>>>  Ok. Re-ping-ping with patch!<br>>> <br>>>  - Jan<br>>> <br>
>>  >________________________________<br>>>  > From: Duncan Sands <<a rel="nofollow" ymailto="mailto:baldrick@free.fr" target="_blank" href="mailto:baldrick@free.fr" class="yiv1697051171cremed">baldrick@free.fr</a>><br>>>  >To: <a rel="nofollow" ymailto="mailto:llvm-commits@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits@cs.uiuc.edu</a><br>
>>  >Sent: Saturday, September 22, 2012 6:06 AM<br>>>  >Subject: Re: [llvm-commits] Patch to add flag in llvm-extract for<br>>>  including aliases in the extraction.<br>>>  ><br>>>  >On 21/09/12 17:36, Jan Sjodin wrote:<br>
>>  >><br>>>  >> Ping! Ping!<br>>>  ><br>>>  >Please supply the patch when you ping.<br>>>  ><br>>>  >Ciao, Duncan.<br>>>  >_______________________________________________<br>
>>  >llvm-commits mailing list<br>>>  ><a rel="nofollow" ymailto="mailto:llvm-commits@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits@cs.uiuc.edu</a><br>>> 
 ><a rel="nofollow" target="_blank" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" class="yiv1697051171cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>>>  ><br>>>  ><br>>>  ><br>> <br>
<br>_______________________________________________<br>llvm-commits mailing list<br><a rel="nofollow" ymailto="mailto:llvm-commits@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits@cs.uiuc.edu</a><br><a rel="nofollow" target="_blank" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" class="yiv1697051171cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br><br> </div></div></div> </div> </blockquote></div>   </div></div><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a rel="nofollow" ymailto="mailto:llvm-commits@cs.uiuc.edu" target="_blank" href="mailto:llvm-commits@cs.uiuc.edu" class="yiv1697051171cremed">llvm-commits@cs.uiuc.edu</a><br>
<a rel="nofollow" target="_blank" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" class="yiv1697051171cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>
</div><br><br> </div> </div> </blockquote></div>   </div></body></html>