diff options
author | ed <ed@FreeBSD.org> | 2009-06-22 08:08:35 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-22 08:08:35 +0000 |
commit | 8927c19a5ed03bef55dac4b623688387bcc794dc (patch) | |
tree | b6403365e77095a79062d3379c9e6aea0df5f088 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | b8e7410b22fa573fb0078712439f343bc69208dd (diff) | |
download | FreeBSD-src-8927c19a5ed03bef55dac4b623688387bcc794dc.zip FreeBSD-src-8927c19a5ed03bef55dac4b623688387bcc794dc.tar.gz |
Update Clang sources to r73879.
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 18b2d75a..3992f8c 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -431,6 +431,32 @@ InstantiateDependentSizedArrayType(const DependentSizedArrayType *T, } QualType +TemplateTypeInstantiator:: +InstantiateDependentSizedExtVectorType(const DependentSizedExtVectorType *T, + unsigned Quals) const { + + // Instantiate the element type if needed. + QualType ElementType = T->getElementType(); + if (ElementType->isDependentType()) { + ElementType = Instantiate(ElementType); + if (ElementType.isNull()) + return QualType(); + } + + // Instantiate the size expression. + const Expr *SizeExpr = T->getSizeExpr(); + Sema::OwningExprResult InstantiatedArraySize = + SemaRef.InstantiateExpr(const_cast<Expr *>(SizeExpr), TemplateArgs); + if (InstantiatedArraySize.isInvalid()) + return QualType(); + + return SemaRef.BuildExtVectorType(ElementType, + SemaRef.Owned( + InstantiatedArraySize.takeAs<Expr>()), + T->getAttributeLoc()); +} + +QualType TemplateTypeInstantiator::InstantiateVectorType(const VectorType *T, unsigned Quals) const { // FIXME: Implement this @@ -564,6 +590,7 @@ InstantiateTemplateTypeParmType(const TemplateTypeParmType *T, // parameter with the template "level" reduced by one. return SemaRef.Context.getTemplateTypeParmType(T->getDepth() - 1, T->getIndex(), + T->isParameterPack(), T->getName()) .getQualifiedType(Quals); } @@ -630,24 +657,24 @@ InstantiateTypenameType(const TypenameType *T, unsigned Quals) const { QualType TemplateTypeInstantiator:: -InstantiateObjCInterfaceType(const ObjCInterfaceType *T, - unsigned Quals) const { +InstantiateObjCObjectPointerType(const ObjCObjectPointerType *T, + unsigned Quals) const { assert(false && "Objective-C types cannot be dependent"); return QualType(); } -QualType +QualType TemplateTypeInstantiator:: -InstantiateObjCQualifiedInterfaceType(const ObjCQualifiedInterfaceType *T, - unsigned Quals) const { +InstantiateObjCInterfaceType(const ObjCInterfaceType *T, + unsigned Quals) const { assert(false && "Objective-C types cannot be dependent"); return QualType(); } QualType TemplateTypeInstantiator:: -InstantiateObjCQualifiedIdType(const ObjCQualifiedIdType *T, - unsigned Quals) const { +InstantiateObjCQualifiedInterfaceType(const ObjCQualifiedInterfaceType *T, + unsigned Quals) const { assert(false && "Objective-C types cannot be dependent"); return QualType(); } @@ -1153,6 +1180,10 @@ TemplateArgument Sema::Instantiate(TemplateArgument Arg, return TemplateArgument(); return TemplateArgument(E.takeAs<Expr>()); } + + case TemplateArgument::Pack: + assert(0 && "FIXME: Implement!"); + break; } assert(false && "Unhandled template argument kind"); |