summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
diff options
context:
space:
mode:
authorGuy Benyei <guy.benyei@intel.com>2013-01-20 12:31:11 +0000
committerGuy Benyei <guy.benyei@intel.com>2013-01-20 12:31:11 +0000
commit1b4fb3e08b28f12d508aec0bbdcb6f41cfb0ee38 (patch)
tree5cf8e9985a92136f34520167b6a007eb00fe1468 /clang/lib/Parse
parent359e09d4f50f381dc85d64bc7ea4e06013d09779 (diff)
downloadbcm5719-llvm-1b4fb3e08b28f12d508aec0bbdcb6f41cfb0ee38.tar.gz
bcm5719-llvm-1b4fb3e08b28f12d508aec0bbdcb6f41cfb0ee38.zip
Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)
llvm-svn: 172973
Diffstat (limited to 'clang/lib/Parse')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp7
-rw-r--r--clang/lib/Parse/ParseExpr.cpp1
-rw-r--r--clang/lib/Parse/ParseTentative.cpp1
3 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index f9c68c79b9c..cfe5d1b16ab 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -2783,6 +2783,10 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_image3d_t, Loc,
PrevSpec, DiagID);
break;
+ case tok::kw_event_t:
+ isInvalid = DS.SetTypeSpecType(DeclSpec::TST_event_t, Loc,
+ PrevSpec, DiagID);
+ break;
case tok::kw___unknown_anytype:
isInvalid = DS.SetTypeSpecType(TST_unknown_anytype, Loc,
PrevSpec, DiagID);
@@ -3633,6 +3637,7 @@ bool Parser::isKnownToBeTypeSpecifier(const Token &Tok) const {
case tok::kw_image2d_t:
case tok::kw_image2d_array_t:
case tok::kw_image3d_t:
+ case tok::kw_event_t:
// struct-or-union-specifier (C99) or class-specifier (C++)
case tok::kw_class:
@@ -3713,6 +3718,7 @@ bool Parser::isTypeSpecifierQualifier() {
case tok::kw_image2d_t:
case tok::kw_image2d_array_t:
case tok::kw_image3d_t:
+ case tok::kw_event_t:
// struct-or-union-specifier (C99) or class-specifier (C++)
case tok::kw_class:
@@ -3865,6 +3871,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
case tok::kw_image2d_t:
case tok::kw_image2d_array_t:
case tok::kw_image3d_t:
+ case tok::kw_event_t:
// struct-or-union-specifier (C99) or class-specifier (C++)
case tok::kw_class:
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index d6d38c758ae..9c788a13364 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -1024,6 +1024,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
case tok::kw_image2d_t:
case tok::kw_image2d_array_t:
case tok::kw_image3d_t: {
+ case tok::kw_event_t:
if (!getLangOpts().CPlusPlus) {
Diag(Tok, diag::err_expected_expression);
return ExprError();
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp
index 78d73bca4c4..1116daa4d12 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -843,6 +843,7 @@ Parser::isExpressionOrTypeSpecifierSimple(tok::TokenKind Kind) {
case tok::kw_image2d_t:
case tok::kw_image2d_array_t:
case tok::kw_image3d_t:
+ case tok::kw_event_t:
case tok::kw___unknown_anytype:
return TPResult::False();
OpenPOWER on IntegriCloud