python3kgae created this revision.
python3kgae added reviewers: beanz, pow2clk, Anastasia, aaron.ballman, bogner.
Herald added a project: All.
python3kgae requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Remove check which disable BitInt as element type for ext_vector.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D133634
Files:
clang/lib/AST/ASTContext.cpp
clang/lib/Sema/SemaType.cpp
clang/test/Sema/builtin-classify-type.c
Index: clang/test/Sema/builtin-classify-type.c
===================================================================
--- clang/test/Sema/builtin-classify-type.c
+++ clang/test/Sema/builtin-classify-type.c
@@ -29,6 +29,8 @@
__attribute__((vector_size(16))) int vec;
typedef __attribute__((ext_vector_type(4))) int evec_t;
evec_t evec;
+ typedef _BitInt(16) int16_t3 __attribute__((ext_vector_type(3)));
+ int16_t3 t3;
_Atomic int atomic_i;
_Atomic double atomic_d;
_Complex int complex_i;
Index: clang/lib/Sema/SemaType.cpp
===================================================================
--- clang/lib/Sema/SemaType.cpp
+++ clang/lib/Sema/SemaType.cpp
@@ -2707,7 +2707,7 @@
// We explictly allow bool elements in ext_vector_type for C/C++.
bool IsNoBoolVecLang = getLangOpts().OpenCL || getLangOpts().OpenCLCPlusPlus;
if ((!T->isDependentType() && !T->isIntegerType() &&
- !T->isRealFloatingType()) || T->isBitIntType() ||
+ !T->isRealFloatingType()) ||
(IsNoBoolVecLang && T->isBooleanType())) {
Diag(AttrLoc, diag::err_attribute_invalid_vector_type) << T;
return QualType();
Index: clang/lib/AST/ASTContext.cpp
===================================================================
--- clang/lib/AST/ASTContext.cpp
+++ clang/lib/AST/ASTContext.cpp
@@ -4080,9 +4080,10 @@
/// getExtVectorType - Return the unique reference to an extended vector type
of
/// the specified element type and size. VectorType must be a built-in type.
-QualType
-ASTContext::getExtVectorType(QualType vecType, unsigned NumElts) const {
- assert(vecType->isBuiltinType() || vecType->isDependentType());
+QualType ASTContext::getExtVectorType(QualType vecType,
+ unsigned NumElts) const {
+ assert(vecType->isBuiltinType() || vecType->isDependentType() ||
+ vecType->isBitIntType());
// Check if we've already instantiated a vector of this type.
llvm::FoldingSetNodeID ID;
Index: clang/test/Sema/builtin-classify-type.c
===================================================================
--- clang/test/Sema/builtin-classify-type.c
+++ clang/test/Sema/builtin-classify-type.c
@@ -29,6 +29,8 @@
__attribute__((vector_size(16))) int vec;
typedef __attribute__((ext_vector_type(4))) int evec_t;
evec_t evec;
+ typedef _BitInt(16) int16_t3 __attribute__((ext_vector_type(3)));
+ int16_t3 t3;
_Atomic int atomic_i;
_Atomic double atomic_d;
_Complex int complex_i;
Index: clang/lib/Sema/SemaType.cpp
===================================================================
--- clang/lib/Sema/SemaType.cpp
+++ clang/lib/Sema/SemaType.cpp
@@ -2707,7 +2707,7 @@
// We explictly allow bool elements in ext_vector_type for C/C++.
bool IsNoBoolVecLang = getLangOpts().OpenCL || getLangOpts().OpenCLCPlusPlus;
if ((!T->isDependentType() && !T->isIntegerType() &&
- !T->isRealFloatingType()) || T->isBitIntType() ||
+ !T->isRealFloatingType()) ||
(IsNoBoolVecLang && T->isBooleanType())) {
Diag(AttrLoc, diag::err_attribute_invalid_vector_type) << T;
return QualType();
Index: clang/lib/AST/ASTContext.cpp
===================================================================
--- clang/lib/AST/ASTContext.cpp
+++ clang/lib/AST/ASTContext.cpp
@@ -4080,9 +4080,10 @@
/// getExtVectorType - Return the unique reference to an extended vector type of
/// the specified element type and size. VectorType must be a built-in type.
-QualType
-ASTContext::getExtVectorType(QualType vecType, unsigned NumElts) const {
- assert(vecType->isBuiltinType() || vecType->isDependentType());
+QualType ASTContext::getExtVectorType(QualType vecType,
+ unsigned NumElts) const {
+ assert(vecType->isBuiltinType() || vecType->isDependentType() ||
+ vecType->isBitIntType());
// Check if we've already instantiated a vector of this type.
llvm::FoldingSetNodeID ID;
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits