[cfe-dev] PCH for C++ (take 2)

Andrew Sutton andrew.n.sutton at gmail.com
Tue Jan 26 06:48:29 PST 2010

Here's a second pass on PCH support for CXX decls. This patch has mostly
complete support for namespaces, namespace aliases, using directives,
using/shadow decls, and C++ classes (and their bases and injected class
names, I suppose). There's some support written for some other C++ decls,
but it's incomplete and not tested--stubbed out.

Also, I probably need to back-fill some of the source location stuff. I
wasn't quite sure how much source location/range information I need to
serialize. Any guidance along these lines would be appreciated.

I had to add a number of get/set functions to some of the Decls in the AST
since it isn't generally feasible to create/init these objects at the same
time. Also, the CXX Ctor/Dtor/Conversion Decls get extra Create methods
since their usual Create functions would assert with an empty

I'm not very happy with the serialization of classes. I'm currently writing
a large number of properties that could be deduced from the addition of
constructors, destructors, operators, and base classes. One one hand, it
would be more graceful to allow the class to configure itself based on
elements. On the other hand, there is some computational cost associated
with the tests required to do that. Does anybody want to suggest a best
approach before I start writing method serialization?

Andrew Sutton
andrew.n.sutton at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100126/17e1d782/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pch.diff
Type: application/octet-stream
Size: 42139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100126/17e1d782/attachment.obj>

More information about the cfe-dev mailing list