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/CodeGen/Mangle.cpp | 6 ++++++ clang/lib/CodeGen/MicrosoftCXXABI.cpp | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index 026f6ba3ff4..4659831a66d 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/lib/CodeGen/Mangle.cpp @@ -1474,6 +1474,12 @@ void CXXNameMangler::mangleType(const DependentSizedExtVectorType *T) { mangleType(T->getElementType()); } +void CXXNameMangler::mangleType(const PackExpansionType *T) { + // FIXME: We may need to push this mangling into the callers + Out << "sp"; + mangleType(T->getPattern()); +} + void CXXNameMangler::mangleType(const ObjCInterfaceType *T) { mangleSourceName(T->getDecl()->getIdentifier()); } diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp index dd2f1cb1345..aa9046f981b 100644 --- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -1140,6 +1140,10 @@ void MicrosoftCXXNameMangler::mangleType( "Don't know how to mangle DependentTemplateSpecializationTypes yet!"); } +void MicrosoftCXXNameMangler::mangleType(const PackExpansionType *T) { + assert(false && "Don't know how to mangle PackExpansionTypes yet!"); +} + void MicrosoftCXXNameMangler::mangleType(const TypeOfType *T) { assert(false && "Don't know how to mangle TypeOfTypes yet!"); } -- cgit v1.2.3