<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="word-wrap: break-word;">Please continue sending these to cfe-dev rather than only me.  I will definitely look at them in either case, but it's good to be open.</div>
</blockquote><div><br>Sorry about that. I wasn't paying attention to the "Reply-To". I'm responding to the list and can re-post the patches later.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;"><div>Looking at the PCH patch, your general approach seems good, but I'm not sure why you've introduced PCHReader/Writer::VisitFunctionBase rather than just calling VisitFunctionDecl from all the subclass methods.  Is there some reason I'm not recalling that the param references have to come last in the record?</div>
</div></blockquote><div><br>I wasn't sure if ordering of records mattered or not. I was trying to preserve the same basic ordering of records for Method and kin, and not set the Code member twice. In the end, it probably won't matter too much.<br>
<br>I'll experiment a little and roll back that change if it's not a big deal.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;"><div><div>+void PCHDeclWriter::visitFunctionTemplateDecl(FunctionTemplateDecl *D) {</div><div>+  VisitTemplateDecl(D);</div><div>+  FunctionDecl* Func = D->getTemplatedDecl();</div><div>
+  if (CXXConstructorDecl* Ctor = dyn_cast<CXXConstructorDecl>(Func)) {</div><div>+    VisitCXXConstructorDecl(Ctor);</div><div>+  } else {</div><div>+    VisitFunctionDecl(Func);</div><div>+  }</div><div>+  Code = pch::DECL_FUNCTION_TEMPLATE;</div>
<div>+}<br><br></div></div></div></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="word-wrap: break-word;"><div><div>
</div><div>The easier and faster way to do this is to call Visit(D->getTemplatedDecl()).</div></div></div></blockquote><div><br>Good point :) I actually forgot that I'd written it that way.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;"><div><div><div><div>Eventually it'll need to support anything you can get in C, ObjC, C++, or ObjC++.  That is, it will need to support everything that clang can produce.</div></div>
</div></div></div></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="word-wrap: break-word;"><div><div><div><div>Everything which is a DeclContext needs a cursor, but not necessarily its own cursor type.  CXXRecordDecls need their own cursor type because of the base clauses;  CXXConstructorDecls need their own cursor type because of the initializers;  everything else should be able to use Function.  But I'm not totally sure;  I've done relatively little work in here.</div>
</div></div></div></div></blockquote><div><br>I'll have to spend some time digesting that information.<br></div></div><br>Andrew Sutton<br><a href="mailto:andrew.n.sutton@gmail.com">andrew.n.sutton@gmail.com</a><br>