<div dir="ltr">Hi James,<div><br></div><div style>Last time I did this, there used to be PATypeHolder, which would take care of incomplete types and replace all by complete when you finished, but more than a year ago the StructType class was changed to accommodate that use and the PATypeHolder was deprecated.</div>
<div style><br></div><div style>I believe you should use isOpaque and setBody functions from StructType. Have a look at how Clang does it.</div><div style><br></div><div style>cheers,</div><div style>--renato</div><div style>
<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 February 2013 17:00, James Jackson <span dir="ltr"><<a href="mailto:james.a.f.jackson.2@googlemail.com" target="_blank">james.a.f.jackson.2@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>I'm having a play with LLVM to implement a custom language (for my intellectual curiosity only). I'm wondering how, when using IRBuilder, one can can it to emit a recursive type definition? The code for TypeBuilder explicitly states that it doesn't handle recursive types...</div>
<div><br></div><div>I'm after being able to emit, programmatically, stuff like the Named Types example in the Language Reference:</div><div><br></div><div><pre style="text-indent:0px;letter-spacing:normal;text-align:left;font-variant:normal;font-style:normal;background-color:rgb(248,248,248);font-weight:normal;padding:0.5em;overflow-x:auto;line-height:15px;overflow-y:hidden;text-transform:none;font-size:0.95em;font-family:Consolas,'Deja Vu Sans Mono','Bitstream Vera Sans Mono',monospace;border:1px solid rgb(204,204,204);word-spacing:0px">
<span style="color:rgb(187,96,213)">%mytype</span> <span>=</span> <span style="color:rgb(0,112,32);font-weight:bold">type</span> <span>{</span> <span style="color:rgb(187,96,213)">%mytype</span><span>*,</span> <span style="color:rgb(0,112,32);font-weight:bold">i32</span> <span>}</span></pre>
<div>I'd welcome any advice!</div></div><div><br></div><div>Yours,</div><div>James Jackson.</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">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>
<br></blockquote></div><br></div>