Lines Matching +full:p +full:- +full:tile

1 //===--- ParseOpenACC.cpp - OpenACC-specific parsing support --------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
36 // Translate single-token string representations to the OpenACC Directive Kind.
46 Tok.getIdentifierInfo()->getName()) in getOpenACCDirectiveKind()
68 Tok.getIdentifierInfo()->getName()) in getOpenACCDirectiveKind()
74 // Translate single-token string representations to the OpenCC Clause Kind.
97 Tok.getIdentifierInfo()->getName()) in getOpenACCClauseKind()
142 .Case("tile", OpenACCClauseKind::Tile) in getOpenACCClauseKind()
157 Tok.getIdentifierInfo()->getName()) in getOpenACCAtomicKind()
170 Tok.getIdentifierInfo()->getName()) in getOpenACCDefaultClauseKind()
197 return Tok.getIdentifierInfo()->isStr("readonly"); in isOpenACCSpecialToken()
199 return Tok.getIdentifierInfo()->isStr("devnum"); in isOpenACCSpecialToken()
201 return Tok.getIdentifierInfo()->isStr("queues"); in isOpenACCSpecialToken()
203 return Tok.getIdentifierInfo()->isStr("zero"); in isOpenACCSpecialToken()
205 return Tok.getIdentifierInfo()->isStr("force"); in isOpenACCSpecialToken()
207 return Tok.getIdentifierInfo()->isStr("num"); in isOpenACCSpecialToken()
209 return Tok.getIdentifierInfo()->isStr("length"); in isOpenACCSpecialToken()
211 return Tok.getIdentifierInfo()->isStr("dim"); in isOpenACCSpecialToken()
213 return Tok.getIdentifierInfo()->isStr("static"); in isOpenACCSpecialToken()
219 /// 'identifier-like' token, but don't want to give awkward error messages in
221 bool isTokenIdentifierOrKeyword(Parser &P, Token Tok) { in isTokenIdentifierOrKeyword() argument
226 Tok.getIdentifierInfo()->isKeyword(P.getLangOpts())) in isTokenIdentifierOrKeyword()
238 bool tryParseAndConsumeSpecialTokenKind(Parser &P, OpenACCSpecialTokenKind Kind, in tryParseAndConsumeSpecialTokenKind() argument
240 Token IdentTok = P.getCurToken(); in tryParseAndConsumeSpecialTokenKind()
241 // If this is an identifier-like thing followed by ':', it is one of the in tryParseAndConsumeSpecialTokenKind()
243 if (isTokenIdentifierOrKeyword(P, IdentTok) && P.NextToken().is(tok::colon)) { in tryParseAndConsumeSpecialTokenKind()
244 P.ConsumeToken(); in tryParseAndConsumeSpecialTokenKind()
245 P.ConsumeToken(); in tryParseAndConsumeSpecialTokenKind()
248 P.Diag(IdentTok, diag::err_acc_invalid_tag_kind) in tryParseAndConsumeSpecialTokenKind()
266 return Tok.getIdentifierInfo()->isStr("parallel"); in isOpenACCDirectiveKind()
268 return Tok.getIdentifierInfo()->isStr("serial"); in isOpenACCDirectiveKind()
270 return Tok.getIdentifierInfo()->isStr("kernels"); in isOpenACCDirectiveKind()
272 return Tok.getIdentifierInfo()->isStr("data"); in isOpenACCDirectiveKind()
274 return Tok.getIdentifierInfo()->isStr("host_data"); in isOpenACCDirectiveKind()
276 return Tok.getIdentifierInfo()->isStr("loop"); in isOpenACCDirectiveKind()
278 return Tok.getIdentifierInfo()->isStr("cache"); in isOpenACCDirectiveKind()
288 return Tok.getIdentifierInfo()->isStr("atomic"); in isOpenACCDirectiveKind()
290 return Tok.getIdentifierInfo()->isStr("routine"); in isOpenACCDirectiveKind()
292 return Tok.getIdentifierInfo()->isStr("declare"); in isOpenACCDirectiveKind()
294 return Tok.getIdentifierInfo()->isStr("init"); in isOpenACCDirectiveKind()
296 return Tok.getIdentifierInfo()->isStr("shutdown"); in isOpenACCDirectiveKind()
298 return Tok.getIdentifierInfo()->isStr("set"); in isOpenACCDirectiveKind()
300 return Tok.getIdentifierInfo()->isStr("update"); in isOpenACCDirectiveKind()
302 return Tok.getIdentifierInfo()->isStr("wait"); in isOpenACCDirectiveKind()
309 OpenACCReductionOperator ParseReductionOperator(Parser &P) { in ParseReductionOperator() argument
313 if (P.NextToken().isNot(tok::colon)) { in ParseReductionOperator()
314 P.Diag(P.getCurToken(), diag::err_acc_expected_reduction_operator); in ParseReductionOperator()
317 Token ReductionKindTok = P.getCurToken(); in ParseReductionOperator()
319 P.ConsumeToken(); in ParseReductionOperator()
320 P.ConsumeToken(); in ParseReductionOperator()
338 if (ReductionKindTok.getIdentifierInfo()->isStr("max")) in ParseReductionOperator()
340 if (ReductionKindTok.getIdentifierInfo()->isStr("min")) in ParseReductionOperator()
344 P.Diag(ReductionKindTok, diag::err_acc_invalid_reduction_operator); in ParseReductionOperator()
350 /// Used for cases where we expect an identifier-like token, but don't want to
352 bool expectIdentifierOrKeyword(Parser &P) { in expectIdentifierOrKeyword() argument
353 Token Tok = P.getCurToken(); in expectIdentifierOrKeyword()
355 if (isTokenIdentifierOrKeyword(P, Tok)) in expectIdentifierOrKeyword()
358 P.Diag(P.getCurToken(), diag::err_expected) << tok::identifier; in expectIdentifierOrKeyword()
363 ParseOpenACCEnterExitDataDirective(Parser &P, Token FirstTok, in ParseOpenACCEnterExitDataDirective() argument
365 Token SecondTok = P.getCurToken(); in ParseOpenACCEnterExitDataDirective()
368 P.Diag(FirstTok, diag::err_acc_invalid_directive) in ParseOpenACCEnterExitDataDirective()
375 P.ConsumeAnyToken(); in ParseOpenACCEnterExitDataDirective()
379 P.Diag(SecondTok, diag::err_expected) << tok::identifier; in ParseOpenACCEnterExitDataDirective()
381 P.Diag(FirstTok, diag::err_acc_invalid_directive) in ParseOpenACCEnterExitDataDirective()
382 << 1 << FirstTok.getIdentifierInfo()->getName() in ParseOpenACCEnterExitDataDirective()
383 << SecondTok.getIdentifierInfo()->getName(); in ParseOpenACCEnterExitDataDirective()
392 OpenACCAtomicKind ParseOpenACCAtomicKind(Parser &P) { in ParseOpenACCAtomicKind() argument
393 Token AtomicClauseToken = P.getCurToken(); in ParseOpenACCAtomicKind()
407 P.ConsumeToken(); in ParseOpenACCAtomicKind()
412 OpenACCDirectiveKind ParseOpenACCDirectiveKind(Parser &P) { in ParseOpenACCDirectiveKind() argument
413 Token FirstTok = P.getCurToken(); in ParseOpenACCDirectiveKind()
418 P.Diag(FirstTok, diag::err_acc_missing_directive); in ParseOpenACCDirectiveKind()
420 if (P.getCurToken().isNot(tok::annot_pragma_openacc_end)) in ParseOpenACCDirectiveKind()
421 P.ConsumeAnyToken(); in ParseOpenACCDirectiveKind()
426 P.ConsumeToken(); in ParseOpenACCDirectiveKind()
439 P.Diag(FirstTok, diag::err_acc_invalid_directive) in ParseOpenACCDirectiveKind()
445 return ParseOpenACCEnterExitDataDirective(P, FirstTok, ExDirKind); in ParseOpenACCDirectiveKind()
454 Token SecondTok = P.getCurToken(); in ParseOpenACCDirectiveKind()
463 P.ConsumeToken(); in ParseOpenACCDirectiveKind()
466 P.ConsumeToken(); in ParseOpenACCDirectiveKind()
469 P.ConsumeToken(); in ParseOpenACCDirectiveKind()
533 case OpenACCClauseKind::Tile: in getClauseParensKind()
562 void SkipUntilEndOfDirective(Parser &P) { in SkipUntilEndOfDirective() argument
563 while (P.getCurToken().isNot(tok::annot_pragma_openacc_end)) in SkipUntilEndOfDirective()
564 P.ConsumeAnyToken(); in SkipUntilEndOfDirective()
577 llvm_unreachable("Unhandled directive->assoc stmt"); in doesDirectiveHaveAssociatedStmt()
622 getActions().ActOnCondition(getCurScope(), ER.get()->getExprLoc(), in ParseOpenACCConditionExpr()
630 // a pqr-list is a comma-separated list of pdr items. The one exception is a
631 // clause-list, which is a list of one or more clauses optionally separated by
638 // Comma is optional in a clause-list. in ParseOpenACCClauseList()
707 /// The argument to the device_type clause is a comma-separated list of one or
712 /// device_type( device-type-list )
741 /// size-expr is one of:
743 // int-expr
744 // Note that this is specified under 'gang-arg-list', but also applies to 'tile'
749 // The size-expr ends up being ambiguous when only looking at the current in ParseOpenACCSizeExpr()
784 /// where gang-arg is one of:
785 /// [num:]int-expr
786 /// dim:int-expr
787 /// static:size-expr
792 // 'static' just takes a size-expr, which is an int-expr or an asterisk. in ParseOpenACCGangArg()
811 // Fallthrough to the 'int-expr' handling for when 'num' is omitted. in ParseOpenACCGangArg()
838 // The OpenACC Clause List is a comma or space-delimited list of clauses (see
841 // However, they all are named with a single-identifier (or auto/default!)
942 // If we're missing a clause-kind (or it is invalid), see if we can parse in ParseOpenACCClauseParams()
943 // the var-list anyway. in ParseOpenACCClauseParams()
949 // The 'self' clause is a var-list instead of a 'condition' in the case of in ParseOpenACCClauseParams()
1044 case OpenACCClauseKind::Tile: in ParseOpenACCClauseParams()
1131 // If we have optional parens, make sure we set the end-location to the in ParseOpenACCClauseParams()
1143 /// In this section and throughout the specification, the term async-argument
1147 /// values are negative values, so as not to conflict with a user-specified
1148 /// nonnegative async-argument.
1156 /// In this section and throughout the specification, the term wait-argument
1158 /// [ devnum : int-expr : ] [ queues : ] async-argument-list
1162 // [devnum : int-expr : ] in ParseOpenACCWaitArgument()
1199 // the term 'async-argument' means a nonnegative scalar integer expression, or in ParseOpenACCWaitArgument()
1281 /// - a variable name (a scalar, array, or composite variable name)
1282 /// - a subarray specification with subscript ranges
1283 /// - an array element
1284 /// - a member of a composite variable
1285 /// - a common block name between slashes (fortran only)
1331 /// #pragma acc cache ([readonly:]var-list) new-line
1348 // ParseOpenACCVarList should leave us before a r-paren, so no need to skip in ParseOpenACCCacheVarList()
1362 // specifiers that need to be taken care of. Atomic has an 'atomic-clause' in ParseOpenACCDirective()
1379 // Routine has an optional paren-wrapped name of a function in the local in ParseOpenACCDirective()
1397 // OpenACC has an optional paren-wrapped 'wait-argument'. in ParseOpenACCDirective()
1405 // Cache's paren var-list is required, so error here if it isn't provided. in ParseOpenACCDirective()
1406 // We know that the consumeOpen above left the first non-paren here, so in ParseOpenACCDirective()