<div dir="ltr">+@llvm.compiler_used = appending global [1 x void ()*] [void ()* @g], section "llvm.metadata"<div><br></div><div>@llvm.compiler.used?</div><div><br></div><div><div>+GlobalVariable *</div><div>+llvm::collectUsedGlobalVariables(const Module &M, const char *Name,</div>
<div>+                                 SmallPtrSet<GlobalValue *, 8> &Set) {</div></div><div><br></div><div>(for a future patch). The return value seems kind of arbitrary; it seems to be just to save a name lookup in the module. Maybe this function should take a GlobalVariable * instead of a name? and leave it to the client to extract the GlobalVariable* from the module? You could also then remove the `const Module &M` parameter. Also, the function does something pretty specific, so maybe it should have a more specific-sounding name.</div>
<div><br></div><div>-- Sean Silva<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 19, 2013 at 12:09 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<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">The language reference says that:<br>
<br>
"If a symbol appears in the @llvm.used list, then the compiler,<br>
assembler, and linker are required to treat the symbol as if there is<br>
a reference to the symbol that it cannot see"<br>
<br>
Since even the linker cannot see the reference, we must assume that<br>
the reference can be using the symbol table. For example, a debug<br>
helper function like dump might be referenced from a debugger.<br>
<br>
The attached patch makes internalize respect llvm.used.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div></div>