diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-07-02 03:40:19 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-07-02 03:40:19 +0000 |
commit | 00396513046275f17c0e321bd8a5cc27080a3fa2 (patch) | |
tree | 886e885438bf58b01a29223292f21c349571ae76 /clang/lib/Sema/SemaExpr.cpp | |
parent | 85225b0a367a488df4920caf3d11c6b04754891b (diff) | |
download | bcm5719-llvm-00396513046275f17c0e321bd8a5cc27080a3fa2.tar.gz bcm5719-llvm-00396513046275f17c0e321bd8a5cc27080a3fa2.zip |
[OPENMP] Introduced type trait "__builtin_omp_required_simd_align" for default simd alignment.
Adds type trait "__builtin_omp_required_simd_align" after discussions here http://reviews.llvm.org/D9894
Differential Revision: http://reviews.llvm.org/D10597
llvm-svn: 241237
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 2f3f4c55f10..c023c8523a3 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -3689,7 +3689,7 @@ bool Sema::CheckUnaryExprOrTypeTraitOperand(QualType ExprType, // C11 6.5.3.4/3, C++11 [expr.alignof]p3: // When alignof or _Alignof is applied to an array type, the result // is the alignment of the element type. - if (ExprKind == UETT_AlignOf) + if (ExprKind == UETT_AlignOf || ExprKind == UETT_OpenMPRequiredSimdAlign) ExprType = Context.getBaseElementType(ExprType); if (ExprKind == UETT_VecStep) @@ -3824,6 +3824,9 @@ Sema::CreateUnaryExprOrTypeTraitExpr(Expr *E, SourceLocation OpLoc, isInvalid = CheckAlignOfExpr(*this, E); } else if (ExprKind == UETT_VecStep) { isInvalid = CheckVecStepExpr(E); + } else if (ExprKind == UETT_OpenMPRequiredSimdAlign) { + Diag(E->getExprLoc(), diag::err_openmp_default_simd_align_expr); + isInvalid = true; } else if (E->refersToBitField()) { // C99 6.5.3.4p1. Diag(E->getExprLoc(), diag::err_sizeof_alignof_bitfield) << 0; isInvalid = true; |