summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-22 08:08:35 +0000
committered <ed@FreeBSD.org>2009-06-22 08:08:35 +0000
commit8927c19a5ed03bef55dac4b623688387bcc794dc (patch)
treeb6403365e77095a79062d3379c9e6aea0df5f088 /lib/Sema/SemaTemplateInstantiate.cpp
parentb8e7410b22fa573fb0078712439f343bc69208dd (diff)
downloadFreeBSD-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.cpp45
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");
OpenPOWER on IntegriCloud