<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 14, 2009, at 4:56 AM, Jay Foad wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>2009/4/1 Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>>:<br><blockquote type="cite">As far API design goes, we're in a mixed state.  I'd strongly prefer<br></blockquote><blockquote type="cite">to get rid of std::vector from the various interfaces, f.e. creating a<br></blockquote><blockquote type="cite">constant array currently requires passing in an std::vector.  For<br></blockquote><blockquote type="cite">these sorts of interfaces, we should migrate to passing in a "Constant<br></blockquote><blockquote type="cite">*const* / unsigned" pair.  This allows use with a C array, a<br></blockquote><blockquote type="cite">SmallVector, std::vector, or any other container with sequential<br></blockquote><blockquote type="cite">storage.<br></blockquote><br>I've made a start on this for the constructors of StructType and<br>FunctionType. I've attached the patch so far, which is just enough to<br>build lib/VMCore/. Before I continue with it:</div></blockquote><div><br></div>Great!</div><div><br><blockquote type="cite"><div>1. Is this still the way you want to go?</div></blockquote><div><br></div>Yes</div><div><br></div><div><blockquote type="cite"><div>2. Do you care about breaking out-of-tree code that creates struct or<br>function types? I'm happy to convert cfe and llvm-gcc myself.</div></blockquote><div><br></div><div>Nope, we expect people with out of tree code to update themselves.</div><div><br></div><blockquote type="cite"><div>3. Are there any logistical problems with committing a wide-reaching<br>patch like this?</div></blockquote><div><br></div>I don't think so.</div><div><br></div><div><blockquote type="cite"><div>3. Any comments on the patch itself?<br></div></blockquote></div><br><div>The one major thing to be aware of is that it isn't safe to use &V[0] when V is an empty std::vector (though it is safe for smallvector).  When converting code, just be careful so that this doesn't break {} or void().</div><div><br></div><div>One minor thing is that <span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">StructType::get(NULL, 0) <span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">looks somewhat strange to me.  How about adding a zero-argument version of "get" that returns the empty struct?  That would allow code to use <span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">StructType::get()</span>.</span></span></div><div><br></div><div>Thanks for working on this Jay!</div><div><br></div><div>-Chris</div></body></html>