aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-04-30 10:46:26 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-04-30 10:46:26 +0000
commit25df423cfc6689cf21d51a66af84ea1e70d489df (patch)
treec40ab3323b5aae562ca2a709599ccbf6cf58b7e6 /lib/AST/Type.cpp
parent018a088b3b30e500efa9173f7cd4b1b1f6a065a8 (diff)
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
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp12
1 files changed, 8 insertions, 4 deletions
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<RecordType>()) {
if (const CXXRecordDecl *ClassDecl =
dyn_cast<CXXRecordDecl>(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<RecordType>()) {
if (const CXXRecordDecl *ClassDecl =
dyn_cast<CXXRecordDecl>(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<RecordType>()) {
if (const CXXRecordDecl *ClassDecl =
dyn_cast<CXXRecordDecl>(RT->getDecl())) {