2010/1/11 Garrison Venn <span dir="ltr"><<a href="mailto:gvenn.cfe.dev@gmail.com">gvenn.cfe.dev@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;">Sorry to keep this thread alive, but I'm learning so ...<div><br></div><div>There is more. The doc for GlobalValue::LinkageTypes or the C API LLVMLinkage is not as clear as the</div>
<div>lang ref manual. See: <a href="http://llvm.org/docs/LangRef.html#linkage" target="_blank">http://llvm.org/docs/LangRef.html#linkage</a>. I'm pointing this out because something</div><div>like LinkerPrivateLinkage (LLVMLinkerPrivateLinkage), or another one, might be more appropriate to </div>
<div>your throw away use case (if I understand your use correctly). One should test this of course, and/or one </div><div>of the experts could chime in hint hint. :-)</div></div></blockquote><div><br>I think I'd understand the LLVM linkage document better if I had more
knowledge of ELF - I suspect there's a close correspondance between
LLVM linkage types and corresponding features in ELF but I could be
confused
here.<br>
<br>
I also found the documentation on derived types less clear in places. I
might have missed it but I don't think it's made explicit what
operations are allowed on derived types (actually none?)<br><br>Otherwise the LLVM documentation is generally very good and this together with the clear and orthogonal nature of the IR has enabled me to make huge progress towards replacing my compiler's back end
with LLVM in a couple of weekends and a few evenings.<br><br>-- James<br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="word-wrap: break-word;">
<div>Anyway thought this info. might be useful, however rehashed. </div><div><br></div><div>Garrison</div><div><br></div><div><div><div class="im"><div>On Jan 11, 2010, at 16:34, James Williams wrote:</div><br></div><blockquote type="cite">
<div class="im">2010/1/11 Garrison Venn <span dir="ltr"><<a href="mailto:gvenn.cfe.dev@gmail.com" target="_blank">gvenn.cfe.dev@gmail.com</a>></span><br></div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div style="word-wrap: break-word;">I have not tried this, but a linkage type of PrivateLinkage would not add to the symbol table according<div>to the doc. <div><br></div><div>LLVMSetLinkage(g, LLVMPrivateLinkage);</div>
</div>
</div></blockquote><div><br>Thanks - I hadn't thought of that.<br></div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="word-wrap: break-word;">

<div><div><br></div><font color="#888888"><div>Garrison</div><div><br></div></font><div><div><div class="im"><div><div></div><div><div>On Jan 11, 2010, at 14:03, James Williams wrote:</div><br></div></div></div><blockquote type="cite">

<div><div></div><div><div class="im">2010/1/11 Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<div><div></div><div><div class="im">On Mon, Jan 11, 2010 at 7:07 AM, James Williams <<a href="mailto:junk@giantblob.com" target="_blank">junk@giantblob.com</a>> wrote:<br>
> Hi,<br>
><br>
> I've read <a href="http://llvm.org/docs/LangRef.html#t_array" target="_blank">http://llvm.org/docs/LangRef.html#t_array</a> and<br>
> <a href="http://llvm.org/docs/GetElementPtr.html" target="_blank">http://llvm.org/docs/GetElementPtr.html</a> and if I've understood right there<br>
> are no operations that act directly on arrays - instead I need to use<br>
> getelementptr on a pointer to an array to get a pointer to an array element.<br>
> I also understand that there is no 'address of' operation.<br>
><br>
> As a result I can't figure out how to use constant derived types without<br>
> assigning them to a global. Say I want to use the C bindings function<br>
> LLVMValueRef LLVMConstString(char *, int, int) to get an int8* pointer to a<br>
> C string constant - there doesn't seem to be any way to directly use the<br>
> resulting [N x i8] value directly and there's no operator that gives me its<br>
> address.<br>
><br></div>snip<div class="im"><br>
><br>
> Is it possible to get the address of an element of a constant array or<br>
> struct without first initializing a global variable to the constant?<br>
<br>
</div></div></div>No.<br></blockquote><div class="im"><div><br>OK. I'd have preferred to have to avoid bloating the module symbol table with global symbols that will never be referenced but it's no big deal.<br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<font color="#888888"><br>
-Eli<br>
<br>
</font></blockquote></div></div><br></div></div><div class="im"><div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a><br>

<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></div></blockquote></div><br></div></div></div></blockquote></div><br>
</blockquote></div><br></div></div></blockquote></div><br>