1 //===--- ParseOpenMP.cpp - OpenMP directives parsing ----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 /// \brief This file implements parsing of all OpenMP directives and clauses.
12 //===----------------------------------------------------------------------===//
14 #include "RAIIObjectsForParser.h"
15 #include "clang/AST/ASTConsumer.h"
16 #include "clang/AST/ASTContext.h"
17 #include "clang/AST/StmtOpenMP.h"
18 #include "clang/Parse/ParseDiagnostic.h"
19 #include "clang/Parse/Parser.h"
20 #include "clang/Sema/Scope.h"
21 #include "llvm/ADT/PointerIntPair.h"
22 using namespace clang;
24 //===----------------------------------------------------------------------===//
25 // OpenMP declarative directives.
26 //===----------------------------------------------------------------------===//
28 static OpenMPDirectiveKind ParseOpenMPDirectiveKind(Parser &P) {
29 // Array of foldings: F[i][0] F[i][1] ===> F[i][2].
30 // E.g.: OMPD_for OMPD_simd ===> OMPD_for_simd
31 // TODO: add other combined directives in topological order.
32 const OpenMPDirectiveKind F[][3] = {
33 { OMPD_for, OMPD_simd, OMPD_for_simd },
34 { OMPD_parallel, OMPD_for, OMPD_parallel_for },
35 { OMPD_parallel_for, OMPD_simd, OMPD_parallel_for_simd },
36 { OMPD_parallel, OMPD_sections, OMPD_parallel_sections }
38 auto Tok = P.getCurToken();
42 : getOpenMPDirectiveKind(P.getPreprocessor().getSpelling(Tok));
43 for (unsigned i = 0; i < llvm::array_lengthof(F); ++i) {
44 if (DKind == F[i][0]) {
45 Tok = P.getPreprocessor().LookAhead(0);
49 : getOpenMPDirectiveKind(P.getPreprocessor().getSpelling(Tok));
50 if (SDKind == F[i][1]) {
59 /// \brief Parsing of declarative OpenMP directives.
61 /// threadprivate-directive:
62 /// annot_pragma_openmp 'threadprivate' simple-variable-list
64 Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirective() {
65 assert(Tok.is(tok::annot_pragma_openmp) && "Not an OpenMP directive!");
66 ParenBraceBracketBalancer BalancerRAIIObj(*this);
68 SourceLocation Loc = ConsumeToken();
69 SmallVector<Expr *, 5> Identifiers;
70 auto DKind = ParseOpenMPDirectiveKind(*this);
73 case OMPD_threadprivate:
75 if (!ParseOpenMPSimpleVarList(OMPD_threadprivate, Identifiers, true)) {
76 // The last seen token is annot_pragma_openmp_end - need to check for
78 if (Tok.isNot(tok::annot_pragma_openmp_end)) {
79 Diag(Tok, diag::warn_omp_extra_tokens_at_eol)
80 << getOpenMPDirectiveName(OMPD_threadprivate);
81 SkipUntil(tok::annot_pragma_openmp_end, StopBeforeMatch);
83 // Skip the last annot_pragma_openmp_end.
85 return Actions.ActOnOpenMPThreadprivateDirective(Loc, Identifiers);
89 Diag(Tok, diag::err_omp_unknown_directive);
106 case OMPD_parallel_for:
107 case OMPD_parallel_for_simd:
108 case OMPD_parallel_sections:
112 Diag(Tok, diag::err_omp_unexpected_directive)
113 << getOpenMPDirectiveName(DKind);
116 SkipUntil(tok::annot_pragma_openmp_end);
117 return DeclGroupPtrTy();
120 /// \brief Parsing of declarative or executable OpenMP directives.
122 /// threadprivate-directive:
123 /// annot_pragma_openmp 'threadprivate' simple-variable-list
124 /// annot_pragma_openmp_end
126 /// executable-directive:
127 /// annot_pragma_openmp 'parallel' | 'simd' | 'for' | 'sections' |
128 /// 'section' | 'single' | 'master' | 'critical' [ '(' <name> ')' ] |
129 /// 'parallel for' | 'parallel sections' | 'task' | 'taskyield' |
130 /// 'barrier' | 'taskwait' | 'flush' | 'ordered' | 'atomic' |
131 /// 'for simd' | 'parallel for simd' | 'target' | 'teams' {clause}
132 /// annot_pragma_openmp_end
135 Parser::ParseOpenMPDeclarativeOrExecutableDirective(bool StandAloneAllowed) {
136 assert(Tok.is(tok::annot_pragma_openmp) && "Not an OpenMP directive!");
137 ParenBraceBracketBalancer BalancerRAIIObj(*this);
138 SmallVector<Expr *, 5> Identifiers;
139 SmallVector<OMPClause *, 5> Clauses;
140 SmallVector<llvm::PointerIntPair<OMPClause *, 1, bool>, OMPC_unknown + 1>
141 FirstClauses(OMPC_unknown + 1);
142 unsigned ScopeFlags =
143 Scope::FnScope | Scope::DeclScope | Scope::OpenMPDirectiveScope;
144 SourceLocation Loc = ConsumeToken(), EndLoc;
145 auto DKind = ParseOpenMPDirectiveKind(*this);
146 // Name of critical directive.
147 DeclarationNameInfo DirName;
148 StmtResult Directive = StmtError();
149 bool HasAssociatedStatement = true;
150 bool FlushHasClause = false;
153 case OMPD_threadprivate:
155 if (!ParseOpenMPSimpleVarList(OMPD_threadprivate, Identifiers, false)) {
156 // The last seen token is annot_pragma_openmp_end - need to check for
158 if (Tok.isNot(tok::annot_pragma_openmp_end)) {
159 Diag(Tok, diag::warn_omp_extra_tokens_at_eol)
160 << getOpenMPDirectiveName(OMPD_threadprivate);
161 SkipUntil(tok::annot_pragma_openmp_end, StopBeforeMatch);
164 Actions.ActOnOpenMPThreadprivateDirective(Loc, Identifiers);
165 Directive = Actions.ActOnDeclStmt(Res, Loc, Tok.getLocation());
167 SkipUntil(tok::annot_pragma_openmp_end);
170 if (PP.LookAhead(0).is(tok::l_paren)) {
171 FlushHasClause = true;
172 // Push copy of the current token back to stream to properly parse
173 // pseudo-clause OMPFlushClause.
179 if (!StandAloneAllowed) {
180 Diag(Tok, diag::err_omp_immediate_directive)
181 << getOpenMPDirectiveName(DKind);
183 HasAssociatedStatement = false;
184 // Fall through for further analysis.
194 case OMPD_parallel_for:
195 case OMPD_parallel_for_simd:
196 case OMPD_parallel_sections:
203 // Parse directive name of the 'critical' directive if any.
204 if (DKind == OMPD_critical) {
205 BalancedDelimiterTracker T(*this, tok::l_paren,
206 tok::annot_pragma_openmp_end);
207 if (!T.consumeOpen()) {
208 if (Tok.isAnyIdentifier()) {
210 DeclarationNameInfo(Tok.getIdentifierInfo(), Tok.getLocation());
213 Diag(Tok, diag::err_omp_expected_identifier_for_critical);
219 if (isOpenMPLoopDirective(DKind))
220 ScopeFlags |= Scope::OpenMPLoopDirectiveScope;
221 if (isOpenMPSimdDirective(DKind))
222 ScopeFlags |= Scope::OpenMPSimdDirectiveScope;
223 ParseScope OMPDirectiveScope(this, ScopeFlags);
224 Actions.StartOpenMPDSABlock(DKind, DirName, Actions.getCurScope(), Loc);
226 while (Tok.isNot(tok::annot_pragma_openmp_end)) {
227 OpenMPClauseKind CKind =
230 : FlushHasClause ? OMPC_flush
231 : getOpenMPClauseKind(PP.getSpelling(Tok));
232 FlushHasClause = false;
234 ParseOpenMPClause(DKind, CKind, !FirstClauses[CKind].getInt());
235 FirstClauses[CKind].setInt(true);
237 FirstClauses[CKind].setPointer(Clause);
238 Clauses.push_back(Clause);
242 if (Tok.is(tok::comma))
245 // End location of the directive.
246 EndLoc = Tok.getLocation();
247 // Consume final annot_pragma_openmp_end.
250 StmtResult AssociatedStmt;
251 bool CreateDirective = true;
252 if (HasAssociatedStatement) {
253 // The body is a block scope like in Lambdas and Blocks.
254 Sema::CompoundScopeRAII CompoundScope(Actions);
255 Actions.ActOnOpenMPRegionStart(DKind, getCurScope());
256 Actions.ActOnStartOfCompoundStmt();
258 AssociatedStmt = ParseStatement();
259 Actions.ActOnFinishOfCompoundStmt();
260 if (!AssociatedStmt.isUsable()) {
261 Actions.ActOnCapturedRegionError();
262 CreateDirective = false;
264 AssociatedStmt = Actions.ActOnCapturedRegionEnd(AssociatedStmt.get());
265 CreateDirective = AssociatedStmt.isUsable();
269 Directive = Actions.ActOnOpenMPExecutableDirective(
270 DKind, DirName, Clauses, AssociatedStmt.get(), Loc, EndLoc);
273 Actions.EndOpenMPDSABlock(Directive.get());
274 OMPDirectiveScope.Exit();
278 Diag(Tok, diag::err_omp_unknown_directive);
279 SkipUntil(tok::annot_pragma_openmp_end);
285 /// \brief Parses list of simple variables for '#pragma omp threadprivate'
288 /// simple-variable-list:
289 /// '(' id-expression {, id-expression} ')'
291 bool Parser::ParseOpenMPSimpleVarList(OpenMPDirectiveKind Kind,
292 SmallVectorImpl<Expr *> &VarList,
293 bool AllowScopeSpecifier) {
296 BalancedDelimiterTracker T(*this, tok::l_paren, tok::annot_pragma_openmp_end);
297 if (T.expectAndConsume(diag::err_expected_lparen_after,
298 getOpenMPDirectiveName(Kind)))
300 bool IsCorrect = true;
301 bool NoIdentIsFound = true;
303 // Read tokens while ')' or annot_pragma_openmp_end is not found.
304 while (Tok.isNot(tok::r_paren) && Tok.isNot(tok::annot_pragma_openmp_end)) {
306 SourceLocation TemplateKWLoc;
310 NoIdentIsFound = false;
312 if (AllowScopeSpecifier && getLangOpts().CPlusPlus &&
313 ParseOptionalCXXScopeSpecifier(SS, ParsedType(), false)) {
315 SkipUntil(tok::comma, tok::r_paren, tok::annot_pragma_openmp_end,
317 } else if (ParseUnqualifiedId(SS, false, false, false, ParsedType(),
318 TemplateKWLoc, Name)) {
320 SkipUntil(tok::comma, tok::r_paren, tok::annot_pragma_openmp_end,
322 } else if (Tok.isNot(tok::comma) && Tok.isNot(tok::r_paren) &&
323 Tok.isNot(tok::annot_pragma_openmp_end)) {
325 SkipUntil(tok::comma, tok::r_paren, tok::annot_pragma_openmp_end,
327 Diag(PrevTok.getLocation(), diag::err_expected)
329 << SourceRange(PrevTok.getLocation(), PrevTokLocation);
331 DeclarationNameInfo NameInfo = Actions.GetNameFromUnqualifiedId(Name);
333 Actions.ActOnOpenMPIdExpression(getCurScope(), SS, NameInfo);
335 VarList.push_back(Res.get());
338 if (Tok.is(tok::comma)) {
343 if (NoIdentIsFound) {
344 Diag(Tok, diag::err_expected) << tok::identifier;
349 IsCorrect = !T.consumeClose() && IsCorrect;
351 return !IsCorrect && VarList.empty();
354 /// \brief Parsing of OpenMP clauses.
357 /// if-clause | final-clause | num_threads-clause | safelen-clause |
358 /// default-clause | private-clause | firstprivate-clause | shared-clause
359 /// | linear-clause | aligned-clause | collapse-clause |
360 /// lastprivate-clause | reduction-clause | proc_bind-clause |
361 /// schedule-clause | copyin-clause | copyprivate-clause | untied-clause |
362 /// mergeable-clause | flush-clause | read-clause | write-clause |
363 /// update-clause | capture-clause | seq_cst-clause
365 OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
366 OpenMPClauseKind CKind, bool FirstClause) {
367 OMPClause *Clause = nullptr;
368 bool ErrorFound = false;
369 // Check if clause is allowed for the given directive.
370 if (CKind != OMPC_unknown && !isAllowedClauseForDirective(DKind, CKind)) {
371 Diag(Tok, diag::err_omp_unexpected_clause) << getOpenMPClauseName(CKind)
372 << getOpenMPDirectiveName(DKind);
379 case OMPC_num_threads:
382 // OpenMP [2.5, Restrictions]
383 // At most one if clause can appear on the directive.
384 // At most one num_threads clause can appear on the directive.
385 // OpenMP [2.8.1, simd construct, Restrictions]
386 // Only one safelen clause can appear on a simd directive.
387 // Only one collapse clause can appear on a simd directive.
388 // OpenMP [2.11.1, task Construct, Restrictions]
389 // At most one if clause can appear on the directive.
390 // At most one final clause can appear on the directive.
392 Diag(Tok, diag::err_omp_more_one_clause) << getOpenMPDirectiveName(DKind)
393 << getOpenMPClauseName(CKind);
397 Clause = ParseOpenMPSingleExprClause(CKind);
401 // OpenMP [2.14.3.1, Restrictions]
402 // Only a single default clause may be specified on a parallel, task or
404 // OpenMP [2.5, parallel Construct, Restrictions]
405 // At most one proc_bind clause can appear on the directive.
407 Diag(Tok, diag::err_omp_more_one_clause) << getOpenMPDirectiveName(DKind)
408 << getOpenMPClauseName(CKind);
412 Clause = ParseOpenMPSimpleClause(CKind);
415 // OpenMP [2.7.1, Restrictions, p. 3]
416 // Only one schedule clause can appear on a loop directive.
418 Diag(Tok, diag::err_omp_more_one_clause) << getOpenMPDirectiveName(DKind)
419 << getOpenMPClauseName(CKind);
423 Clause = ParseOpenMPSingleExprWithArgClause(CKind);
434 // OpenMP [2.7.1, Restrictions, p. 9]
435 // Only one ordered clause can appear on a loop directive.
436 // OpenMP [2.7.1, Restrictions, C/C++, p. 4]
437 // Only one nowait clause can appear on a for directive.
439 Diag(Tok, diag::err_omp_more_one_clause) << getOpenMPDirectiveName(DKind)
440 << getOpenMPClauseName(CKind);
444 Clause = ParseOpenMPClause(CKind);
447 case OMPC_firstprivate:
448 case OMPC_lastprivate:
454 case OMPC_copyprivate:
456 Clause = ParseOpenMPVarListClause(CKind);
459 Diag(Tok, diag::warn_omp_extra_tokens_at_eol)
460 << getOpenMPDirectiveName(DKind);
461 SkipUntil(tok::annot_pragma_openmp_end, StopBeforeMatch);
463 case OMPC_threadprivate:
464 Diag(Tok, diag::err_omp_unexpected_clause) << getOpenMPClauseName(CKind)
465 << getOpenMPDirectiveName(DKind);
466 SkipUntil(tok::comma, tok::annot_pragma_openmp_end, StopBeforeMatch);
469 return ErrorFound ? nullptr : Clause;
472 /// \brief Parsing of OpenMP clauses with single expressions like 'if',
473 /// 'final', 'collapse', 'safelen', 'num_threads', 'simdlen', 'num_teams' or
477 /// 'if' '(' expression ')'
480 /// 'final' '(' expression ')'
482 /// num_threads-clause:
483 /// 'num_threads' '(' expression ')'
486 /// 'safelen' '(' expression ')'
489 /// 'collapse' '(' expression ')'
491 OMPClause *Parser::ParseOpenMPSingleExprClause(OpenMPClauseKind Kind) {
492 SourceLocation Loc = ConsumeToken();
494 BalancedDelimiterTracker T(*this, tok::l_paren, tok::annot_pragma_openmp_end);
495 if (T.expectAndConsume(diag::err_expected_lparen_after,
496 getOpenMPClauseName(Kind)))
499 ExprResult LHS(ParseCastExpression(false, false, NotTypeCast));
500 ExprResult Val(ParseRHSOfBinaryExpression(LHS, prec::Conditional));
508 return Actions.ActOnOpenMPSingleExprClause(
509 Kind, Val.get(), Loc, T.getOpenLocation(), T.getCloseLocation());
512 /// \brief Parsing of simple OpenMP clauses like 'default' or 'proc_bind'.
515 /// 'default' '(' 'none' | 'shared' ')
517 /// proc_bind-clause:
518 /// 'proc_bind' '(' 'master' | 'close' | 'spread' ')
520 OMPClause *Parser::ParseOpenMPSimpleClause(OpenMPClauseKind Kind) {
521 SourceLocation Loc = Tok.getLocation();
522 SourceLocation LOpen = ConsumeToken();
524 BalancedDelimiterTracker T(*this, tok::l_paren, tok::annot_pragma_openmp_end);
525 if (T.expectAndConsume(diag::err_expected_lparen_after,
526 getOpenMPClauseName(Kind)))
529 unsigned Type = getOpenMPSimpleClauseType(
530 Kind, Tok.isAnnotation() ? "" : PP.getSpelling(Tok));
531 SourceLocation TypeLoc = Tok.getLocation();
532 if (Tok.isNot(tok::r_paren) && Tok.isNot(tok::comma) &&
533 Tok.isNot(tok::annot_pragma_openmp_end))
539 return Actions.ActOnOpenMPSimpleClause(Kind, Type, TypeLoc, LOpen, Loc,
543 /// \brief Parsing of OpenMP clauses like 'ordered'.
554 /// mergeable-clause:
560 OMPClause *Parser::ParseOpenMPClause(OpenMPClauseKind Kind) {
561 SourceLocation Loc = Tok.getLocation();
564 return Actions.ActOnOpenMPClause(Kind, Loc, Tok.getLocation());
568 /// \brief Parsing of OpenMP clauses with single expressions and some additional
569 /// argument like 'schedule' or 'dist_schedule'.
572 /// 'schedule' '(' kind [',' expression ] ')'
574 OMPClause *Parser::ParseOpenMPSingleExprWithArgClause(OpenMPClauseKind Kind) {
575 SourceLocation Loc = ConsumeToken();
576 SourceLocation CommaLoc;
578 BalancedDelimiterTracker T(*this, tok::l_paren, tok::annot_pragma_openmp_end);
579 if (T.expectAndConsume(diag::err_expected_lparen_after,
580 getOpenMPClauseName(Kind)))
584 unsigned Type = getOpenMPSimpleClauseType(
585 Kind, Tok.isAnnotation() ? "" : PP.getSpelling(Tok));
586 SourceLocation KLoc = Tok.getLocation();
587 if (Tok.isNot(tok::r_paren) && Tok.isNot(tok::comma) &&
588 Tok.isNot(tok::annot_pragma_openmp_end))
591 if (Kind == OMPC_schedule &&
592 (Type == OMPC_SCHEDULE_static || Type == OMPC_SCHEDULE_dynamic ||
593 Type == OMPC_SCHEDULE_guided) &&
594 Tok.is(tok::comma)) {
595 CommaLoc = ConsumeAnyToken();
596 ExprResult LHS(ParseCastExpression(false, false, NotTypeCast));
597 Val = ParseRHSOfBinaryExpression(LHS, prec::Conditional);
605 return Actions.ActOnOpenMPSingleExprWithArgClause(
606 Kind, Type, Val.get(), Loc, T.getOpenLocation(), KLoc, CommaLoc,
607 T.getCloseLocation());
610 static bool ParseReductionId(Parser &P, CXXScopeSpec &ReductionIdScopeSpec,
611 UnqualifiedId &ReductionId) {
612 SourceLocation TemplateKWLoc;
613 if (ReductionIdScopeSpec.isEmpty()) {
615 switch (P.getCurToken().getKind()) {
643 if (OOK != OO_None) {
644 SourceLocation OpLoc = P.ConsumeToken();
645 SourceLocation SymbolLocations[] = {OpLoc, OpLoc, SourceLocation()};
646 ReductionId.setOperatorFunctionId(OpLoc, OOK, SymbolLocations);
650 return P.ParseUnqualifiedId(ReductionIdScopeSpec, /*EnteringContext*/ false,
651 /*AllowDestructorName*/ false,
652 /*AllowConstructorName*/ false, ParsedType(),
653 TemplateKWLoc, ReductionId);
656 /// \brief Parsing of OpenMP clause 'private', 'firstprivate', 'lastprivate',
657 /// 'shared', 'copyin', 'copyprivate', 'flush' or 'reduction'.
660 /// 'private' '(' list ')'
661 /// firstprivate-clause:
662 /// 'firstprivate' '(' list ')'
663 /// lastprivate-clause:
664 /// 'lastprivate' '(' list ')'
666 /// 'shared' '(' list ')'
668 /// 'linear' '(' list [ ':' linear-step ] ')'
670 /// 'aligned' '(' list [ ':' alignment ] ')'
671 /// reduction-clause:
672 /// 'reduction' '(' reduction-identifier ':' list ')'
673 /// copyprivate-clause:
674 /// 'copyprivate' '(' list ')'
676 /// 'flush' '(' list ')'
678 OMPClause *Parser::ParseOpenMPVarListClause(OpenMPClauseKind Kind) {
679 SourceLocation Loc = Tok.getLocation();
680 SourceLocation LOpen = ConsumeToken();
681 SourceLocation ColonLoc = SourceLocation();
682 // Optional scope specifier and unqualified id for reduction identifier.
683 CXXScopeSpec ReductionIdScopeSpec;
684 UnqualifiedId ReductionId;
685 bool InvalidReductionId = false;
687 BalancedDelimiterTracker T(*this, tok::l_paren, tok::annot_pragma_openmp_end);
688 if (T.expectAndConsume(diag::err_expected_lparen_after,
689 getOpenMPClauseName(Kind)))
692 // Handle reduction-identifier for reduction clause.
693 if (Kind == OMPC_reduction) {
694 ColonProtectionRAIIObject ColonRAII(*this);
695 if (getLangOpts().CPlusPlus) {
696 ParseOptionalCXXScopeSpecifier(ReductionIdScopeSpec, ParsedType(), false);
699 ParseReductionId(*this, ReductionIdScopeSpec, ReductionId);
700 if (InvalidReductionId) {
701 SkipUntil(tok::colon, tok::r_paren, tok::annot_pragma_openmp_end,
704 if (Tok.is(tok::colon)) {
705 ColonLoc = ConsumeToken();
707 Diag(Tok, diag::warn_pragma_expected_colon) << "reduction identifier";
711 SmallVector<Expr *, 5> Vars;
712 bool IsComma = !InvalidReductionId;
713 const bool MayHaveTail = (Kind == OMPC_linear || Kind == OMPC_aligned);
714 while (IsComma || (Tok.isNot(tok::r_paren) && Tok.isNot(tok::colon) &&
715 Tok.isNot(tok::annot_pragma_openmp_end))) {
716 ColonProtectionRAIIObject ColonRAII(*this, MayHaveTail);
719 Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression());
720 if (VarExpr.isUsable()) {
721 Vars.push_back(VarExpr.get());
723 SkipUntil(tok::comma, tok::r_paren, tok::annot_pragma_openmp_end,
727 IsComma = Tok.is(tok::comma);
730 else if (Tok.isNot(tok::r_paren) &&
731 Tok.isNot(tok::annot_pragma_openmp_end) &&
732 (!MayHaveTail || Tok.isNot(tok::colon)))
733 Diag(Tok, diag::err_omp_expected_punc)
734 << ((Kind == OMPC_flush) ? getOpenMPDirectiveName(OMPD_flush)
735 : getOpenMPClauseName(Kind))
736 << (Kind == OMPC_flush);
739 // Parse ':' linear-step (or ':' alignment).
740 Expr *TailExpr = nullptr;
741 const bool MustHaveTail = MayHaveTail && Tok.is(tok::colon);
743 ColonLoc = Tok.getLocation();
746 Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression());
748 TailExpr = Tail.get();
750 SkipUntil(tok::comma, tok::r_paren, tok::annot_pragma_openmp_end,
756 if (Vars.empty() || (MustHaveTail && !TailExpr) || InvalidReductionId)
759 return Actions.ActOnOpenMPVarListClause(
760 Kind, Vars, TailExpr, Loc, LOpen, ColonLoc, Tok.getLocation(),
761 ReductionIdScopeSpec,
762 ReductionId.isValid() ? Actions.GetNameFromUnqualifiedId(ReductionId)
763 : DeclarationNameInfo());