<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span><br></span></div><div>Ping!</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">- Jan<br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><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> Jan Sjodin <jan_sjodin@yahoo.com><br> <b><span style="font-weight:
 bold;">To:</span></b> Rafael Espíndola <rafael.espindola@gmail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> Eric Christopher <echristo@gmail.com>; "llvm-commits@cs.uiuc.edu" <llvm-commits@cs.uiuc.edu> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, October 8, 2012 11:56 AM<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>
> So, I agree that llvm-extract has a problem with aliases. With your testcase:<br><br>> <br>> $ llvm-extract -func=foo test.ll -o test2.ll -S<br>> $ llvm-extract -delete -func=foo test.ll -o test3.ll -S<br>> $ llvm-link test2.ll test3.ll<br>> llvm-link: link error in 'test3.ll': Linking globals named <br>> 'a0foo':<br>> symbol multiply defined!<br>> <br>> But I don't think that adding an option is the correct fix. The above<br>> should just work IMHO.  What should happen I think is that test2.ll<br>> should end up with just @foo and test3.ll should end up with @bar and<br>> the 3 aliases.<br>> <br>> If anyone wants to extract aliases, we should add a -alias option that<br>> is analogous to -func and -glob.<br>><br>> Would that work for you? Does anyone object to that behavior?<br><br>I agree that llvm-extract should do a better job on alaises by default, and what you propose seems<br>reasonable.
 In my mind we probably want both -alias and -with-aliases options. One operates only<br>on aliases, the other is used to bundle aliases with the functions/globals, which is really the capability<br>that I am looking for. It could potentially be included as a sub-option like  -alias=<with-aliases-special-option><br><br>- Jan<br><br><br><br> </div> </div> </blockquote></div>   </div></body></html>