<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 25, 2010, at 1:34 PM, Douglas Gregor wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 25, 2010, at 1:33 PM, John McCall wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On May 25, 2010, at 12:56 PM, Douglas Gregor wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On May 25, 2010, at 12:54 PM, Charles Davis wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">On 5/25/10 11:18 AM, John McCall wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">On May 24, 2010, at 10:43 PM, Charles Davis wrote:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">This is the first patch in my GSoC series, in which I will factor out<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">C++ ABI support in IRgen so that we can support other C++ ABIs. This<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">patch is very simple. It just adds a class hierarchy similar to the one<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">for Objective-C runtimes, and a basic implementation for the current GNU<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">C++ ABI. All it supports is name mangling. CodeGenFunction has been<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">redirected to use this new interface instead of holding the<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">MangleContext itself (which is very specific to the GNU ABI right now).<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">For better or worse, people call this the Itanium ABI; gcc's implementation hews<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">faithfully to that standard, and we should use that name. The term "GNU ABI" is likely<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">to make people think of the old (pre-v3.2) gcc ABI.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Noted.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Also, I think we can live without the "CG" prefix on "CGCXXABI".<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Done. (The header name still has the CG prefix, though.)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I'd prefer to avoid lazy initialization. We should never be calling into the<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">CXXABI for non-C++ code, so you should be able to create it during initialization<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">if CPlusPlus is set and then assert on its existence in getCXXABI().<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I don't know about that.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">When I added the assert, clang started asserting whenever it was<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">generating IR for non-C++ (that's C and ObjC) code. I think clang right<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">now just assumes that the MangleContext is always available and will "Do<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the Right Thing" based on whether or not Features.CPlusPlus is set.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I agree, C and ObjC IRgen shouldn't be calling into any C++-specific<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">stuff. But I'll fix that later.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">We use the "C++" mangler for some things in C/Objective-C as well, including blocks (a recent change), overloaded functions in C, and (IIRC) some Objective-C method names.<br></blockquote><br>Ah, right, I'd forgotten about that. So yeah, we should continue to lazily create the C++ ABI.<br><br>I suppose it's reasonable to always defer these manglings to the target C++ ABI. Maybe we can abstract out some common functionality so that new ABIs don't need so many redundant manglings.<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><div><br></div><div>Yes, I think that makes sense. Separating ObjC from C++ might be reasonable, for example.</div></div></div></blockquote><div><br class="webkit-block-placeholder"></div>ObjC does not do any C++ style mangling (ObjC's type encoding is in ASTContext.cpp). Blocks are part of all languages. There might be some ObjC specific code</div><div>added inadvertently though which should be moved out.</div><div><br class="webkit-block-placeholder"></div><div>- Fariborz</div><div><br class="webkit-block-placeholder"></div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div><br></div>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote></div><br></body></html>