From 25df423cfc6689cf21d51a66af84ea1e70d489df Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 30 Apr 2011 10:46:26 +0000 Subject: Make type-traits reflect that Clang's vectors act like scalar types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130606 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Type.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/AST/Type.cpp') diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index ae52ff06fa..59cd5a3dc7 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -891,7 +891,8 @@ bool Type::isLiteralType() const { // C++0x [basic.types]p10: // A type is a literal type if it is: // -- a scalar type; or - if (BaseTy->isScalarType()) return true; + // As an extension, Clang treats vector types as Scalar types. + if (BaseTy->isScalarType() || BaseTy->isVectorType()) return true; // -- a reference type; or if (BaseTy->isReferenceType()) return true; // -- a class type that has all of the following properties: @@ -936,7 +937,8 @@ bool Type::isTrivialType() const { if (BaseTy->isIncompleteType()) return false; - if (BaseTy->isScalarType()) return true; + // As an extension, Clang treats vector types as Scalar types. + if (BaseTy->isScalarType() || BaseTy->isVectorType()) return true; if (const RecordType *RT = BaseTy->getAs()) { if (const CXXRecordDecl *ClassDecl = dyn_cast(RT->getDecl())) { @@ -970,7 +972,8 @@ bool Type::isStandardLayoutType() const { if (BaseTy->isIncompleteType()) return false; - if (BaseTy->isScalarType()) return true; + // As an extension, Clang treats vector types as Scalar types. + if (BaseTy->isScalarType() || BaseTy->isVectorType()) return true; if (const RecordType *RT = BaseTy->getAs()) { if (const CXXRecordDecl *ClassDecl = dyn_cast(RT->getDecl())) @@ -1005,7 +1008,8 @@ bool Type::isCXX11PODType() const { if (BaseTy->isIncompleteType()) return false; - if (BaseTy->isScalarType()) return true; + // As an extension, Clang treats vector types as Scalar types. + if (BaseTy->isScalarType() || BaseTy->isVectorType()) return true; if (const RecordType *RT = BaseTy->getAs()) { if (const CXXRecordDecl *ClassDecl = dyn_cast(RT->getDecl())) { -- cgit v1.2.3-18-g5258