<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 8, 2009, at 6:04 PM, Eli Friedman wrote:</div><blockquote type="cite"><div>On Tue, Sep 8, 2009 at 2:32 PM, Ray Fix<<a href="mailto:rayfix.ml@gmail.com">rayfix.ml@gmail.com</a>> wrote:<br><blockquote type="cite">Still working on it.</blockquote><br>It doesn't really matter what void* translates to in the IR to;<br>nothing should attempt to load from a void* or do arithmetic with it<br>anyway.  The use of i8* is purely tradition; I think you could change<br>CodeGenTypes::ConvertNewType to use an arbitrary type without any<br>trouble.  And ExprConstant.cpp is at a the AST level, so it isn't<br>really relevant here beyond the fact that we support void* arithmetic;<br>we handle that explicitly in ScalarExprEmitter::EmitAdd and friends,<br>though.<br></div></blockquote></div><br><div>Thank you Eli!    I *really* appreciate deep insights like that.  I now understand that it doesn't really matter for void, but I went ahead and hacked up my version up to look better on my platform.</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(79, 129, 135); "><span style="color: #bb2ca2">    case</span><span style="color: #000000"> </span>BuiltinType<span style="color: #000000">::</span><span style="color: #31595d">Void</span><span style="color: #000000">:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(79, 129, 135); "><span style="color: #000000">    </span><span style="color: #bb2ca2">case</span><span style="color: #000000"> </span>BuiltinType<span style="color: #000000">::</span><span style="color: #31595d">ObjCId</span><span style="color: #000000">:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(79, 129, 135); "><span style="color: #000000">    </span><span style="color: #bb2ca2">case</span><span style="color: #000000"> </span>BuiltinType<span style="color: #000000">::</span><span style="color: #31595d">ObjCClass</span><span style="color: #000000">:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">      </span>// LLVM void type can only be used as the result of a function call.  Just</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">      </span>// map to the same as char.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">      <span style="color: #bb2ca2">return</span> <span style="color: #4f8187">llvm</span>::<span style="color: #4f8187">IntegerType</span>::<span style="color: #3d1d81">get</span>(<span style="color: #31595d">getLLVMContext</span>(), 8);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">To:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(79, 129, 135); "><font class="Apple-style-span" color="#BB2CA2"><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">      <span style="color: #bb2ca2">return</span> <span style="color: #4f8187">llvm</span>::<span style="color: #4f8187">IntegerType</span>::<span style="color: #3d1d81">get</span>(<span style="color: #31595d">getLLVMContext</span>(), </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">                                    <span style="color: #4f8187">Context</span>.<span style="color: #31595d">getTypeSize</span>(<span style="color: #4f8187">Context</span>.<span style="color: #4f8187">CharTy</span>));</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">For my platform that works nicely out to be i16.</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">Ray</span></font></div></div></div></body></html>