[PATCH] D76690: [AST][SVE] Treat built-in SVE types as POD
Richard Sandiford via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 24 05:21:01 PDT 2020
rsandifo-arm created this revision.
rsandifo-arm added reviewers: sdesmalen, efriedma, rovka, rjmccall.
Herald added subscribers: cfe-commits, psnobl, rkruppe, tschuett.
Herald added a reviewer: rengolin.
Herald added a project: clang.
Built-in SVE types are POD in much the same that scalars and
fixed-length vectors are.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D76690
Files:
clang/lib/AST/Type.cpp
clang/test/SemaCXX/sizeless-1.cpp
Index: clang/test/SemaCXX/sizeless-1.cpp
===================================================================
--- clang/test/SemaCXX/sizeless-1.cpp
+++ clang/test/SemaCXX/sizeless-1.cpp
@@ -272,6 +272,7 @@
__builtin_va_list va;
__builtin_va_start(va, first);
+ __builtin_va_arg(va, svint8_t);
__builtin_va_end(va);
return count;
}
@@ -502,6 +503,16 @@
_Static_assert(!__is_assignable(svint8_t, svint8_t), "");
_Static_assert(__is_assignable(svint8_t &, svint8_t), "");
_Static_assert(!__is_assignable(svint8_t &, svint16_t), "");
+ _Static_assert(__has_nothrow_assign(svint8_t), "");
+ _Static_assert(__has_nothrow_move_assign(svint8_t), "");
+ _Static_assert(__has_nothrow_copy(svint8_t), "");
+ _Static_assert(__has_nothrow_constructor(svint8_t), "");
+ _Static_assert(__has_trivial_assign(svint8_t), "");
+ _Static_assert(__has_trivial_move_assign(svint8_t), "");
+ _Static_assert(__has_trivial_copy(svint8_t), "");
+ _Static_assert(__has_trivial_constructor(svint8_t), "");
+ _Static_assert(__has_trivial_move_constructor(svint8_t), "");
+ _Static_assert(__has_trivial_destructor(svint8_t), "");
_Static_assert(!__has_virtual_destructor(svint8_t), "");
_Static_assert(!__is_abstract(svint8_t), "");
_Static_assert(!__is_aggregate(svint8_t), "");
@@ -513,6 +524,7 @@
_Static_assert(!__is_enum(svint8_t), "");
_Static_assert(!__is_final(svint8_t), "");
_Static_assert(!__is_literal(svint8_t), "");
+ _Static_assert(__is_pod(svint8_t), "");
_Static_assert(!__is_polymorphic(svint8_t), "");
_Static_assert(__is_object(svint8_t), "");
_Static_assert(!__is_arithmetic(svint8_t), "");
Index: clang/lib/AST/Type.cpp
===================================================================
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2511,6 +2511,9 @@
const Type *BaseTy = ty->getBaseElementTypeUnsafe();
assert(BaseTy && "NULL element type");
+ if (BaseTy->isSizelessBuiltinType())
+ return true;
+
// Return false for incomplete types after skipping any incomplete array
// types which are expressly allowed by the standard and thus our API.
if (BaseTy->isIncompleteType())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76690.252271.patch
Type: text/x-patch
Size: 2163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200324/40801d1a/attachment.bin>
More information about the cfe-commits
mailing list