From d2fa766ad03ebb5e5170c7593ade7c322fe174e8 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 20 Dec 2010 02:24:11 +0000 Subject: Introduce a new type, PackExpansionType, to capture types that are pack expansions, e.g. given template struct tuple; template struct tuple_of_refs { typedef tuple types; }; the type of the "types" typedef is a PackExpansionType whose pattern is Types&. This commit introduces support for creating pack expansions for template type arguments, as above, but not for any other kind of pack expansion, nor for any form of instantiation. llvm-svn: 122223 --- clang/lib/Serialization/ASTWriter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib/Serialization/ASTWriter.cpp') diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 26a54b1d55e..345cc8e74c7 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -298,6 +298,11 @@ ASTTypeWriter::VisitDependentTemplateSpecializationType( Code = TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION; } +void ASTTypeWriter::VisitPackExpansionType(const PackExpansionType *T) { + Writer.AddTypeRef(T->getPattern(), Record); + Code = TYPE_PACK_EXPANSION; +} + void ASTTypeWriter::VisitParenType(const ParenType *T) { Writer.AddTypeRef(T->getInnerType(), Record); Code = TYPE_PAREN; @@ -499,6 +504,9 @@ void TypeLocWriter::VisitDependentTemplateSpecializationTypeLoc( Writer.AddTemplateArgumentLocInfo(TL.getArgLoc(I).getArgument().getKind(), TL.getArgLoc(I).getLocInfo(), Record); } +void TypeLocWriter::VisitPackExpansionTypeLoc(PackExpansionTypeLoc TL) { + Writer.AddSourceLocation(TL.getEllipsisLoc(), Record); +} void TypeLocWriter::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) { Writer.AddSourceLocation(TL.getNameLoc(), Record); } -- cgit v1.2.3