[cfe-commits] [PATCH] Even More Abbreviations for PCH Serialization
Jonathan Turner
jonathan_d_turner at apple.com
Fri Jun 3 15:15:39 PDT 2011
On Jun 3, 2011, at 2:03 PM, Douglas Gregor wrote:
> + // Source locations require array (variable-length) abbreviations. The
> + // abbreviation infrastructure requires that arrays are encoded last, so
> + // we handle it here in the case of those clases derived from DeclaratorDecl
>
> Typo "clases"
Fixed.
> @@ -169,6 +176,20 @@
> void ASTDeclWriter::VisitTypedefDecl(TypedefDecl *D) {
> VisitTypeDecl(D);
> Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record);
> +
> + if (!D->hasAttrs() &&
> + !D->isImplicit() &&
> + !D->isUsed(false) &&
> + D->getPCHLevel() == 0 &&
> + D->RedeclLink.getNext() == D &&
> + !D->isInvalidDecl() &&
> + !D->isReferenced() &&
> + D->getAccess() == AS_none &&
> + D->getDeclName().getNameKind() == DeclarationName::Identifier &&
> + D->getTypeSourceInfo())
> +
> + AbbrevToUse = Writer.getDeclTypedefAbbrev();
>
> Do we actually need the D->getTypeSourceInfo() check here? It seems unnecessary.
I'm being careful with any node types that use the TypeSourceInfo because the call to ASTWriter::AddTypeSourceInfo works differently if its first argument (which is D->getTypeSourceInfo() for us) is 0.
> Also: that extra blank line before the AbbrevToUse assignment looks weird.
Agreed. Fixed.
> With those little cleanups, this patch looks good! If you haven't done so already, please request commit access as described here:
>
> http://llvm.org/docs/DeveloperPolicy.html#commitaccess
Done. Looks like I should have commit access now.
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110603/7051c4ff/attachment.html>
More information about the cfe-commits
mailing list