[cfe-commits] [PATCH] Even More Abbreviations for PCH Serialization

Douglas Gregor dgregor at apple.com
Fri Jun 3 15:16:12 PDT 2011


On Jun 3, 2011, at 3:14 PM, Jonathan Turner wrote:

> 
> 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.   

Sure, but as long as it always puts *something* into the record, we should be fine.

> 
> Done.  Looks like I should have commit access now.

Okay!

	- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110603/640da9f3/attachment.html>


More information about the cfe-commits mailing list