<div dir="ltr"><div>On 7 May 2013 13:21, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Thanks a lot for the review. A new patch is attached. I have moved<br>


into LLVMUsed only the functionally that I think might be used by<br>
other passes, so I have left the checks/patching to make sure that<br>
llvm.compiler_used and llvm.used are disjoint out of it.<br></blockquote><div><br></div><div>This looks much better. Thanks!<br></div><div style><br></div><div style><div>+class LLVMUsed {<br></div><div>+  SmallPtrSet<GlobalValue *, 8> Used;</div>

<div>+  SmallPtrSet<GlobalValue *, 8> CompilerUsed;</div><div>+  GlobalVariable *UsedV;</div><div>+  GlobalVariable *CompilerUsedV;</div><div><br></div><div>Doxy-strings please! :)<br></div><div><br></div><div style>

<div>+static int compareNames(const void *A, const void *B) {</div><div>+  const GlobalValue *VA = *reinterpret_cast<GlobalValue* const*>(A);</div><div>+  const GlobalValue *VB = *reinterpret_cast<GlobalValue* const*>(B);</div>

<div>+  if (VA->getName() < VB->getName())</div><div>+    return -1;</div><div>+  if (VB->getName() < VA->getName())</div><div>+    return 1;</div><div>+  return 0;</div><div>+}</div><div><br></div><div style>

Say, what *does* happen if you have unnamed global values?</div><div style><br></div><div style>Nick<br></div><div style><br></div></div></div></div></div></div>