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

Andrew Sutton andrew.n.sutton at gmail.com
Tue Jan 26 14:26:03 PST 2010


> PCH is our primary AST serialization mechanism, and many of the current and
> future clients of serialized ASTs are major consumers of accurate source
> locations.  Please preserve everything in the decl.
>

Sounds fair. I'll see what I can do. I'm trying to leave breadcrumbs whever
I'm unsure what the correct behavior is.


> That seems reasonable.  There's an EmptyShell class that's used to
> distinguish PCH constructors in the Expr classes;  that's probably a good
> idea here for these Create functions as well.
>

That's probably a good idea. I'll check it out.


> --- include/clang/Frontend/PCHReader.h  (revision 94542)
> +++ include/clang/Frontend/PCHReader.h  (working copy)
> +#include "clang/AST/DeclCXX.h"
>
> You can get away with just predeclaring CXXBaseSpecifier here; same thing
> in PCHWriter.h.
>

Yup. Missed that one.

  bool hasUserDeclaredConstructor() const {
> -    assert((isDefinition() ||
> +    // FIXME: Injected class names are troublesome and cause assertions in
> +    // the PCH writer if we don't allow them to be queried.
> +    assert((isDefinition() || isInjectedClassName() ||
>
> Probably best to just give injected class names a different layout in the
> PCH record;  otherwise they're going to occupy a lot of redundant space.
>

That might be easier said than done. The injected class name is serialized
as part of a DeclContext, just like any other nested declaration.

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/17e5eb1f/attachment.html>


More information about the cfe-dev mailing list