]> granicus.if.org Git - clang/commitdiff
ASTContext::getVectorType should preserve the vector kind for canonical types.
authorBob Wilson <bob.wilson@apple.com>
Tue, 16 Nov 2010 00:32:20 +0000 (00:32 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 16 Nov 2010 00:32:20 +0000 (00:32 +0000)
This is needed for Neon types when it is most natural to define them in terms
of a typedef.  For example, Neon poly8_t is a typedef for "signed char", and
we want to define polynomial vectors as vectors of that typedef.  Without this
change, the result will be a generic GCC-style vector.  I think this is safe
for other vector types as well, but I would appreciate a review of this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119300 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index 7b8223f4c609aa4128cc68f392931cd36fa29e5b..6823fa08d3d2c1d93acc0b1ef20a688abcc0310a 100644 (file)
@@ -1620,8 +1620,7 @@ QualType ASTContext::getVectorType(QualType vecType, unsigned NumElts,
   // so fill in the canonical type field.
   QualType Canonical;
   if (!vecType.isCanonical()) {
-    Canonical = getVectorType(getCanonicalType(vecType), NumElts,
-      VectorType::GenericVector);
+    Canonical = getVectorType(getCanonicalType(vecType), NumElts, VecKind);
 
     // Get the new insert position for the node we care about.
     VectorType *NewIP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos);