Mercurial > hg > CbC > CbC_llvm
comparison clang/lib/Parse/ParseExpr.cpp @ 152:e8a9b4f4d755
pull from 146
author | anatofuz |
---|---|
date | Wed, 11 Mar 2020 18:29:16 +0900 |
parents | 1d019706d866 |
children | f935e5e0dbe7 |
comparison
equal
deleted
inserted
replaced
151:dbda48fb9435 | 152:e8a9b4f4d755 |
---|---|
1111 isVectorLiteral, | 1111 isVectorLiteral, |
1112 NotPrimaryExpression); | 1112 NotPrimaryExpression); |
1113 } | 1113 } |
1114 } | 1114 } |
1115 | 1115 |
1116 #ifndef noCbC | |
1117 if(NeedPrototypeDeclaration(Tok)){ | |
1118 CreatePrototypeDeclaration(); | |
1119 } | |
1120 #endif | |
1121 | |
1116 // Consume the identifier so that we can see if it is followed by a '(' or | 1122 // Consume the identifier so that we can see if it is followed by a '(' or |
1117 // '.'. | 1123 // '.'. |
1118 IdentifierInfo &II = *Tok.getIdentifierInfo(); | 1124 IdentifierInfo &II = *Tok.getIdentifierInfo(); |
1119 SourceLocation ILoc = ConsumeToken(); | 1125 SourceLocation ILoc = ConsumeToken(); |
1120 | 1126 |
1464 case tok::kw_float: | 1470 case tok::kw_float: |
1465 case tok::kw_double: | 1471 case tok::kw_double: |
1466 case tok::kw__Float16: | 1472 case tok::kw__Float16: |
1467 case tok::kw___float128: | 1473 case tok::kw___float128: |
1468 case tok::kw_void: | 1474 case tok::kw_void: |
1475 #ifndef noCbC | |
1476 case tok::kw___code: | |
1477 #endif | |
1469 case tok::kw_typename: | 1478 case tok::kw_typename: |
1470 case tok::kw_typeof: | 1479 case tok::kw_typeof: |
1471 case tok::kw___vector: | 1480 case tok::kw___vector: |
1472 #define GENERIC_IMAGE_TYPE(ImgType, Id) case tok::kw_##ImgType##_t: | 1481 #define GENERIC_IMAGE_TYPE(ImgType, Id) case tok::kw_##ImgType##_t: |
1473 #include "clang/Basic/OpenCLImageTypes.def" | 1482 #include "clang/Basic/OpenCLImageTypes.def" |
1684 } | 1693 } |
1685 if (getLangOpts().ObjC) { | 1694 if (getLangOpts().ObjC) { |
1686 Res = ParseObjCMessageExpression(); | 1695 Res = ParseObjCMessageExpression(); |
1687 break; | 1696 break; |
1688 } | 1697 } |
1698 #ifndef noCbC | |
1699 case tok::kw__CbC_return: | |
1700 Res = Prepare__retForGotoWithTheEnvExpr(); | |
1701 break; | |
1702 case tok::kw__CbC_environment: | |
1703 Res = Prepare__envForGotoWithTheEnvExpr(); | |
1704 break; | |
1705 #endif | |
1689 LLVM_FALLTHROUGH; | 1706 LLVM_FALLTHROUGH; |
1690 default: | 1707 default: |
1691 NotCastExpr = true; | 1708 NotCastExpr = true; |
1692 return ExprError(); | 1709 return ExprError(); |
1693 } | 1710 } |
3121 | 3138 |
3122 ExprResult Expr; | 3139 ExprResult Expr; |
3123 if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace)) { | 3140 if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace)) { |
3124 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists); | 3141 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists); |
3125 Expr = ParseBraceInitializer(); | 3142 Expr = ParseBraceInitializer(); |
3126 } else | 3143 } |
3144 #ifndef noCbC | |
3145 else if (Tok.is(tok::kw__CbC_return)){ | |
3146 Expr = Prepare__retForGotoWithTheEnvExpr(); | |
3147 } | |
3148 else if (Tok.is(tok::kw__CbC_environment)){ | |
3149 Expr = Prepare__envForGotoWithTheEnvExpr(); | |
3150 } | |
3151 else if (Tok.is(tok::identifier) && NeedPrototypeDeclaration(Tok)){ // check code segment declaration. | |
3152 CreatePrototypeDeclaration(); | |
3153 Expr = ParseAssignmentExpression(); | |
3154 } | |
3155 #endif | |
3156 else | |
3127 Expr = ParseAssignmentExpression(); | 3157 Expr = ParseAssignmentExpression(); |
3128 | 3158 |
3129 if (Tok.is(tok::ellipsis)) | 3159 if (Tok.is(tok::ellipsis)) |
3130 Expr = Actions.ActOnPackExpansion(Expr.get(), ConsumeToken()); | 3160 Expr = Actions.ActOnPackExpansion(Expr.get(), ConsumeToken()); |
3131 else if (Tok.is(tok::code_completion)) { | 3161 else if (Tok.is(tok::code_completion)) { |