<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 11, 2012, at 7:22 PM, Richard Smith wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Sun, Jun 10, 2012 at 10:51 PM, Charles Davis <span dir="ltr"><<a href="mailto:cdavis@mymail.mines.edu" target="_blank">cdavis@mymail.mines.edu</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"><br><div><div class="im"><div>On Jun 9, 2012, at 5:49 PM, Richard Smith wrote:</div><br></div><div class="im"><blockquote type="cite"><div class="gmail_quote">On Sat, Jun 9, 2012 at 2:41 PM, Charles Davis <span dir="ltr"><<a href="mailto:cdavis@mymail.mines.edu" target="_blank">cdavis@mymail.mines.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
This is a grab bag of various fixes to the VC++ name mangler.<br>
<br>
- The mangler is now capable of mangling the names of virtual function tables--but not virtual base tables. That needs a serious refactoring of the ManglerContext's interface.<br>
- Local names are now mangled correctly--complete with anonymous numbered scopes. I needed this to make the virtual table test case--which I copied from the Itanium ABI test cases--work.<br>
- Instead of throwing an llvm_unreachable(), unimplemented cases now raise a compiler error. (This was the hardest part, since I needed source locations to give to the DiagnosticsEngine.<br>
<br>
This is a big patch, so I wanted to run it past the list before I commit. OK to commit?<br></blockquote><div><br></div><div>@@ -1087,10 +1211,22 @@</div><div><div> Dimensions.push_back(CAT->getSize());</div><div>
ElementTy = CAT->getElementType();</div><div> } else if (ElementTy->isVariableArrayType()) {</div><div>- llvm_unreachable("Don't know how to mangle VLAs!");</div><div>+ const VariableArrayType *VAT =</div>
<div>+ static_cast<const VariableArrayType *>(ElementTy.getTypePtr());</div></div><div><br></div><div>Don't do this, use ASTContext::getAsVariableArrayType(ElementTy) instead.</div></div></blockquote></div>
Now how did that get past? Fixed.<br><blockquote type="cite"><div class="gmail_quote"><div><br></div><div class="im"><div>Can you use a SmallVector<TemplateArgumentLoc> rather than allocating ASTTemplateArgumentListInfo objects in isTemplate?</div>
</div></div></blockquote>Done.<div class="im"><br><blockquote type="cite"><div class="gmail_quote">
<div><br></div><div>Several of your "cannot mangle this yet" diagnostics have unwanted fallthrough. Should these be fatal?</div></div></blockquote></div>I've fixed all of them to return early.<br></div></div>
</blockquote><div> </div><div>I think there are now cases where two declarations mangle to the same name, which could result in a crash in IRGen after your custom error is produced, but I don't think that's a disaster given the context.</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div class="gmail_quote"><div>I would remove "Oddly enough, " throughout.</div>
</div></blockquote>Done. It is too informal anyway.<br><blockquote type="cite"><div class="gmail_quote"><div>
<br></div><div class="im"><div>Is there a reason to create a new test file rather than adding tests to mangle-ms.cpp?</div></div></div>
</blockquote></div>Because the corresponding tests for the Itanium ABI (on which these are based) were in a separate file (cf. <clang>/test/CodeGenCXX/mangle-abi-examples.cpp).<div class="im"><div><br></div><div>New patch attached. OK to commit?</div>
</div></div></blockquote><div><br></div><div>Sure. Thanks!</div></div>
</blockquote></div>Thanks! r158376</body></html>