From 231da7eb3dd13007e5e40fffe48998e5ef284e06 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Tue, 16 Nov 2010 00:32:20 +0000 Subject: [PATCH] ASTContext::getVectorType should preserve the vector kind for canonical types. 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 7b8223f4c6..6823fa08d3 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -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); -- 2.40.0