<div dir="ltr">On 23 July 2013 04:32, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><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"><div>> You probably know the right thing to do here better than I do. Mine was just<br>


> an "peephole" observation.<br>
<br>
</div>I went ahead and implemented the option of passing a bool to select<br>
llvm.used or llvm.compiler.used.<br>
<br>
Nick, what do you think?<br></blockquote><div><br></div><div><div>+    const Module &M, SmallPtrSet<GlobalValue *, 8> &Set, bool CompilerUsed) {</div><div>+  const char *Name = CompilerUsed ? "llvm.compiler.used" : "llvm.used";</div>

<div>+  GlobalVariable *GV = M.getGlobalVariable(Name);</div></div><div><br></div><div>I think you just got a non-const IR* from a const Module. How'd you pull that off? Module::getGlobalVariable shouldn't do that.</div>

<div><br></div><div>+  for (unsigned I = 0, E = Init->getNumOperands(); I != E; ++I) {<br></div><div><br></div><div>Isn't it normal to use i and e for ints and I and E for iterators?</div><div><br></div><div>Anyhow, this is fine. I mean, grumpy-Nick doesn't like @llvm.used or @llvm.compiler.used, but I'll spare you my whining.</div>

<div><br></div><div>LGTM</div><div><br></div><div>Nick</div><div><br></div></div></div></div>