Mercurial > hg > CbC > CbC_llvm
comparison clang/lib/Parse/ParseExpr.cpp @ 209:dd44ba33042e
merged...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:36:09 +0900 |
parents | 2e18cbf3894f de4ac79aef9d |
children | 9e61cd3a874d |
comparison
equal
deleted
inserted
replaced
208:874d1390268d | 209:dd44ba33042e |
---|---|
1141 isVectorLiteral, | 1141 isVectorLiteral, |
1142 NotPrimaryExpression); | 1142 NotPrimaryExpression); |
1143 } | 1143 } |
1144 } | 1144 } |
1145 | 1145 |
1146 #ifndef noCbC | |
1147 if(NeedPrototypeDeclaration(Tok)){ | |
1148 CreatePrototypeDeclaration(); | |
1149 } | |
1150 #endif | |
1151 | |
1146 // Consume the identifier so that we can see if it is followed by a '(' or | 1152 // Consume the identifier so that we can see if it is followed by a '(' or |
1147 // '.'. | 1153 // '.'. |
1148 IdentifierInfo &II = *Tok.getIdentifierInfo(); | 1154 IdentifierInfo &II = *Tok.getIdentifierInfo(); |
1149 SourceLocation ILoc = ConsumeToken(); | 1155 SourceLocation ILoc = ConsumeToken(); |
1150 | 1156 |
1520 case tok::kw_double: | 1526 case tok::kw_double: |
1521 case tok::kw___bf16: | 1527 case tok::kw___bf16: |
1522 case tok::kw__Float16: | 1528 case tok::kw__Float16: |
1523 case tok::kw___float128: | 1529 case tok::kw___float128: |
1524 case tok::kw_void: | 1530 case tok::kw_void: |
1531 #ifndef noCbC | |
1532 case tok::kw___code: | |
1533 #endif | |
1525 case tok::kw_typename: | 1534 case tok::kw_typename: |
1526 case tok::kw_typeof: | 1535 case tok::kw_typeof: |
1527 case tok::kw___vector: | 1536 case tok::kw___vector: |
1528 #define GENERIC_IMAGE_TYPE(ImgType, Id) case tok::kw_##ImgType##_t: | 1537 #define GENERIC_IMAGE_TYPE(ImgType, Id) case tok::kw_##ImgType##_t: |
1529 #include "clang/Basic/OpenCLImageTypes.def" | 1538 #include "clang/Basic/OpenCLImageTypes.def" |
1730 cutOffParsing(); | 1739 cutOffParsing(); |
1731 Actions.CodeCompleteExpression(getCurScope(), | 1740 Actions.CodeCompleteExpression(getCurScope(), |
1732 PreferredType.get(Tok.getLocation())); | 1741 PreferredType.get(Tok.getLocation())); |
1733 return ExprError(); | 1742 return ExprError(); |
1734 } | 1743 } |
1744 #ifndef noCbC | |
1745 case tok::kw__CbC_return: | |
1746 Res = Prepare__retForGotoWithTheEnvExpr(); | |
1747 break; | |
1748 case tok::kw__CbC_environment: | |
1749 Res = Prepare__envForGotoWithTheEnvExpr(); | |
1750 break; | |
1751 #endif | |
1735 case tok::l_square: | 1752 case tok::l_square: |
1736 if (getLangOpts().CPlusPlus11) { | 1753 if (getLangOpts().CPlusPlus11) { |
1737 if (getLangOpts().ObjC) { | 1754 if (getLangOpts().ObjC) { |
1738 // C++11 lambda expressions and Objective-C message sends both start with a | 1755 // C++11 lambda expressions and Objective-C message sends both start with a |
1739 // square bracket. There are three possibilities here: | 1756 // square bracket. There are three possibilities here: |
3362 | 3379 |
3363 ExprResult Expr; | 3380 ExprResult Expr; |
3364 if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace)) { | 3381 if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace)) { |
3365 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists); | 3382 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists); |
3366 Expr = ParseBraceInitializer(); | 3383 Expr = ParseBraceInitializer(); |
3367 } else | 3384 } |
3385 #ifndef noCbC | |
3386 else if (Tok.is(tok::kw__CbC_return)){ | |
3387 Expr = Prepare__retForGotoWithTheEnvExpr(); | |
3388 } | |
3389 else if (Tok.is(tok::kw__CbC_environment)){ | |
3390 Expr = Prepare__envForGotoWithTheEnvExpr(); | |
3391 } | |
3392 else if (Tok.is(tok::identifier) && NeedPrototypeDeclaration(Tok)){ // check code segment declaration. | |
3393 CreatePrototypeDeclaration(); | |
3394 Expr = ParseAssignmentExpression(); | |
3395 } | |
3396 #endif | |
3397 else | |
3368 Expr = ParseAssignmentExpression(); | 3398 Expr = ParseAssignmentExpression(); |
3369 | 3399 |
3370 if (Tok.is(tok::ellipsis)) | 3400 if (Tok.is(tok::ellipsis)) |
3371 Expr = Actions.ActOnPackExpansion(Expr.get(), ConsumeToken()); | 3401 Expr = Actions.ActOnPackExpansion(Expr.get(), ConsumeToken()); |
3372 else if (Tok.is(tok::code_completion)) { | 3402 else if (Tok.is(tok::code_completion)) { |