clang 24.0.0git
SemaOpenMP.h
Go to the documentation of this file.
1//===----- SemaOpenMP.h -- Semantic Analysis for OpenMP constructs -------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9/// This file declares semantic analysis for OpenMP constructs and
10/// clauses.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_SEMA_SEMAOPENMP_H
15#define LLVM_CLANG_SEMA_SEMAOPENMP_H
16
17#include "clang/AST/ASTFwd.h"
18#include "clang/AST/Attr.h"
24#include "clang/Basic/LLVM.h"
28#include "clang/Sema/DeclSpec.h"
30#include "clang/Sema/SemaBase.h"
31#include "llvm/ADT/DenseMap.h"
32#include "llvm/Frontend/OpenMP/OMP.h.inc"
33#include "llvm/Frontend/OpenMP/OMPConstants.h"
34#include <array>
35#include <optional>
36#include <string>
37#include <utility>
38
39namespace clang {
40namespace sema {
42} // namespace sema
43
44class DeclContext;
45class DeclGroupRef;
47class ParsedAttr;
48class Scope;
49
50class SemaOpenMP : public SemaBase {
51public:
52 SemaOpenMP(Sema &S);
53
54 friend class Parser;
55 friend class Sema;
56
58 using CapturedParamNameType = std::pair<StringRef, QualType>;
59
60 /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
61 /// context is "used as device code".
62 ///
63 /// - If CurContext is a `declare target` function or it is known that the
64 /// function is emitted for the device, emits the diagnostics immediately.
65 /// - If CurContext is a non-`declare target` function and we are compiling
66 /// for the device, creates a diagnostic which is emitted if and when we
67 /// realize that the function will be codegen'ed.
68 ///
69 /// Example usage:
70 ///
71 /// // Variable-length arrays are not allowed in NVPTX device code.
72 /// if (diagIfOpenMPDeviceCode(Loc, diag::err_vla_unsupported))
73 /// return ExprError();
74 /// // Otherwise, continue parsing as normal.
76 unsigned DiagID,
77 const FunctionDecl *FD);
78
79 /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
80 /// context is "used as host code".
81 ///
82 /// - If CurContext is a `declare target` function or it is known that the
83 /// function is emitted for the host, emits the diagnostics immediately.
84 /// - If CurContext is a non-host function, just ignore it.
85 ///
86 /// Example usage:
87 ///
88 /// // Variable-length arrays are not allowed in NVPTX device code.
89 /// if (diagIfOpenMPHostode(Loc, diag::err_vla_unsupported))
90 /// return ExprError();
91 /// // Otherwise, continue parsing as normal.
93 unsigned DiagID,
94 const FunctionDecl *FD);
95
96 /// The declarator \p D defines a function in the scope \p S which is nested
97 /// in an `omp begin/end declare variant` scope. In this method we create a
98 /// declaration for \p D and rename \p D according to the OpenMP context
99 /// selector of the surrounding scope. Return all base functions in \p Bases.
101 Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists,
103
104 /// Register \p D as specialization of all base functions in \p Bases in the
105 /// current `omp begin/end declare variant` scope.
108
109 /// Act on \p D, a function definition inside of an `omp [begin/end] assumes`.
111
112 /// Can we exit an OpenMP declare variant scope at the moment.
114 return !OMPDeclareVariantScopes.empty();
115 }
116
119 bool StrictlyPositive = true,
120 bool SuppressExprDiags = false);
121
122 /// Given the potential call expression \p Call, determine if there is a
123 /// specialization via the OpenMP declare variant mechanism available. If
124 /// there is, return the specialized call expression, otherwise return the
125 /// original \p Call.
127 SourceLocation LParenLoc, MultiExprArg ArgExprs,
128 SourceLocation RParenLoc, Expr *ExecConfig);
129
130 /// Handle a `omp begin declare variant`.
132
133 /// Handle a `omp end declare variant`.
135
136 /// Function tries to capture lambda's captured variables in the OpenMP region
137 /// before the original lambda is captured.
139
140 /// Return true if the provided declaration \a VD should be captured by
141 /// reference.
142 /// \param Level Relative level of nested OpenMP construct for that the check
143 /// is performed.
144 /// \param OpenMPCaptureLevel Capture level within an OpenMP construct.
145 bool isOpenMPCapturedByRef(const ValueDecl *D, unsigned Level,
146 unsigned OpenMPCaptureLevel) const;
147
148 /// Check if the specified variable is used in one of the private
149 /// clauses (private, firstprivate, lastprivate, reduction etc.) in OpenMP
150 /// constructs.
151 VarDecl *isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo = false,
152 unsigned StopAt = 0);
153
154 /// The member expression(this->fd) needs to be rebuilt in the template
155 /// instantiation to generate private copy for OpenMP when default
156 /// clause is used. The function will return true if default
157 /// cluse is used.
159
162
163 /// If the current region is a loop-based region, mark the start of the loop
164 /// construct.
165 void startOpenMPLoop();
166
167 /// If the current region is a range loop-based region, mark the start of the
168 /// loop construct.
170
171 /// Check if the specified variable is used in 'private' clause.
172 /// \param Level Relative level of nested OpenMP construct for that the check
173 /// is performed.
175 unsigned CapLevel) const;
176
177 /// Sets OpenMP capture kind (OMPC_private, OMPC_firstprivate, OMPC_map etc.)
178 /// for \p FD based on DSA for the provided corresponding captured declaration
179 /// \p D.
180 void setOpenMPCaptureKind(FieldDecl *FD, const ValueDecl *D, unsigned Level);
181
182 /// Check if the specified variable is captured by 'target' directive.
183 /// \param Level Relative level of nested OpenMP construct for that the check
184 /// is performed.
185 bool isOpenMPTargetCapturedDecl(const ValueDecl *D, unsigned Level,
186 unsigned CaptureLevel) const;
187
188 /// Check if the specified global variable must be captured by outer capture
189 /// regions.
190 /// \param Level Relative level of nested OpenMP construct for that
191 /// the check is performed.
192 bool isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level,
193 unsigned CaptureLevel) const;
194
196 Expr *Op);
197 /// Called on start of new data sharing attribute block.
199 const DeclarationNameInfo &DirName, Scope *CurScope,
200 SourceLocation Loc);
201 /// Start analysis of clauses.
203 /// End analysis of clauses.
204 void EndOpenMPClause();
205 /// Called on end of data sharing attribute block.
206 void EndOpenMPDSABlock(Stmt *CurDirective);
207
208 /// Check if the current region is an OpenMP loop region and if it is,
209 /// mark loop control variable, used in \p Init for loop initialization, as
210 /// private by default.
211 /// \param Init First part of the for loop.
213
214 /// Called on well-formed '\#pragma omp metadirective' after parsing
215 /// of the associated statement.
217 Stmt *AStmt, SourceLocation StartLoc,
218 SourceLocation EndLoc);
219
220 // OpenMP directives and clauses.
221 /// Called on correct id-expression from the '#pragma omp
222 /// threadprivate'.
224 const DeclarationNameInfo &Id,
226 /// Called on well-formed '#pragma omp threadprivate'.
228 ArrayRef<Expr *> VarList);
229 /// Builds a new OpenMPThreadPrivateDecl and checks its correctness.
231 ArrayRef<Expr *> VarList);
232 /// Called on well-formed '#pragma omp groupprivate'.
234 ArrayRef<Expr *> VarList);
235 /// Builds a new OpenMPGroupPrivateDecl and checks its correctness.
237 ArrayRef<Expr *> VarList);
238 /// Called on well-formed '#pragma omp allocate'.
240 ArrayRef<Expr *> VarList,
241 ArrayRef<OMPClause *> Clauses,
242 DeclContext *Owner = nullptr);
243
244 /// Called on well-formed '#pragma omp [begin] assume[s]'.
247 ArrayRef<std::string> Assumptions,
248 bool SkippedClauses);
249
250 /// Check if there is an active global `omp begin assumes` directive.
251 bool isInOpenMPAssumeScope() const { return !OMPAssumeScoped.empty(); }
252
253 /// Check if there is an active global `omp assumes` directive.
254 bool hasGlobalOpenMPAssumes() const { return !OMPAssumeGlobal.empty(); }
255
256 /// Called on well-formed '#pragma omp end assumes'.
258
259 /// Called on well-formed '#pragma omp requires'.
261 ArrayRef<OMPClause *> ClauseList);
262 /// Check restrictions on Requires directive
264 ArrayRef<OMPClause *> Clauses);
265 /// Check if the specified type is allowed to be used in 'omp declare
266 /// reduction' construct.
269 /// Called on start of '#pragma omp declare reduction'.
271 Scope *S, DeclContext *DC, DeclarationName Name,
272 ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
273 AccessSpecifier AS, Decl *PrevDeclInScope = nullptr);
274 /// Initialize declare reduction construct initializer.
276 /// Finish current declare reduction construct initializer.
278 /// Initialize declare reduction construct initializer.
279 /// \return omp_priv variable.
281 /// Finish current declare reduction construct initializer.
283 VarDecl *OmpPrivParm);
284 /// Called at the end of '#pragma omp declare reduction'.
286 Scope *S, DeclGroupPtrTy DeclReductions, bool IsValid);
287
288 /// Check variable declaration in 'omp declare mapper' construct.
290 /// Check if the specified type is allowed to be used in 'omp declare
291 /// mapper' construct.
294 /// Called for '#pragma omp declare mapper'.
296 Scope *S, DeclContext *DC, DeclarationName Name, QualType MapperType,
298 Expr *MapperVarRef, ArrayRef<OMPClause *> Clauses,
299 Decl *PrevDeclInScope = nullptr);
300 /// Build the mapper variable of '#pragma omp declare mapper'.
302 QualType MapperType,
303 SourceLocation StartLoc,
304 DeclarationName VN);
306 bool isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const;
308
310 struct MapInfo {
311 OMPDeclareTargetDeclAttr::MapTypeTy MT;
313 };
314 /// Explicitly listed variables and functions in a 'to' or 'link' clause.
315 llvm::DenseMap<NamedDecl *, MapInfo> ExplicitlyMapped;
316
317 /// The 'device_type' as parsed from the clause.
318 OMPDeclareTargetDeclAttr::DevTypeTy DT = OMPDeclareTargetDeclAttr::DT_Any;
319
320 /// The directive kind, `begin declare target` or `declare target`.
322
323 /// The directive with indirect clause.
324 std::optional<Expr *> Indirect;
325
326 /// The directive location.
328
331 };
332
333 /// Called on the start of target region i.e. '#pragma omp declare target'.
334 bool ActOnStartOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
335
336 /// Called at the end of target region i.e. '#pragma omp end declare target'.
337 const DeclareTargetContextInfo ActOnOpenMPEndDeclareTargetDirective();
338
339 /// Called once a target context is completed, that can be when a
340 /// '#pragma omp end declare target' was encountered or when a
341 /// '#pragma omp declare target' without declaration-definition-seq was
342 /// encountered.
343 void ActOnFinishedOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
344
345 /// Report unterminated 'omp declare target' or 'omp begin declare target' at
346 /// the end of a compilation unit.
348
349 /// Searches for the provided declaration name for OpenMP declare target
350 /// directive.
352 CXXScopeSpec &ScopeSpec,
353 const DeclarationNameInfo &Id);
354
355 /// Called on correct id-expression from the '#pragma omp declare target'.
357 OMPDeclareTargetDeclAttr::MapTypeTy MT,
358 DeclareTargetContextInfo &DTCI);
359
360 /// Check declaration inside target region.
361 void
364
365 /// Adds OMPDeclareTargetDeclAttr to referenced variables in declare target
366 /// directive.
368
369 /// Finishes analysis of the deferred functions calls that may be declared as
370 /// host/nohost during device/host compilation.
372 const FunctionDecl *Callee,
373 SourceLocation Loc);
374
375 /// Return true if currently in OpenMP task with untied clause context.
376 bool isInOpenMPTaskUntiedContext() const;
377
378 /// Return true inside OpenMP declare target region.
380 return !DeclareTargetNesting.empty();
381 }
382 /// Return true inside OpenMP target region.
384
385 /// Return the number of captured regions created for an OpenMP directive.
387
388 /// Initialization of captured region for OpenMP region.
389 void ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope);
390
391 /// Called for syntactical loops (ForStmt or CXXForRangeStmt) associated to
392 /// an OpenMP loop directive.
394
395 /// Process a canonical OpenMP loop nest that can either be a canonical
396 /// literal loop (ForStmt or CXXForRangeStmt), or the generated loop of an
397 /// OpenMP loop transformation construct.
399
400 /// End of OpenMP region.
401 ///
402 /// \param S Statement associated with the current OpenMP region.
403 /// \param Clauses List of clauses for the current OpenMP region.
404 ///
405 /// \returns Statement for finished OpenMP region.
408 OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
409 OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
410 Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc);
411 /// Process an OpenMP informational directive.
412 ///
413 /// \param Kind The directive kind.
414 /// \param DirName Declaration name info.
415 /// \param Clauses Array of clauses for directive.
416 /// \param AStmt The associated statement.
417 /// \param StartLoc The start location.
418 /// \param EndLoc The end location.
420 OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
421 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
422 SourceLocation EndLoc);
423 /// Process an OpenMP assume directive.
424 ///
425 /// \param Clauses Array of clauses for directive.
426 /// \param AStmt The associated statement.
427 /// \param StartLoc The start location.
428 /// \param EndLoc The end location.
430 Stmt *AStmt, SourceLocation StartLoc,
431 SourceLocation EndLoc);
432
433 /// Called on well-formed '\#pragma omp parallel' after parsing
434 /// of the associated statement.
436 Stmt *AStmt, SourceLocation StartLoc,
437 SourceLocation EndLoc);
439 llvm::SmallDenseMap<const ValueDecl *, const Expr *, 4>;
440 /// Called on well-formed '\#pragma omp simd' after parsing
441 /// of the associated statement.
444 SourceLocation StartLoc, SourceLocation EndLoc,
445 VarsWithInheritedDSAType &VarsWithImplicitDSA);
446 /// Called on well-formed '#pragma omp tile' after parsing of its clauses and
447 /// the associated statement.
449 Stmt *AStmt, SourceLocation StartLoc,
450 SourceLocation EndLoc);
452 Stmt *AStmt, SourceLocation StartLoc,
453 SourceLocation EndLoc);
454 /// Called on well-formed '#pragma omp unroll' after parsing of its clauses
455 /// and the associated statement.
457 Stmt *AStmt, SourceLocation StartLoc,
458 SourceLocation EndLoc);
459 /// Called on well-formed '#pragma omp reverse'.
461 SourceLocation EndLoc);
462 /// Called on well-formed '#pragma omp split' after parsing of its
463 /// associated statement.
465 Stmt *AStmt, SourceLocation StartLoc,
466 SourceLocation EndLoc);
467 /// Called on well-formed '#pragma omp interchange' after parsing of its
468 /// clauses and the associated statement.
470 Stmt *AStmt,
471 SourceLocation StartLoc,
472 SourceLocation EndLoc);
473
474 /// Called on well-formed '#pragma omp flatten' after parsing of its
475 /// clauses and the associated statement.
477 Stmt *AStmt, SourceLocation StartLoc,
478 SourceLocation EndLoc);
479
480 /// Called on well-formed '#pragma omp fuse' after parsing of its
481 /// clauses and the associated statement.
483 Stmt *AStmt, SourceLocation StartLoc,
484 SourceLocation EndLoc);
485
486 /// Called on well-formed '\#pragma omp for' after parsing
487 /// of the associated statement.
490 SourceLocation StartLoc, SourceLocation EndLoc,
491 VarsWithInheritedDSAType &VarsWithImplicitDSA);
492 /// Called on well-formed '\#pragma omp for simd' after parsing
493 /// of the associated statement.
496 SourceLocation StartLoc, SourceLocation EndLoc,
497 VarsWithInheritedDSAType &VarsWithImplicitDSA);
498 /// Called on well-formed '\#pragma omp sections' after parsing
499 /// of the associated statement.
501 Stmt *AStmt, SourceLocation StartLoc,
502 SourceLocation EndLoc);
503 /// Called on well-formed '\#pragma omp section' after parsing of the
504 /// associated statement.
506 SourceLocation EndLoc);
507 /// Called on well-formed '\#pragma omp scope' after parsing of the
508 /// associated statement.
510 Stmt *AStmt, SourceLocation StartLoc,
511 SourceLocation EndLoc);
512 /// Called on well-formed '\#pragma omp single' after parsing of the
513 /// associated statement.
515 Stmt *AStmt, SourceLocation StartLoc,
516 SourceLocation EndLoc);
517 /// Called on well-formed '\#pragma omp master' after parsing of the
518 /// associated statement.
520 SourceLocation EndLoc);
521 /// Called on well-formed '\#pragma omp critical' after parsing of the
522 /// associated statement.
524 ArrayRef<OMPClause *> Clauses,
525 Stmt *AStmt, SourceLocation StartLoc,
526 SourceLocation EndLoc);
527 /// Called on well-formed '\#pragma omp parallel for' after parsing
528 /// of the associated statement.
530 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
531 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
532 /// Called on well-formed '\#pragma omp parallel for simd' after
533 /// parsing of the associated statement.
535 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
536 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
537 /// Called on well-formed '\#pragma omp parallel master' after
538 /// parsing of the associated statement.
540 Stmt *AStmt,
541 SourceLocation StartLoc,
542 SourceLocation EndLoc);
543 /// Called on well-formed '\#pragma omp parallel masked' after
544 /// parsing of the associated statement.
546 Stmt *AStmt,
547 SourceLocation StartLoc,
548 SourceLocation EndLoc);
549 /// Called on well-formed '\#pragma omp parallel sections' after
550 /// parsing of the associated statement.
552 Stmt *AStmt,
553 SourceLocation StartLoc,
554 SourceLocation EndLoc);
555 /// Called on well-formed '\#pragma omp task' after parsing of the
556 /// associated statement.
558 Stmt *AStmt, SourceLocation StartLoc,
559 SourceLocation EndLoc);
560 /// Called on well-formed '\#pragma omp taskyield'.
562 SourceLocation EndLoc);
563 /// Called on well-formed '\#pragma omp error'.
564 /// Error direcitive is allowed in both declared and excutable contexts.
565 /// Adding InExContext to identify which context is called from.
567 SourceLocation StartLoc,
568 SourceLocation EndLoc,
569 bool InExContext = true);
570 /// Called on well-formed '\#pragma omp barrier'.
572 SourceLocation EndLoc);
573 /// Called on well-formed '\#pragma omp taskwait'.
575 SourceLocation StartLoc,
576 SourceLocation EndLoc);
577 /// Called on well-formed '\#pragma omp taskgroup'.
579 Stmt *AStmt, SourceLocation StartLoc,
580 SourceLocation EndLoc);
581 /// Called on well-formed '\#pragma omp flush'.
583 SourceLocation StartLoc,
584 SourceLocation EndLoc);
585 /// Called on well-formed '\#pragma omp depobj'.
587 SourceLocation StartLoc,
588 SourceLocation EndLoc);
589 /// Called on well-formed '\#pragma omp scan'.
591 SourceLocation StartLoc,
592 SourceLocation EndLoc);
593 /// Called on well-formed '\#pragma omp ordered' after parsing of the
594 /// associated statement.
596 Stmt *AStmt, SourceLocation StartLoc,
597 SourceLocation EndLoc);
598 /// Called on well-formed '\#pragma omp atomic' after parsing of the
599 /// associated statement.
601 Stmt *AStmt, SourceLocation StartLoc,
602 SourceLocation EndLoc);
603 /// Called on well-formed '\#pragma omp target' after parsing of the
604 /// associated statement.
606 Stmt *AStmt, SourceLocation StartLoc,
607 SourceLocation EndLoc);
608 /// Called on well-formed '\#pragma omp target data' after parsing of
609 /// the associated statement.
611 Stmt *AStmt,
612 SourceLocation StartLoc,
613 SourceLocation EndLoc);
614 /// Called on well-formed '\#pragma omp target enter data' after
615 /// parsing of the associated statement.
617 SourceLocation StartLoc,
618 SourceLocation EndLoc,
619 Stmt *AStmt);
620 /// Called on well-formed '\#pragma omp target exit data' after
621 /// parsing of the associated statement.
623 SourceLocation StartLoc,
624 SourceLocation EndLoc,
625 Stmt *AStmt);
626 /// Called on well-formed '\#pragma omp target parallel' after
627 /// parsing of the associated statement.
629 Stmt *AStmt,
630 SourceLocation StartLoc,
631 SourceLocation EndLoc);
632 /// Called on well-formed '\#pragma omp target parallel for' after
633 /// parsing of the associated statement.
635 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
636 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
637 /// Called on well-formed '\#pragma omp teams' after parsing of the
638 /// associated statement.
640 Stmt *AStmt, SourceLocation StartLoc,
641 SourceLocation EndLoc);
642 /// Called on well-formed '\#pragma omp teams loop' after parsing of the
643 /// associated statement.
645 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
646 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
647 /// Called on well-formed '\#pragma omp target teams loop' after parsing of
648 /// the associated statement.
650 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
651 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
652 /// Called on well-formed '\#pragma omp parallel loop' after parsing of the
653 /// associated statement.
655 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
656 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
657 /// Called on well-formed '\#pragma omp target parallel loop' after parsing
658 /// of the associated statement.
660 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
661 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
662 /// Called on well-formed '\#pragma omp cancellation point'.
665 SourceLocation EndLoc,
666 OpenMPDirectiveKind CancelRegion);
667 /// Called on well-formed '\#pragma omp cancel'.
669 SourceLocation StartLoc,
670 SourceLocation EndLoc,
671 OpenMPDirectiveKind CancelRegion);
672 /// Called on well-formed '\#pragma omp taskloop' after parsing of the
673 /// associated statement.
676 SourceLocation StartLoc, SourceLocation EndLoc,
677 VarsWithInheritedDSAType &VarsWithImplicitDSA);
678 /// Called on well-formed '\#pragma omp taskloop simd' after parsing of
679 /// the associated statement.
681 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
682 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
683 /// Called on well-formed '\#pragma omp master taskloop' after parsing of the
684 /// associated statement.
686 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
687 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
688 /// Called on well-formed '\#pragma omp master taskloop simd' after parsing of
689 /// the associated statement.
691 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
692 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
693 /// Called on well-formed '\#pragma omp parallel master taskloop' after
694 /// parsing of the associated statement.
696 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
697 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
698 /// Called on well-formed '\#pragma omp parallel master taskloop simd' after
699 /// parsing of the associated statement.
701 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
702 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
703 /// Called on well-formed '\#pragma omp masked taskloop' after parsing of the
704 /// associated statement.
706 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
707 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
708 /// Called on well-formed '\#pragma omp masked taskloop simd' after parsing of
709 /// the associated statement.
711 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
712 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
713 /// Called on well-formed '\#pragma omp parallel masked taskloop' after
714 /// parsing of the associated statement.
716 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
717 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
718 /// Called on well-formed '\#pragma omp parallel masked taskloop simd' after
719 /// parsing of the associated statement.
721 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
722 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
723 /// Called on well-formed '\#pragma omp distribute' after parsing
724 /// of the associated statement.
727 SourceLocation StartLoc, SourceLocation EndLoc,
728 VarsWithInheritedDSAType &VarsWithImplicitDSA);
729 /// Called on well-formed '\#pragma omp target update'.
731 SourceLocation StartLoc,
732 SourceLocation EndLoc,
733 Stmt *AStmt);
734 /// Called on well-formed '\#pragma omp distribute parallel for' after
735 /// parsing of the associated statement.
737 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
738 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
739 /// Called on well-formed '\#pragma omp distribute parallel for simd'
740 /// after parsing of the associated statement.
742 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
743 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
744 /// Called on well-formed '\#pragma omp distribute simd' after
745 /// parsing of the associated statement.
747 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
748 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
749 /// Called on well-formed '\#pragma omp target parallel for simd' after
750 /// parsing of the associated statement.
752 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
753 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
754 /// Called on well-formed '\#pragma omp target simd' after parsing of
755 /// the associated statement.
758 SourceLocation StartLoc, SourceLocation EndLoc,
759 VarsWithInheritedDSAType &VarsWithImplicitDSA);
760 /// Called on well-formed '\#pragma omp teams distribute' after parsing of
761 /// the associated statement.
763 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
764 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
765 /// Called on well-formed '\#pragma omp teams distribute simd' after parsing
766 /// of the associated statement.
768 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
769 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
770 /// Called on well-formed '\#pragma omp teams distribute parallel for simd'
771 /// after parsing of the associated statement.
773 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
774 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
775 /// Called on well-formed '\#pragma omp teams distribute parallel for'
776 /// after parsing of the associated statement.
778 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
779 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
780 /// Called on well-formed '\#pragma omp target teams' after parsing of the
781 /// associated statement.
783 Stmt *AStmt,
784 SourceLocation StartLoc,
785 SourceLocation EndLoc);
786 /// Called on well-formed '\#pragma omp target teams distribute' after parsing
787 /// of the associated statement.
789 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
790 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
791 /// Called on well-formed '\#pragma omp target teams distribute parallel for'
792 /// after parsing of the associated statement.
794 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
795 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
796 /// Called on well-formed '\#pragma omp target teams distribute parallel for
797 /// simd' after parsing of the associated statement.
799 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
800 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
801 /// Called on well-formed '\#pragma omp target teams distribute simd' after
802 /// parsing of the associated statement.
804 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
805 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
806 /// Called on well-formed '\#pragma omp interop'.
808 SourceLocation StartLoc,
809 SourceLocation EndLoc);
810 /// Called on well-formed '\#pragma omp dispatch' after parsing of the
811 // /associated statement.
813 Stmt *AStmt, SourceLocation StartLoc,
814 SourceLocation EndLoc);
815 /// Called on well-formed '\#pragma omp masked' after parsing of the
816 // /associated statement.
818 Stmt *AStmt, SourceLocation StartLoc,
819 SourceLocation EndLoc);
820
821 /// Called on well-formed '\#pragma omp loop' after parsing of the
822 /// associated statement.
824 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
825 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
826
827 /// Checks correctness of linear modifiers.
829 SourceLocation LinLoc);
830 /// Checks that the specified declaration matches requirements for the linear
831 /// decls.
834 bool IsDeclareSimd = false);
835
836 /// Called on well-formed '\#pragma omp declare simd' after parsing of
837 /// the associated method/function.
839 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
840 Expr *Simdlen, ArrayRef<Expr *> Uniforms, ArrayRef<Expr *> Aligneds,
841 ArrayRef<Expr *> Alignments, ArrayRef<Expr *> Linears,
842 ArrayRef<unsigned> LinModifiers, ArrayRef<Expr *> Steps, SourceRange SR);
843
844 /// Checks '\#pragma omp declare variant' variant function and original
845 /// functions after parsing of the associated method/function.
846 /// \param DG Function declaration to which declare variant directive is
847 /// applied to.
848 /// \param VariantRef Expression that references the variant function, which
849 /// must be used instead of the original one, specified in \p DG.
850 /// \param TI The trait info object representing the match clause.
851 /// \param NumAppendArgs The number of omp_interop_t arguments to account for
852 /// in checking.
853 /// \returns std::nullopt, if the function/variant function are not compatible
854 /// with the pragma, pair of original function/variant ref expression
855 /// otherwise.
856 std::optional<std::pair<FunctionDecl *, Expr *>>
858 OMPTraitInfo &TI, unsigned NumAppendArgs,
859 SourceRange SR);
860
861 /// Called on well-formed '\#pragma omp declare variant' after parsing of
862 /// the associated method/function.
863 /// \param FD Function declaration to which declare variant directive is
864 /// applied to.
865 /// \param VariantRef Expression that references the variant function, which
866 /// must be used instead of the original one, specified in \p DG.
867 /// \param TI The context traits associated with the function variant.
868 /// \param AdjustArgsNothing The list of 'nothing' arguments.
869 /// \param AdjustArgsNeedDevicePtr The list of 'need_device_ptr' arguments.
870 /// \param AppendArgs The list of 'append_args' arguments.
871 /// \param AdjustArgsLoc The Location of an 'adjust_args' clause.
872 /// \param AppendArgsLoc The Location of an 'append_args' clause.
873 /// \param SR The SourceRange of the 'declare variant' directive.
875 FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI,
876 ArrayRef<Expr *> AdjustArgsNothing,
877 ArrayRef<Expr *> AdjustArgsNeedDevicePtr,
878 ArrayRef<Expr *> AdjustArgsNeedDeviceAddr,
879 ArrayRef<OMPInteropInfo> AppendArgs, SourceLocation AdjustArgsLoc,
880 SourceLocation AppendArgsLoc, SourceRange SR);
881
882 /// Called on device_num selector in context selectors.
883 void ActOnOpenMPDeviceNum(Expr *DeviceNumExpr);
884
886 SourceLocation StartLoc,
887 SourceLocation LParenLoc,
888 SourceLocation EndLoc);
889 /// Called on well-formed 'allocator' clause.
891 SourceLocation StartLoc,
892 SourceLocation LParenLoc,
893 SourceLocation EndLoc);
894 /// Called on well-formed 'if' clause.
896 Expr *Condition, SourceLocation StartLoc,
897 SourceLocation LParenLoc,
898 SourceLocation NameModifierLoc,
899 SourceLocation ColonLoc,
900 SourceLocation EndLoc);
901 /// Called on well-formed 'final' clause.
903 SourceLocation LParenLoc,
904 SourceLocation EndLoc);
905 /// Called on well-formed 'num_threads' clause.
907 ArrayRef<Expr *> VarList, OpenMPNumThreadsClauseModifier SimpleModifier,
908 SourceLocation SimpleModifierLoc,
909 OpenMPNumThreadsClauseModifier ComplexModifier, Expr *ComplexModifierExpr,
910 SourceLocation ComplexModifierLoc, SourceLocation StartLoc,
911 SourceLocation LParenLoc, SourceLocation EndLoc);
912 /// Called on well-formed 'align' clause.
914 SourceLocation LParenLoc,
915 SourceLocation EndLoc);
916 /// Called on well-formed 'safelen' clause.
918 SourceLocation LParenLoc,
919 SourceLocation EndLoc);
920 /// Called on well-formed 'simdlen' clause.
922 SourceLocation LParenLoc,
923 SourceLocation EndLoc);
924 /// Called on well-form 'sizes' clause.
926 SourceLocation StartLoc,
927 SourceLocation LParenLoc,
928 SourceLocation EndLoc);
929 /// Called on well-formed 'counts' clause after parsing its arguments.
930 OMPClause *
932 SourceLocation LParenLoc, SourceLocation EndLoc,
933 std::optional<unsigned> FillIdx,
934 SourceLocation FillLoc, unsigned FillCount);
935 /// Called on well-form 'permutation' clause after parsing its arguments.
937 SourceLocation StartLoc,
938 SourceLocation LParenLoc,
939 SourceLocation EndLoc);
940 /// Called on well-form 'full' clauses.
942 SourceLocation EndLoc);
943 /// Called on well-form 'partial' clauses.
945 SourceLocation LParenLoc,
946 SourceLocation EndLoc);
947 /// Called on well-formed 'depth' clause.
949 SourceLocation LParenLoc,
950 SourceLocation EndLoc);
951 /// Called on well-formed 'collapse' clause.
953 SourceLocation StartLoc,
954 SourceLocation LParenLoc,
955 SourceLocation EndLoc);
956
957 /// Called on well-form 'looprange' clause after parsing its arguments.
958 OMPClause *
960 SourceLocation LParenLoc, SourceLocation FirstLoc,
961 SourceLocation CountLoc, SourceLocation EndLoc);
962 /// Called on well-formed 'ordered' clause.
963 OMPClause *
965 SourceLocation LParenLoc = SourceLocation(),
966 Expr *NumForLoops = nullptr);
967 /// Called on well-formed 'grainsize' clause.
969 Expr *Size, SourceLocation StartLoc,
970 SourceLocation LParenLoc,
971 SourceLocation ModifierLoc,
972 SourceLocation EndLoc);
973 /// Called on well-formed 'num_tasks' clause.
975 Expr *NumTasks, SourceLocation StartLoc,
976 SourceLocation LParenLoc,
977 SourceLocation ModifierLoc,
978 SourceLocation EndLoc);
979 /// Called on well-formed 'hint' clause.
981 SourceLocation LParenLoc,
982 SourceLocation EndLoc);
983 /// Called on well-formed 'detach' clause.
985 SourceLocation LParenLoc,
986 SourceLocation EndLoc);
987
988 OMPClause *ActOnOpenMPSimpleClause(OpenMPClauseKind Kind, unsigned Argument,
989 SourceLocation ArgumentLoc,
990 SourceLocation StartLoc,
991 SourceLocation LParenLoc,
992 SourceLocation EndLoc);
993 /// Called on well-formed 'when' clause.
995 SourceLocation LParenLoc,
996 SourceLocation EndLoc);
997 /// Called on well-formed 'default' clause.
998 OMPClause *
999 ActOnOpenMPDefaultClause(llvm::omp::DefaultKind M, SourceLocation MLoc,
1001 SourceLocation VCKindLoc, SourceLocation StartLoc,
1002 SourceLocation LParenLoc, SourceLocation EndLoc);
1003 /// Called on well-formed 'threadset' clause.
1005 SourceLocation KindLoc,
1006 SourceLocation StartLoc,
1007 SourceLocation LParenLoc,
1008 SourceLocation EndLoc);
1009 /// Called on well-formed 'transparent' clause.
1011 SourceLocation StartLoc,
1012 SourceLocation LParenLoc,
1013 SourceLocation EndLoc);
1014 /// Called on well-formed 'proc_bind' clause.
1015 OMPClause *ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind,
1016 SourceLocation KindLoc,
1017 SourceLocation StartLoc,
1018 SourceLocation LParenLoc,
1019 SourceLocation EndLoc);
1020 /// Called on well-formed 'order' clause.
1023 SourceLocation StartLoc,
1024 SourceLocation LParenLoc,
1025 SourceLocation MLoc, SourceLocation KindLoc,
1026 SourceLocation EndLoc);
1027 /// Called on well-formed 'update_depend_objects' clause.
1029 SourceLocation KindLoc,
1030 SourceLocation StartLoc,
1031 SourceLocation LParenLoc,
1032 SourceLocation EndLoc);
1033 /// Called on well-formed 'holds' clause.
1035 SourceLocation LParenLoc,
1036 SourceLocation EndLoc);
1037 /// Called on well-formed 'absent' or 'contains' clauses.
1042 SourceLocation Loc,
1043 SourceLocation RLoc);
1044
1046 OpenMPClauseKind Kind, ArrayRef<unsigned> Arguments, Expr *Expr,
1047 SourceLocation StartLoc, SourceLocation LParenLoc,
1048 ArrayRef<SourceLocation> ArgumentsLoc, SourceLocation DelimLoc,
1049 SourceLocation EndLoc);
1050 /// Called on well-formed 'schedule' clause.
1053 OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc,
1054 SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc,
1055 SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc);
1056
1058 SourceLocation EndLoc);
1059 /// Called on well-formed 'nowait' clause.
1061 SourceLocation EndLoc,
1062 SourceLocation LParenLoc, Expr *Condition);
1063 /// Called on well-formed 'untied' clause.
1065 SourceLocation EndLoc);
1066 /// Called on well-formed 'mergeable' clause.
1068 SourceLocation EndLoc);
1069 /// Called on well-formed 'read' clause.
1071 SourceLocation EndLoc);
1072 /// Called on well-formed 'write' clause.
1074 SourceLocation EndLoc);
1075 /// Called on well-formed 'update' clause.
1077 SourceLocation EndLoc);
1078 /// Called on well-formed 'capture' clause.
1080 SourceLocation EndLoc);
1081 /// Called on well-formed 'compare' clause.
1083 SourceLocation EndLoc);
1084 /// Called on well-formed 'fail' clause.
1086 SourceLocation EndLoc);
1088 SourceLocation KindLoc,
1089 SourceLocation StartLoc,
1090 SourceLocation LParenLoc,
1091 SourceLocation EndLoc);
1092
1093 /// Called on well-formed 'seq_cst' clause.
1095 SourceLocation EndLoc);
1096 /// Called on well-formed 'acq_rel' clause.
1098 SourceLocation EndLoc);
1099 /// Called on well-formed 'acquire' clause.
1101 SourceLocation EndLoc);
1102 /// Called on well-formed 'release' clause.
1104 SourceLocation EndLoc);
1105 /// Called on well-formed 'relaxed' clause.
1107 SourceLocation EndLoc);
1108 /// Called on well-formed 'weak' clause.
1110 SourceLocation EndLoc);
1111
1112 /// Called on well-formed 'init' clause.
1113 OMPClause *
1114 ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo,
1115 SourceLocation StartLoc, SourceLocation LParenLoc,
1116 SourceLocation VarLoc, SourceLocation EndLoc);
1117
1118 /// Called on well-formed 'use' clause.
1119 OMPClause *ActOnOpenMPUseClause(Expr *InteropVar, SourceLocation StartLoc,
1120 SourceLocation LParenLoc,
1121 SourceLocation VarLoc, SourceLocation EndLoc);
1122
1123 /// Called on well-formed 'destroy' clause.
1125 SourceLocation LParenLoc,
1126 SourceLocation VarLoc,
1127 SourceLocation EndLoc);
1128 /// Called on well-formed 'novariants' clause.
1130 SourceLocation StartLoc,
1131 SourceLocation LParenLoc,
1132 SourceLocation EndLoc);
1133 /// Called on well-formed 'nocontext' clause.
1135 SourceLocation StartLoc,
1136 SourceLocation LParenLoc,
1137 SourceLocation EndLoc);
1138 /// Called on well-formed 'filter' clause.
1140 SourceLocation LParenLoc,
1141 SourceLocation EndLoc);
1142 /// Called on well-formed 'threads' clause.
1144 SourceLocation EndLoc);
1145 /// Called on well-formed 'simd' clause.
1147 SourceLocation EndLoc);
1148 /// Called on well-formed 'nogroup' clause.
1150 SourceLocation EndLoc);
1151 /// Called on well-formed 'unified_address' clause.
1153 SourceLocation EndLoc);
1154
1155 /// Called on well-formed 'unified_address' clause.
1157 SourceLocation EndLoc);
1158
1159 /// Called on well-formed 'reverse_offload' clause.
1161 SourceLocation EndLoc);
1162
1163 /// Called on well-formed 'dynamic_allocators' clause.
1165 SourceLocation EndLoc);
1166
1167 /// Called on well-formed 'atomic_default_mem_order' clause.
1170 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1171
1172 /// Called on well-formed 'self_maps' clause.
1174 SourceLocation EndLoc);
1175
1176 /// Called on well-formed 'at' clause.
1178 SourceLocation KindLoc,
1179 SourceLocation StartLoc,
1180 SourceLocation LParenLoc,
1181 SourceLocation EndLoc);
1182
1183 /// Called on well-formed 'severity' clause.
1185 SourceLocation KindLoc,
1186 SourceLocation StartLoc,
1187 SourceLocation LParenLoc,
1188 SourceLocation EndLoc);
1189
1190 /// Called on well-formed 'message' clause.
1191 /// passing string for message.
1193 SourceLocation LParenLoc,
1194 SourceLocation EndLoc);
1195
1196 /// Data used for processing a list of variables in OpenMP clauses.
1197 struct OpenMPVarListDataTy final {
1199 Expr *IteratorExpr = nullptr;
1204 std::array<int, 2> ExtraModifierArray = {-1, -1};
1205 std::array<Expr *, 2> ExtraModifierExprArray = {nullptr, nullptr};
1206 std::array<SourceLocation, 2> ExtraModifierLocArray = {SourceLocation(),
1207 SourceLocation()};
1208 /// Additional modifier for linear, map, depend, lastprivate,
1209 /// use_device_ptr, or num_teams clause.
1213 int OriginalSharingModifier = 0; // Default is shared
1223 bool IsMapTypeImplicit = false;
1227 StepModifierLoc; /// 'step' modifier location for linear clause
1240 };
1241
1243 ArrayRef<Expr *> Vars,
1244 const OMPVarListLocTy &Locs,
1245 OpenMPVarListDataTy &Data);
1246 /// Called on well-formed 'inclusive' clause.
1248 SourceLocation StartLoc,
1249 SourceLocation LParenLoc,
1250 SourceLocation EndLoc);
1251 /// Called on well-formed 'exclusive' clause.
1253 SourceLocation StartLoc,
1254 SourceLocation LParenLoc,
1255 SourceLocation EndLoc);
1256 /// Called on well-formed 'allocate' clause.
1257 OMPClause *
1258 ActOnOpenMPAllocateClause(Expr *Allocator, Expr *Alignment,
1259 OpenMPAllocateClauseModifier FirstModifier,
1260 SourceLocation FirstModifierLoc,
1261 OpenMPAllocateClauseModifier SecondModifier,
1262 SourceLocation SecondModifierLoc,
1263 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1264 SourceLocation ColonLoc, SourceLocation LParenLoc,
1265 SourceLocation EndLoc);
1266 /// Called on well-formed 'private' clause.
1268 SourceLocation StartLoc,
1269 SourceLocation LParenLoc,
1270 SourceLocation EndLoc);
1271 /// Called on well-formed 'firstprivate' clause.
1273 SourceLocation StartLoc,
1274 SourceLocation LParenLoc,
1275 SourceLocation EndLoc);
1276 /// Called on well-formed 'lastprivate' clause.
1279 SourceLocation LPKindLoc, SourceLocation ColonLoc,
1280 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1281 /// Called on well-formed 'shared' clause.
1283 SourceLocation StartLoc,
1284 SourceLocation LParenLoc,
1285 SourceLocation EndLoc);
1286 /// Called on well-formed 'reduction' clause.
1288 ArrayRef<Expr *> VarList,
1289 OpenMPVarListDataTy::OpenMPReductionClauseModifiers Modifiers,
1290 SourceLocation StartLoc, SourceLocation LParenLoc,
1291 SourceLocation ModifierLoc, SourceLocation ColonLoc,
1292 SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec,
1293 const DeclarationNameInfo &ReductionId,
1294 ArrayRef<Expr *> UnresolvedReductions = {});
1295 /// Called on well-formed 'task_reduction' clause.
1297 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1298 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1299 CXXScopeSpec &ReductionIdScopeSpec,
1300 const DeclarationNameInfo &ReductionId,
1301 ArrayRef<Expr *> UnresolvedReductions = {});
1302 /// Called on well-formed 'in_reduction' clause.
1304 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1305 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1306 CXXScopeSpec &ReductionIdScopeSpec,
1307 const DeclarationNameInfo &ReductionId,
1308 ArrayRef<Expr *> UnresolvedReductions = {});
1309 /// Called on well-formed 'linear' clause.
1310 OMPClause *ActOnOpenMPLinearClause(
1311 ArrayRef<Expr *> VarList, Expr *Step, SourceLocation StartLoc,
1312 SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind,
1313 SourceLocation LinLoc, SourceLocation ColonLoc,
1314 SourceLocation StepModifierLoc, SourceLocation EndLoc);
1315 /// Called on well-formed 'aligned' clause.
1316 OMPClause *ActOnOpenMPAlignedClause(ArrayRef<Expr *> VarList, Expr *Alignment,
1317 SourceLocation StartLoc,
1318 SourceLocation LParenLoc,
1319 SourceLocation ColonLoc,
1320 SourceLocation EndLoc);
1321 /// Called on well-formed 'copyin' clause.
1322 OMPClause *ActOnOpenMPCopyinClause(ArrayRef<Expr *> VarList,
1323 SourceLocation StartLoc,
1324 SourceLocation LParenLoc,
1325 SourceLocation EndLoc);
1326 /// Called on well-formed 'copyprivate' clause.
1327 OMPClause *ActOnOpenMPCopyprivateClause(ArrayRef<Expr *> VarList,
1328 SourceLocation StartLoc,
1329 SourceLocation LParenLoc,
1330 SourceLocation EndLoc);
1331 /// Called on well-formed 'flush' pseudo clause.
1332 OMPClause *ActOnOpenMPFlushClause(ArrayRef<Expr *> VarList,
1333 SourceLocation StartLoc,
1334 SourceLocation LParenLoc,
1335 SourceLocation EndLoc);
1336 /// Called on well-formed 'depobj' pseudo clause.
1337 OMPClause *ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc,
1338 SourceLocation LParenLoc,
1339 SourceLocation EndLoc);
1340 /// Called on well-formed 'depend' clause.
1341 OMPClause *ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data,
1342 Expr *DepModifier,
1343 ArrayRef<Expr *> VarList,
1344 SourceLocation StartLoc,
1345 SourceLocation LParenLoc,
1346 SourceLocation EndLoc);
1347 /// Called on well-formed 'device' clause.
1349 Expr *Device, SourceLocation StartLoc,
1350 SourceLocation LParenLoc,
1351 SourceLocation ModifierLoc,
1352 SourceLocation EndLoc);
1353 /// Called on well-formed 'map' clause.
1354 OMPClause *ActOnOpenMPMapClause(
1355 Expr *IteratorModifier, ArrayRef<OpenMPMapModifierKind> MapTypeModifiers,
1356 ArrayRef<SourceLocation> MapTypeModifiersLoc,
1357 CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
1358 OpenMPMapClauseKind MapType, bool IsMapTypeImplicit,
1359 SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
1360 const OMPVarListLocTy &Locs, bool NoDiagnose = false,
1361 ArrayRef<Expr *> UnresolvedMappers = {});
1362 /// Called on well-formed 'num_teams' clause.
1363 OMPClause *ActOnOpenMPNumTeamsClause(
1364 ArrayRef<Expr *> VarList, OpenMPNumTeamsClauseModifier Modifier,
1365 Expr *ModifierExpr, SourceLocation ModifierLoc,
1366 OpenMPNumTeamsClauseModifier ModifierExtra, Expr *ModifierExtraExpr,
1367 SourceLocation ModifierExtraLoc, SourceLocation StartLoc,
1368 SourceLocation LParenLoc, SourceLocation EndLoc);
1369 /// Called on well-formed 'thread_limit' clause.
1371 ArrayRef<Expr *> VarList, OpenMPThreadLimitClauseModifier Modifier,
1372 Expr *ModifierExpr, SourceLocation ModifierLoc, SourceLocation StartLoc,
1373 SourceLocation LParenLoc, SourceLocation EndLoc);
1374 /// Called on well-formed 'priority' clause.
1375 OMPClause *ActOnOpenMPPriorityClause(Expr *Priority, SourceLocation StartLoc,
1376 SourceLocation LParenLoc,
1377 SourceLocation EndLoc);
1378 /// Called on well-formed 'dist_schedule' clause.
1380 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
1381 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc,
1382 SourceLocation CommaLoc, SourceLocation EndLoc);
1383 /// Called on well-formed 'defaultmap' clause.
1384 OMPClause *ActOnOpenMPDefaultmapClause(
1386 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc,
1387 SourceLocation KindLoc, SourceLocation EndLoc);
1388 /// Called on well-formed 'to' clause.
1389 OMPClause *
1390 ActOnOpenMPToClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1391 ArrayRef<SourceLocation> MotionModifiersLoc,
1392 Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec,
1393 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1394 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1395 ArrayRef<Expr *> UnresolvedMappers = {});
1396 /// Called on well-formed 'from' clause.
1397 OMPClause *
1398 ActOnOpenMPFromClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1399 ArrayRef<SourceLocation> MotionModifiersLoc,
1400 Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec,
1401 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1402 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1403 ArrayRef<Expr *> UnresolvedMappers = {});
1404 /// Called on well-formed 'use_device_ptr' clause.
1406 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1407 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
1408 SourceLocation FallbackModifierLoc);
1409 /// Called on well-formed 'use_device_addr' clause.
1410 OMPClause *ActOnOpenMPUseDeviceAddrClause(ArrayRef<Expr *> VarList,
1411 const OMPVarListLocTy &Locs);
1412 /// Called on well-formed 'is_device_ptr' clause.
1413 OMPClause *ActOnOpenMPIsDevicePtrClause(ArrayRef<Expr *> VarList,
1414 const OMPVarListLocTy &Locs);
1415 /// Called on well-formed 'has_device_addr' clause.
1416 OMPClause *ActOnOpenMPHasDeviceAddrClause(ArrayRef<Expr *> VarList,
1417 const OMPVarListLocTy &Locs);
1418 /// Called on well-formed 'nontemporal' clause.
1419 OMPClause *ActOnOpenMPNontemporalClause(ArrayRef<Expr *> VarList,
1420 SourceLocation StartLoc,
1421 SourceLocation LParenLoc,
1422 SourceLocation EndLoc);
1423
1424 /// Data for list of allocators.
1426 /// Allocator.
1427 Expr *Allocator = nullptr;
1428 /// Allocator traits.
1430 /// Locations of '(' and ')' symbols.
1432 };
1433 /// Called on well-formed 'uses_allocators' clause.
1435 SourceLocation LParenLoc,
1436 SourceLocation EndLoc,
1438 /// Called on well-formed 'affinity' clause.
1440 SourceLocation LParenLoc,
1441 SourceLocation ColonLoc,
1442 SourceLocation EndLoc, Expr *Modifier,
1443 ArrayRef<Expr *> Locators);
1444 /// Called on a well-formed 'bind' clause.
1446 SourceLocation KindLoc,
1447 SourceLocation StartLoc,
1448 SourceLocation LParenLoc,
1449 SourceLocation EndLoc);
1450
1451 /// Called on a well-formed 'ompx_dyn_cgroup_mem' clause.
1453 SourceLocation LParenLoc,
1454 SourceLocation EndLoc);
1455
1456 /// Called on a well-formed 'dyn_groupprivate' clause.
1460 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation M1Loc,
1461 SourceLocation M2Loc, SourceLocation EndLoc);
1462
1463 /// Called on well-formed 'doacross' clause.
1464 OMPClause *
1466 SourceLocation DepLoc, SourceLocation ColonLoc,
1467 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1468 SourceLocation LParenLoc, SourceLocation EndLoc);
1469
1470 /// Called on a well-formed 'ompx_attribute' clause.
1472 SourceLocation StartLoc,
1473 SourceLocation LParenLoc,
1474 SourceLocation EndLoc);
1475
1476 /// Called on a well-formed 'ompx_bare' clause.
1478 SourceLocation EndLoc);
1479
1481 Expr *LowerBound,
1482 SourceLocation ColonLocFirst,
1483 SourceLocation ColonLocSecond,
1484 Expr *Length, Expr *Stride,
1485 SourceLocation RBLoc);
1487 SourceLocation RParenLoc,
1488 ArrayRef<Expr *> Dims,
1489 ArrayRef<SourceRange> Brackets);
1490
1491 /// Data structure for iterator expression.
1501
1503 SourceLocation LLoc, SourceLocation RLoc,
1505
1507 Expr *ModifierExpr,
1508 SourceLocation ModifierLoc,
1509 ArrayRef<Expr *> VarList,
1510 SourceLocation VarListEndLoc);
1511
1512 void handleOMPAssumeAttr(Decl *D, const ParsedAttr &AL);
1513
1514 /// Setter and getter functions for device_num.
1515 void setOpenMPDeviceNum(int Num);
1516
1517 int getOpenMPDeviceNum() const;
1518
1519 void setOpenMPDeviceNumID(StringRef ID);
1520
1527
1528private:
1529 void *VarDataSharingAttributesStack;
1530
1531 /// Number of nested '#pragma omp declare target' directives.
1532 SmallVector<DeclareTargetContextInfo, 4> DeclareTargetNesting;
1533
1534 /// Initialization of data-sharing attributes stack.
1535 void InitDataSharingAttributesStack();
1536 void DestroyDataSharingAttributesStack();
1537
1538 /// Returns OpenMP nesting level for current directive.
1539 unsigned getOpenMPNestingLevel() const;
1540
1541 /// Adjusts the function scopes index for the target-based regions.
1542 void adjustOpenMPTargetScopeIndex(unsigned &FunctionScopesIndex,
1543 unsigned Level) const;
1544
1545 /// Returns the number of scopes associated with the construct on the given
1546 /// OpenMP level.
1547 int getNumberOfConstructScopes(unsigned Level) const;
1548
1549 /// Push new OpenMP function region for non-capturing function.
1550 void pushOpenMPFunctionRegion();
1551
1552 /// Pop OpenMP function region for non-capturing function.
1553 void popOpenMPFunctionRegion(const sema::FunctionScopeInfo *OldFSI);
1554
1555 /// Analyzes and checks a loop nest for use by a loop transformation.
1556 ///
1557 /// \param Kind The loop transformation directive kind.
1558 /// \param NumLoops How many nested loops the directive is expecting.
1559 /// \param AStmt Associated statement of the transformation directive.
1560 /// \param LoopHelpers [out] The loop analysis result.
1561 /// \param Body [out] The body code nested in \p NumLoops loop.
1562 /// \param OriginalInits [out] Collection of statements and declarations that
1563 /// must have been executed/declared before entering the
1564 /// loop.
1565 ///
1566 /// \return Whether there was any error.
1567 bool checkTransformableLoopNest(
1568 OpenMPDirectiveKind Kind, Stmt *AStmt, int NumLoops,
1570 Stmt *&Body, SmallVectorImpl<SmallVector<Stmt *>> &OriginalInits);
1571
1572 /// Holds the result of the analysis of a (possibly canonical) loop.
1573 struct LoopAnalysis {
1574 /// The analyzed loop or loop transformation.
1575 Stmt *AStmt = nullptr;
1576 /// Loop analyses results.
1577 OMPLoopBasedDirective::HelperExprs HelperExprs;
1578 /// The for-statement of the loop. TheForStmt equals AStmt only when the
1579 /// latter is a canonical loop (i.e. not a loop transformation).
1580 Stmt *TheForStmt = nullptr;
1581 /// Initialization statements before transformations.
1582 SmallVector<Stmt *> OriginalInits;
1583 /// Initialization statements required after transformation of this loop.
1584 SmallVector<Stmt *> TransformsPreInits;
1585
1586 explicit LoopAnalysis(Stmt *S) : AStmt(S) {}
1587
1588 bool isRegularLoop() const { return isRegularLoop(AStmt); }
1589 bool isLoopTransformation() const { return isLoopTransformation(AStmt); }
1590
1591 // Convenience functions used when building LoopSequenceAnalysis.
1592 static bool isRegularLoop(Stmt *S) {
1594 }
1595 static bool isLoopTransformation(Stmt *S) {
1597 }
1598 };
1599
1600 /// Holds the result of the analysis of a (possibly canonical) loop sequence.
1601 struct LoopSequenceAnalysis {
1602 /// Number of top level canonical loops.
1603 unsigned LoopSeqSize = 0;
1604 /// For each loop results of the analysis.
1605 SmallVector<LoopAnalysis, 2> Loops;
1606 /// Additional code required before entering the transformed loop sequence.
1607 SmallVector<Stmt *> LoopSequencePreInits;
1608
1609 // Convenience function used when building the LoopSequenceAnalysis.
1610 static bool isLoopSequenceDerivation(Stmt *S) {
1611 return LoopAnalysis::isRegularLoop(S) ||
1612 LoopAnalysis::isLoopTransformation(S);
1613 }
1614 };
1615
1616 /// The main recursive process of `checkTransformableLoopSequence` that
1617 /// performs grammatical parsing of a canonical loop sequence. It extracts
1618 /// key information, such as the number of top-level loops, loop statements,
1619 /// helper expressions, and other relevant loop-related data, all in a single
1620 /// execution to avoid redundant traversals. This analysis flattens inner
1621 /// Loop Sequences
1622 ///
1623 /// \param LoopSeqStmt The AST of the original statement.
1624 /// \param SeqAnalysis [out] Result of the analysis of \p LoopSeqStmt
1625 /// \param Context
1626 /// \param Kind The loop transformation directive kind.
1627 /// \return Whether the original statement is both syntactically and
1628 /// semantically correct according to OpenMP 6.0 canonical loop
1629 /// sequence definition.
1630 bool analyzeLoopSequence(Stmt *LoopSeqStmt, LoopSequenceAnalysis &SeqAnalysis,
1631 ASTContext &Context, OpenMPDirectiveKind Kind);
1632
1633 /// Validates and checks whether a loop sequence can be transformed according
1634 /// to the given directive, providing necessary setup and initialization
1635 /// (Driver function) before recursion using `analyzeLoopSequence`.
1636 ///
1637 /// \param Kind The loop transformation directive kind.
1638 /// \param AStmt The AST of the original statement
1639 /// \param SeqAnalysis [out] Result of the analysis of \p LoopSeqStmt
1640 /// \param Context
1641 /// \return Whether there was an absence of errors or not
1642 bool checkTransformableLoopSequence(OpenMPDirectiveKind Kind, Stmt *AStmt,
1643 LoopSequenceAnalysis &SeqAnalysis,
1644 ASTContext &Context);
1645
1646 /// Helper to keep information about the current `omp begin/end declare
1647 /// variant` nesting.
1648 struct OMPDeclareVariantScope {
1649 /// The associated OpenMP context selector.
1650 OMPTraitInfo *TI;
1651
1652 /// The associated OpenMP context selector mangling.
1653 std::string NameSuffix;
1654
1655 OMPDeclareVariantScope(OMPTraitInfo &TI);
1656 };
1657
1658 /// Return the OMPTraitInfo for the surrounding scope, if any.
1659 OMPTraitInfo *getOMPTraitInfoForSurroundingScope() {
1660 return OMPDeclareVariantScopes.empty() ? nullptr
1661 : OMPDeclareVariantScopes.back().TI;
1662 }
1663
1664 /// The current `omp begin/end declare variant` scopes.
1665 SmallVector<OMPDeclareVariantScope, 4> OMPDeclareVariantScopes;
1666
1667 /// The current `omp begin/end assumes` scopes.
1668 SmallVector<OMPAssumeAttr *, 4> OMPAssumeScoped;
1669
1670 /// All `omp assumes` we encountered so far.
1671 SmallVector<OMPAssumeAttr *, 4> OMPAssumeGlobal;
1672
1673 /// Device number specified by the context selector.
1674 int DeviceNum = -1;
1675
1676 /// Device number identifier specified by the context selector.
1677 StringRef DeviceNumID;
1678};
1679
1680} // namespace clang
1681
1682#endif // LLVM_CLANG_SEMA_SEMAOPENMP_H
#define V(N, I)
Forward declaration of all AST node types.
This file defines the classes used to store parsed information about declaration-specifiers and decla...
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
This file defines OpenMP AST classes for executable directives and clauses.
Represents a C++ nested-name-specifier or a global scope specifier.
Definition DeclSpec.h:76
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition DeclBase.h:1466
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
The name of a declaration.
Information about one declarator, including the parsed type information and the identifier.
Definition DeclSpec.h:1952
An instance of this object exists for each enum constant that is defined.
Definition Decl.h:3558
This represents one expression.
Definition Expr.h:113
Represents a member of a struct/union/class.
Definition Decl.h:3295
Represents a function declaration or definition.
Definition Decl.h:2059
One of these records is kept for each identifier that is lexed.
This represents a decl that may have a name.
Definition Decl.h:275
This is a basic class for representing single OpenMP clause.
This represents 'pragma omp groupprivate ...' directive.
Definition DeclOpenMP.h:173
This represents 'pragma omp requires...' directive.
Definition DeclOpenMP.h:479
This represents 'pragma omp threadprivate ...' directive.
Definition DeclOpenMP.h:110
Wrapper for void* pointer.
Definition Ownership.h:51
ParsedAttr - Represents a syntactic attribute.
Definition ParsedAttr.h:119
A (possibly-)qualified type.
Definition TypeBase.h:938
Scope - A scope is a transient data structure that is used while parsing the program.
Definition Scope.h:41
A generic diagnostic builder for errors which may or may not be deferred.
Definition SemaBase.h:111
SemaBase(Sema &S)
Definition SemaBase.cpp:7
StmtResult ActOnOpenMPTargetParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target parallel for' after parsing of the associated statement.
OMPClause * ActOnOpenMPNocontextClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'nocontext' clause.
OMPClause * ActOnOpenMPXDynCGroupMemClause(Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_dyn_cgroup_mem' clause.
DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveEnd(Scope *S, DeclGroupPtrTy DeclReductions, bool IsValid)
Called at the end of 'pragma omp declare reduction'.
bool isInOpenMPTaskUntiedContext() const
Return true if currently in OpenMP task with untied clause context.
OMPClause * ActOnOpenMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'untied' clause.
OMPClause * ActOnOpenMPSafelenClause(Expr *Length, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'safelen' clause.
OMPClause * ActOnOpenMPThreadsetClause(OpenMPThreadsetKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'threadset' clause.
OMPClause * ActOnOpenMPHoldsClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'holds' clause.
StmtResult ActOnOpenMPParallelMasterTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel master taskloop simd' after parsing of the associated sta...
StmtResult ActOnOpenMPParallelMasterDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel master' after parsing of the associated statement.
StmtResult ActOnOpenMPDispatchDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp dispatch' after parsing of the.
OMPClause * ActOnOpenMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'read' clause.
OMPClause * ActOnOpenMPFilterClause(Expr *ThreadID, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'filter' clause.
void ActOnOpenMPDeclareReductionCombinerEnd(Decl *D, Expr *Combiner)
Finish current declare reduction construct initializer.
ExprResult ActOnOpenMPCall(ExprResult Call, Scope *Scope, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig)
Given the potential call expression Call, determine if there is a specialization via the OpenMP decla...
void setOpenMPDeviceNum(int Num)
Setter and getter functions for device_num.
OMPClause * ActOnOpenMPFullClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-form 'full' clauses.
StmtResult ActOnOpenMPSplitDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp split' after parsing of its associated statement.
StmtResult ActOnOpenMPTargetEnterDataDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AStmt)
Called on well-formed '#pragma omp target enter data' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetTeamsGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams loop' after parsing of the associated statement.
OMPClause * ActOnOpenMPDetachClause(Expr *Evt, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'detach' clause.
StmtResult ActOnOpenMPFlattenDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp flatten' after parsing of its clauses and the associated statement.
OMPClause * ActOnOpenMPUseClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'use' clause.
OMPClause * ActOnOpenMPFailClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'fail' clause.
StmtResult ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute parallel for simd' after parsing of the as...
StmtResult ActOnOpenMPAssumeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Process an OpenMP assume directive.
ExprResult ActOnOpenMPDimsModifier(OpenMPClauseKind Kind, int Modifier, Expr *ModifierExpr, SourceLocation ModifierLoc, ArrayRef< Expr * > VarList, SourceLocation VarListEndLoc)
void ActOnFinishedOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI)
Called once a target context is completed, that can be when a 'pragma omp end declare target' was enc...
OMPClause * ActOnOpenMPDirectivePresenceClause(OpenMPClauseKind CK, llvm::ArrayRef< OpenMPDirectiveKind > DKVec, SourceLocation Loc, SourceLocation LLoc, SourceLocation RLoc)
Called on well-formed 'absent' or 'contains' clauses.
void tryCaptureOpenMPLambdas(ValueDecl *V)
Function tries to capture lambda's captured variables in the OpenMP region before the original lambda...
StmtResult ActOnOpenMPParallelMaskedDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel masked' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetTeamsDistributeParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute parallel for' after parsing of the associa...
OMPClause * ActOnOpenMPPrivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'private' clause.
void StartOpenMPClause(OpenMPClauseKind K)
Start analysis of clauses.
bool CheckOpenMPLinearModifier(OpenMPLinearClauseKind LinKind, SourceLocation LinLoc)
Checks correctness of linear modifiers.
ExprResult ActOnOpenMPDeclareMapperDirectiveVarDecl(Scope *S, QualType MapperType, SourceLocation StartLoc, DeclarationName VN)
Build the mapper variable of 'pragma omp declare mapper'.
OMPClause * ActOnOpenMPOrderedClause(SourceLocation StartLoc, SourceLocation EndLoc, SourceLocation LParenLoc=SourceLocation(), Expr *NumForLoops=nullptr)
Called on well-formed 'ordered' clause.
OMPClause * ActOnOpenMPSelfMapsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'self_maps' clause.
bool CheckOpenMPLinearDecl(const ValueDecl *D, SourceLocation ELoc, OpenMPLinearClauseKind LinKind, QualType Type, bool IsDeclareSimd=false)
Checks that the specified declaration matches requirements for the linear decls.
OMPClause * ActOnOpenMPIsDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'is_device_ptr' clause.
OMPClause * ActOnOpenMPCountsClause(ArrayRef< Expr * > CountExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, std::optional< unsigned > FillIdx, SourceLocation FillLoc, unsigned FillCount)
Called on well-formed 'counts' clause after parsing its arguments.
OMPClause * ActOnOpenMPHasDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'has_device_addr' clause.
StmtResult ActOnOpenMPErrorDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, bool InExContext=true)
Called on well-formed '#pragma omp error'.
OMPClause * ActOnOpenMPPartialClause(Expr *FactorExpr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'partial' clauses.
OMPClause * ActOnOpenMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'update' clause.
StmtResult ActOnOpenMPSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPLastprivateClause(ArrayRef< Expr * > VarList, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'lastprivate' clause.
void ActOnOpenMPDeclareTargetName(NamedDecl *ND, SourceLocation Loc, OMPDeclareTargetDeclAttr::MapTypeTy MT, DeclareTargetContextInfo &DTCI)
Called on correct id-expression from the 'pragma omp declare target'.
DeclGroupPtrTy ActOnOpenMPRequiresDirective(SourceLocation Loc, ArrayRef< OMPClause * > ClauseList)
Called on well-formed 'pragma omp requires'.
OMPGroupPrivateDecl * CheckOMPGroupPrivateDecl(SourceLocation Loc, ArrayRef< Expr * > VarList)
Builds a new OpenMPGroupPrivateDecl and checks its correctness.
StmtResult ActOnOpenMPDistributeSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPFirstprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'firstprivate' clause.
StmtResult ActOnOpenMPDepobjDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp depobj'.
ExprResult getOpenMPCapturedExpr(VarDecl *Capture, ExprValueKind VK, ExprObjectKind OK, SourceLocation Loc)
OMPClause * ActOnOpenMPPriorityClause(Expr *Priority, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'priority' clause.
OMPClause * ActOnOpenMPSingleExprWithArgClause(OpenMPClauseKind Kind, ArrayRef< unsigned > Arguments, Expr *Expr, SourceLocation StartLoc, SourceLocation LParenLoc, ArrayRef< SourceLocation > ArgumentsLoc, SourceLocation DelimLoc, SourceLocation EndLoc)
void ActOnOpenMPDeclareVariantDirective(FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI, ArrayRef< Expr * > AdjustArgsNothing, ArrayRef< Expr * > AdjustArgsNeedDevicePtr, ArrayRef< Expr * > AdjustArgsNeedDeviceAddr, ArrayRef< OMPInteropInfo > AppendArgs, SourceLocation AdjustArgsLoc, SourceLocation AppendArgsLoc, SourceRange SR)
Called on well-formed '#pragma omp declare variant' after parsing of the associated method/function.
StmtResult ActOnOpenMPTargetParallelDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target parallel' after parsing of the associated statement.
OMPClause * ActOnOpenMPDistScheduleClause(OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc)
Called on well-formed 'dist_schedule' clause.
OpenMPClauseKind isOpenMPPrivateDecl(ValueDecl *D, unsigned Level, unsigned CapLevel) const
Check if the specified variable is used in 'private' clause.
OMPClause * ActOnOpenMPLoopRangeClause(Expr *First, Expr *Count, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation FirstLoc, SourceLocation CountLoc, SourceLocation EndLoc)
Called on well-form 'looprange' clause after parsing its arguments.
StmtResult ActOnOpenMPMetaDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp metadirective' after parsing of the associated statement.
OMPClause * ActOnOpenMPPermutationClause(ArrayRef< Expr * > PermExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'permutation' clause after parsing its arguments.
OMPClause * ActOnOpenMPNontemporalClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'nontemporal' clause.
OMPClause * ActOnOpenMPBindClause(OpenMPBindClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'bind' clause.
OMPClause * ActOnOpenMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'threads' clause.
OMPClause * ActOnOpenMPSharedClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'shared' clause.
StmtResult ActOnOpenMPTargetExitDataDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AStmt)
Called on well-formed '#pragma omp target exit data' after parsing of the associated statement.
StmtResult ActOnOpenMPTeamsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp teams' after parsing of the associated statement.
OMPClause * ActOnOpenMPCopyinClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyin' clause.
OMPClause * ActOnOpenMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'mergeable' clause.
void startOpenMPCXXRangeFor()
If the current region is a range loop-based region, mark the start of the loop construct.
OMPClause * ActOnOpenMPDestroyClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'destroy' clause.
StmtResult ActOnOpenMPParallelMaskedTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel masked taskloop' after parsing of the associated statemen...
OMPClause * ActOnOpenMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, Expr *Modifier, ArrayRef< Expr * > Locators)
Called on well-formed 'affinity' clause.
OMPClause * ActOnOpenMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'compare' clause.
StmtResult ActOnOpenMPFuseDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp fuse' after parsing of its clauses and the associated statement.
StmtResult ActOnOpenMPParallelSectionsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel sections' after parsing of the associated statement.
OMPClause * ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data, Expr *DepModifier, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depend' clause.
OMPClause * ActOnOpenMPDoacrossClause(OpenMPDoacrossClauseModifier DepType, SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'doacross' clause.
VarDecl * ActOnOpenMPDeclareReductionInitializerStart(Scope *S, Decl *D)
Initialize declare reduction construct initializer.
StmtResult ActOnOpenMPTeamsDistributeParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute parallel for' after parsing of the associated sta...
StmtResult ActOnOpenMPMasterDirective(Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp master' after parsing of the associated statement.
StmtResult ActOnOpenMPTaskgroupDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp taskgroup'.
VarDecl * isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo=false, unsigned StopAt=0)
Check if the specified variable is used in one of the private clauses (private, firstprivate,...
OMPClause * ActOnOpenMPUseDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, OpenMPUseDevicePtrFallbackModifier FallbackModifier, SourceLocation FallbackModifierLoc)
Called on well-formed 'use_device_ptr' clause.
StmtResult ActOnOpenMPMasterTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp master taskloop simd' after parsing of the associated statement.
friend class Sema
Definition SemaOpenMP.h:55
ExprResult ActOnOpenMPIdExpression(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id, OpenMPDirectiveKind Kind)
Called on correct id-expression from the 'pragma omp threadprivate'.
void ActOnOpenMPEndAssumesDirective()
Called on well-formed 'pragma omp end assumes'.
OMPClause * ActOnOpenMPNogroupClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'nogroup' clause.
OMPClause * ActOnOpenMPGrainsizeClause(OpenMPGrainsizeClauseModifier Modifier, Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'grainsize' clause.
ExprResult ActOnOMPArraySectionExpr(Expr *Base, SourceLocation LBLoc, Expr *LowerBound, SourceLocation ColonLocFirst, SourceLocation ColonLocSecond, Expr *Length, Expr *Stride, SourceLocation RBLoc)
bool isOpenMPRebuildMemberExpr(ValueDecl *D)
The member expression(this->fd) needs to be rebuilt in the template instantiation to generate private...
void ActOnOpenMPDeviceNum(Expr *DeviceNumExpr)
Called on device_num selector in context selectors.
QualType ActOnOpenMPDeclareReductionType(SourceLocation TyLoc, TypeResult ParsedType)
Check if the specified type is allowed to be used in 'omp declare reduction' construct.
StmtResult ActOnOpenMPMaskedTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp masked taskloop simd' after parsing of the associated statement.
bool isOpenMPCapturedByRef(const ValueDecl *D, unsigned Level, unsigned OpenMPCaptureLevel) const
Return true if the provided declaration VD should be captured by reference.
OMPClause * ActOnOpenMPWhenClause(OMPTraitInfo &TI, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'when' clause.
StmtResult ActOnOpenMPParallelGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel loop' after parsing of the associated statement.
DeclGroupPtrTy ActOnOpenMPAllocateDirective(SourceLocation Loc, ArrayRef< Expr * > VarList, ArrayRef< OMPClause * > Clauses, DeclContext *Owner=nullptr)
Called on well-formed 'pragma omp allocate'.
OMPClause * ActOnOpenMPUpdateDependObjectsClause(OpenMPDependClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'update_depend_objects' clause.
OMPClause * ActOnOpenMPSimpleClause(OpenMPClauseKind Kind, unsigned Argument, SourceLocation ArgumentLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
OMPClause * ActOnOpenMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'unified_address' clause.
static int getOpenMPCaptureLevels(OpenMPDirectiveKind Kind)
Return the number of captured regions created for an OpenMP directive.
bool isOpenMPTargetCapturedDecl(const ValueDecl *D, unsigned Level, unsigned CaptureLevel) const
Check if the specified variable is captured by 'target' directive.
StmtResult ActOnOpenMPParallelMaskedTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel masked taskloop simd' after parsing of the associated sta...
OMPClause * ActOnOpenMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'dynamic_allocators' clause.
StmtResult ActOnOpenMPScopeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp scope' after parsing of the associated statement.
void ActOnOpenMPIteratorVarDecl(VarDecl *VD)
bool isInOpenMPDeclareVariantScope() const
Can we exit an OpenMP declare variant scope at the moment.
Definition SemaOpenMP.h:113
StmtResult ActOnOpenMPDistributeParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute parallel for simd' after parsing of the associated stat...
StmtResult ActOnOpenMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp barrier'.
TypeResult ActOnOpenMPDeclareMapperVarDecl(Scope *S, Declarator &D)
Check variable declaration in 'omp declare mapper' construct.
ExprResult ActOnOMPIteratorExpr(Scope *S, SourceLocation IteratorKwLoc, SourceLocation LLoc, SourceLocation RLoc, ArrayRef< OMPIteratorData > Data)
OMPClause * ActOnOpenMPUsesAllocatorClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< UsesAllocatorsData > Data)
Called on well-formed 'uses_allocators' clause.
StmtResult ActOnOpenMPRegionEnd(StmtResult S, ArrayRef< OMPClause * > Clauses)
End of OpenMP region.
DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveStart(Scope *S, DeclContext *DC, DeclarationName Name, ArrayRef< std::pair< QualType, SourceLocation > > ReductionTypes, AccessSpecifier AS, Decl *PrevDeclInScope=nullptr)
Called on start of 'pragma omp declare reduction'.
OMPClause * ActOnOpenMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'acq_rel' clause.
OMPClause * ActOnOpenMPAllocatorClause(Expr *Allocator, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'allocator' clause.
ExprResult VerifyPositiveIntegerConstantInClause(Expr *Op, OpenMPClauseKind CKind, bool StrictlyPositive=true, bool SuppressExprDiags=false)
DeclGroupPtrTy ActOnOpenMPGroupPrivateDirective(SourceLocation Loc, ArrayRef< Expr * > VarList)
Called on well-formed 'pragma omp groupprivate'.
bool isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const
OMPClause * ActOnOpenMPInclusiveClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'inclusive' clause.
SemaDiagnosticBuilder diagIfOpenMPHostCode(SourceLocation Loc, unsigned DiagID, const FunctionDecl *FD)
Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as host cod...
SemaDiagnosticBuilder diagIfOpenMPDeviceCode(SourceLocation Loc, unsigned DiagID, const FunctionDecl *FD)
Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as device c...
StmtResult ActOnOpenMPSectionsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp sections' after parsing of the associated statement.
void ActOnOpenMPEndDeclareVariant()
Handle a omp end declare variant.
OMPClause * ActOnOpenMPTaskReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'task_reduction' clause.
bool hasGlobalOpenMPAssumes() const
Check if there is an active global omp assumes directive.
Definition SemaOpenMP.h:254
OMPClause * ActOnOpenMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc, SourceLocation LParenLoc, Expr *Condition)
Called on well-formed 'nowait' clause.
StmtResult ActOnOpenMPCriticalDirective(const DeclarationNameInfo &DirName, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp critical' after parsing of the associated statement.
StmtResult ActOnOpenMPMaskedDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp masked' after parsing of the.
StmtResult ActOnOpenMPStripeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
void ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(Decl *D)
Act on D, a function definition inside of an omp [begin/end] assumes.
void EndOpenMPDSABlock(Stmt *CurDirective)
Called on end of data sharing attribute block.
OMPClause * ActOnOpenMPOrderClause(OpenMPOrderClauseModifier Modifier, OpenMPOrderClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc)
Called on well-formed 'order' clause.
llvm::SmallDenseMap< const ValueDecl *, const Expr *, 4 > VarsWithInheritedDSAType
Definition SemaOpenMP.h:438
OMPClause * ActOnOpenMPSizesClause(ArrayRef< Expr * > SizeExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'sizes' clause.
bool ActOnStartOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI)
Called on the start of target region i.e. 'pragma omp declare target'.
StmtResult ActOnOpenMPTeamsDistributeParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute parallel for simd' after parsing of the associate...
OMPClause * ActOnOpenMPDeviceClause(OpenMPDeviceClauseModifier Modifier, Expr *Device, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'device' clause.
OMPClause * ActOnOpenMPNumThreadsClause(ArrayRef< Expr * > VarList, OpenMPNumThreadsClauseModifier SimpleModifier, SourceLocation SimpleModifierLoc, OpenMPNumThreadsClauseModifier ComplexModifier, Expr *ComplexModifierExpr, SourceLocation ComplexModifierLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'num_threads' clause.
StmtResult ActOnOpenMPDistributeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute' after parsing of the associated statement.
StmtResult ActOnOpenMPSectionDirective(Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp section' after parsing of the associated statement.
StmtResult ActOnOpenMPInterchangeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp interchange' after parsing of its clauses and the associated statem...
bool isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level, unsigned CaptureLevel) const
Check if the specified global variable must be captured by outer capture regions.
OMPClause * ActOnOpenMPInReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'in_reduction' clause.
StmtResult ActOnOpenMPGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp loop' after parsing of the associated statement.
OMPClause * ActOnOpenMPFlushClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'flush' pseudo clause.
OMPRequiresDecl * CheckOMPRequiresDecl(SourceLocation Loc, ArrayRef< OMPClause * > Clauses)
Check restrictions on Requires directive.
void ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(Decl *D, SmallVectorImpl< FunctionDecl * > &Bases)
Register D as specialization of all base functions in Bases in the current omp begin/end declare vari...
StmtResult ActOnOpenMPExecutableDirective(OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName, OpenMPDirectiveKind CancelRegion, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
void EndOpenMPClause()
End analysis of clauses.
bool isInOpenMPAssumeScope() const
Check if there is an active global omp begin assumes directive.
Definition SemaOpenMP.h:251
void setOpenMPDeviceNumID(StringRef ID)
StmtResult ActOnOpenMPDistributeParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute parallel for' after parsing of the associated statement...
QualType ActOnOpenMPDeclareMapperType(SourceLocation TyLoc, TypeResult ParsedType)
Check if the specified type is allowed to be used in 'omp declare mapper' construct.
StmtResult ActOnOpenMPTeamsDistributeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetTeamsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target teams' after parsing of the associated statement.
OMPClause * ActOnOpenMPMessageClause(Expr *MS, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'message' clause.
OMPClause * ActOnOpenMPThreadLimitClause(ArrayRef< Expr * > VarList, OpenMPThreadLimitClauseModifier Modifier, Expr *ModifierExpr, SourceLocation ModifierLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'thread_limit' clause.
int getOpenMPDeviceNum() const
StmtResult ActOnOpenMPScanDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp scan'.
OMPClause * ActOnOpenMPScheduleClause(OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2, OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc, SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc)
Called on well-formed 'schedule' clause.
void ActOnOpenMPLoopInitialization(SourceLocation ForLoc, Stmt *Init)
Check if the current region is an OpenMP loop region and if it is, mark loop control variable,...
OMPClause * ActOnOpenMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'unified_address' clause.
void DiagnoseUnterminatedOpenMPDeclareTarget()
Report unterminated 'omp declare target' or 'omp begin declare target' at the end of a compilation un...
void finalizeOpenMPDelayedAnalysis(const FunctionDecl *Caller, const FunctionDecl *Callee, SourceLocation Loc)
Finishes analysis of the deferred functions calls that may be declared as host/nohost during device/h...
OMPClause * ActOnOpenMPSimdlenClause(Expr *Length, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'simdlen' clause.
std::optional< std::pair< FunctionDecl *, Expr * > > checkOpenMPDeclareVariantFunction(DeclGroupPtrTy DG, Expr *VariantRef, OMPTraitInfo &TI, unsigned NumAppendArgs, SourceRange SR)
Checks '#pragma omp declare variant' variant function and original functions after parsing of the ass...
StmtResult ActOnOpenMPParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel for simd' after parsing of the associated statement.
OpaquePtr< DeclGroupRef > DeclGroupPtrTy
Definition SemaOpenMP.h:57
OMPClause * ActOnOpenMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'release' clause.
OMPClause * ActOnOpenMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'acquire' clause.
OMPClause * ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'proc_bind' clause.
OMPClause * ActOnOpenMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'simd' clause.
OMPClause * ActOnOpenMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_bare' clause.
StmtResult ActOnOpenMPInformationalDirective(OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Process an OpenMP informational directive.
StmtResult ActOnOpenMPCanonicalLoop(Stmt *AStmt)
Called for syntactical loops (ForStmt or CXXForRangeStmt) associated to an OpenMP loop directive.
OMPClause * ActOnOpenMPTransparentClause(Expr *Transparent, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'transparent' clause.
OMPClause * ActOnOpenMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'hint' clause.
OMPClause * ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
OMPClause * ActOnOpenMPNullaryAssumptionClause(OpenMPClauseKind CK, SourceLocation Loc, SourceLocation RLoc)
StmtResult ActOnOpenMPTargetTeamsDistributeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute' after parsing of the associated statement...
StmtResult ActOnOpenMPParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel for' after parsing of the associated statement.
OMPClause * ActOnOpenMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'capture' clause.
StmtResult ActOnOpenMPForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp for' after parsing of the associated statement.
StmtResult ActOnOpenMPAtomicDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp atomic' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetUpdateDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AStmt)
Called on well-formed '#pragma omp target update'.
StmtResult ActOnOpenMPOrderedDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp ordered' after parsing of the associated statement.
OMPClause * ActOnOpenMPNumTeamsClause(ArrayRef< Expr * > VarList, OpenMPNumTeamsClauseModifier Modifier, Expr *ModifierExpr, SourceLocation ModifierLoc, OpenMPNumTeamsClauseModifier ModifierExtra, Expr *ModifierExtraExpr, SourceLocation ModifierExtraLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'num_teams' clause.
StmtResult ActOnOpenMPReverseDirective(Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp reverse'.
ExprResult ActOnOMPArrayShapingExpr(Expr *Base, SourceLocation LParenLoc, SourceLocation RParenLoc, ArrayRef< Expr * > Dims, ArrayRef< SourceRange > Brackets)
OMPClause * ActOnOpenMPAtClause(OpenMPAtClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'at' clause.
StmtResult ActOnOpenMPTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp taskloop' after parsing of the associated statement.
OMPClause * ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'init' clause.
OMPClause * ActOnOpenMPUseDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'use_device_addr' clause.
void ActOnOpenMPDeclareReductionCombinerStart(Scope *S, Decl *D)
Initialize declare reduction construct initializer.
OMPClause * ActOnOpenMPAllocateClause(Expr *Allocator, Expr *Alignment, OpenMPAllocateClauseModifier FirstModifier, SourceLocation FirstModifierLoc, OpenMPAllocateClauseModifier SecondModifier, SourceLocation SecondModifierLoc, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation ColonLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'allocate' clause.
std::pair< StringRef, QualType > CapturedParamNameType
Definition SemaOpenMP.h:58
OMPClause * ActOnOpenMPFinalClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'final' clause.
bool isInOpenMPTargetExecutionDirective() const
Return true inside OpenMP target region.
StmtResult ActOnOpenMPTargetDataDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target data' after parsing of the associated statement.
StmtResult ActOnOpenMPMasterTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp master taskloop' after parsing of the associated statement.
void ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, SmallVectorImpl< FunctionDecl * > &Bases)
The declarator D defines a function in the scope S which is nested in an omp begin/end declare varian...
friend class Parser
Definition SemaOpenMP.h:54
StmtResult ActOnOpenMPFlushDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp flush'.
StmtResult ActOnOpenMPUnrollDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp unroll' after parsing of its clauses and the associated statement.
OMPClause * ActOnOpenMPMapClause(Expr *IteratorModifier, ArrayRef< OpenMPMapModifierKind > MapTypeModifiers, ArrayRef< SourceLocation > MapTypeModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, OpenMPMapClauseKind MapType, bool IsMapTypeImplicit, SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, bool NoDiagnose=false, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'map' clause.
OMPClause * ActOnOpenMPNumTasksClause(OpenMPNumTasksClauseModifier Modifier, Expr *NumTasks, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'num_tasks' clause.
void ActOnOpenMPDeclareTargetInitializer(Decl *D)
Adds OMPDeclareTargetDeclAttr to referenced variables in declare target directive.
bool isInOpenMPDeclareTargetContext() const
Return true inside OpenMP declare target region.
Definition SemaOpenMP.h:379
OMPClause * ActOnOpenMPFromClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'from' clause.
StmtResult ActOnOpenMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Called on well-formed '#pragma omp cancellation point'.
OMPClause * ActOnOpenMPDynGroupprivateClause(OpenMPDynGroupprivateClauseModifier M1, OpenMPDynGroupprivateClauseFallbackModifier M2, Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc, SourceLocation EndLoc)
Called on a well-formed 'dyn_groupprivate' clause.
OMPClause * ActOnOpenMPVarListClause(OpenMPClauseKind Kind, ArrayRef< Expr * > Vars, const OMPVarListLocTy &Locs, OpenMPVarListDataTy &Data)
void startOpenMPLoop()
If the current region is a loop-based region, mark the start of the loop construct.
StmtResult ActOnOpenMPTargetDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target' after parsing of the associated statement.
void StartOpenMPDSABlock(OpenMPDirectiveKind K, const DeclarationNameInfo &DirName, Scope *CurScope, SourceLocation Loc)
Called on start of new data sharing attribute block.
OMPThreadPrivateDecl * CheckOMPThreadPrivateDecl(SourceLocation Loc, ArrayRef< Expr * > VarList)
Builds a new OpenMPThreadPrivateDecl and checks its correctness.
void handleOMPAssumeAttr(Decl *D, const ParsedAttr &AL)
OMPClause * ActOnOpenMPSeverityClause(OpenMPSeverityClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'severity' clause.
OMPClause * ActOnOpenMPToClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'to' clause.
void ActOnOpenMPDeclareReductionInitializerEnd(Decl *D, Expr *Initializer, VarDecl *OmpPrivParm)
Finish current declare reduction construct initializer.
OMPClause * ActOnOpenMPLinearClause(ArrayRef< Expr * > VarList, Expr *Step, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind, SourceLocation LinLoc, SourceLocation ColonLoc, SourceLocation StepModifierLoc, SourceLocation EndLoc)
Called on well-formed 'linear' clause.
OMPClause * ActOnOpenMPDefaultmapClause(OpenMPDefaultmapClauseModifier M, OpenMPDefaultmapClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc)
Called on well-formed 'defaultmap' clause.
StmtResult ActOnOpenMPMaskedTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp masked taskloop' after parsing of the associated statement.
StmtResult ActOnOpenMPTaskwaitDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp taskwait'.
StmtResult ActOnOpenMPForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp for simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPReductionClause(ArrayRef< Expr * > VarList, OpenMPVarListDataTy::OpenMPReductionClauseModifiers Modifiers, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'reduction' clause.
OMPClause * ActOnOpenMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'relaxed' clause.
OMPClause * ActOnOpenMPAlignedClause(ArrayRef< Expr * > VarList, Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Called on well-formed 'aligned' clause.
StmtResult ActOnOpenMPInteropDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp interop'.
OMPClause * ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depobj' pseudo clause.
OMPClause * ActOnOpenMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'seq_cst' clause.
void checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D, SourceLocation IdLoc=SourceLocation())
Check declaration inside target region.
OMPClause * ActOnOpenMPNovariantsClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'novariants' clause.
OMPClause * ActOnOpenMPCopyprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyprivate' clause.
OMPClause * ActOnOpenMPCollapseClause(Expr *NumForLoops, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'collapse' clause.
DeclGroupPtrTy ActOnOpenMPDeclareSimdDirective(DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS, Expr *Simdlen, ArrayRef< Expr * > Uniforms, ArrayRef< Expr * > Aligneds, ArrayRef< Expr * > Alignments, ArrayRef< Expr * > Linears, ArrayRef< unsigned > LinModifiers, ArrayRef< Expr * > Steps, SourceRange SR)
Called on well-formed '#pragma omp declare simd' after parsing of the associated method/function.
ExprResult PerformOpenMPImplicitIntegerConversion(SourceLocation OpLoc, Expr *Op)
StmtResult ActOnOpenMPTargetSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPDefaultClause(llvm::omp::DefaultKind M, SourceLocation MLoc, OpenMPDefaultClauseVariableCategory VCKind, SourceLocation VCKindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'default' clause.
OMPClause * ActOnOpenMPAlignClause(Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'align' clause.
OMPClause * ActOnOpenMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'atomic_default_mem_order' clause.
StmtResult ActOnOpenMPTeamsGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams loop' after parsing of the associated statement.
OMPClause * ActOnOpenMPWeakClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'weak' clause.
OMPClause * ActOnOpenMPXAttributeClause(ArrayRef< const Attr * > Attrs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_attribute' clause.
StmtResult ActOnOpenMPTileDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp tile' after parsing of its clauses and the associated statement.
StmtResult ActOnOpenMPParallelDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel' after parsing of the associated statement.
StmtResult ActOnOpenMPSingleDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp single' after parsing of the associated statement.
StmtResult ActOnOpenMPTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp taskloop simd' after parsing of the associated statement.
const ValueDecl * getOpenMPDeclareMapperVarName() const
StmtResult ActOnOpenMPParallelMasterTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel master taskloop' after parsing of the associated statemen...
DeclGroupPtrTy ActOnOpenMPThreadprivateDirective(SourceLocation Loc, ArrayRef< Expr * > VarList)
Called on well-formed 'pragma omp threadprivate'.
void ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope)
Initialization of captured region for OpenMP region.
NamedDecl * lookupOpenMPDeclareTargetName(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id)
Searches for the provided declaration name for OpenMP declare target directive.
OMPClause * ActOnOpenMPExclusiveClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'exclusive' clause.
OMPClause * ActOnOpenMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'write' clause.
StmtResult ActOnOpenMPTargetParallelGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target parallel loop' after parsing of the associated statement.
void ActOnOpenMPAssumesDirective(SourceLocation Loc, OpenMPDirectiveKind DKind, ArrayRef< std::string > Assumptions, bool SkippedClauses)
Called on well-formed 'pragma omp [begin] assume[s]'.
StmtResult ActOnOpenMPTargetParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target parallel for simd' after parsing of the associated statemen...
void ActOnOpenMPBeginDeclareVariant(SourceLocation Loc, OMPTraitInfo &TI)
Handle a omp begin declare variant.
StmtResult ActOnOpenMPLoopnest(Stmt *AStmt)
Process a canonical OpenMP loop nest that can either be a canonical literal loop (ForStmt or CXXForRa...
OMPClause * ActOnOpenMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'reverse_offload' clause.
StmtResult ActOnOpenMPTaskDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp task' after parsing of the associated statement.
OMPClause * ActOnOpenMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation NameModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Called on well-formed 'if' clause.
StmtResult ActOnOpenMPTargetTeamsDistributeSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute simd' after parsing of the associated stat...
const DeclareTargetContextInfo ActOnOpenMPEndDeclareTargetDirective()
Called at the end of target region i.e. 'pragma omp end declare target'.
OMPClause * ActOnOpenMPDepthClause(Expr *DepthExpr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depth' clause.
void setOpenMPCaptureKind(FieldDecl *FD, const ValueDecl *D, unsigned Level)
Sets OpenMP capture kind (OMPC_private, OMPC_firstprivate, OMPC_map etc.) for FD based on DSA for the...
OMPClause * ActOnOpenMPClause(OpenMPClauseKind Kind, SourceLocation StartLoc, SourceLocation EndLoc)
StmtResult ActOnOpenMPCancelDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Called on well-formed '#pragma omp cancel'.
StmtResult ActOnOpenMPTaskyieldDirective(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp taskyield'.
StmtResult ActOnOpenMPTeamsDistributeSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute simd' after parsing of the associated statement.
DeclGroupPtrTy ActOnOpenMPDeclareMapperDirective(Scope *S, DeclContext *DC, DeclarationName Name, QualType MapperType, SourceLocation StartLoc, DeclarationName VN, AccessSpecifier AS, Expr *MapperVarRef, ArrayRef< OMPClause * > Clauses, Decl *PrevDeclInScope=nullptr)
Called for 'pragma omp declare mapper'.
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
Definition Stmt.h:85
The base class of the type hierarchy.
Definition TypeBase.h:1879
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:713
Represents a variable declaration or definition.
Definition Decl.h:933
Retains information about a function, method, or block that is currently being parsed.
Definition ScopeInfo.h:104
Definition SPIR.cpp:47
Top level wrappers for InstallAPI frontend operations.
bool isa(CodeGen::Address addr)
Definition Address.h:330
MutableArrayRef< TemplateParameterList * > MultiTemplateParamsArg
Definition Ownership.h:263
OpenMPDefaultClauseVariableCategory
OpenMP variable-category for 'default' clause.
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
OpenMPOrderClauseModifier
OpenMP modifiers for 'order' clause.
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
Definition Specifiers.h:150
OpenMPAtClauseKind
OpenMP attributes for 'at' clause.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
Definition OpenMPKinds.h:39
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition Specifiers.h:124
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
OpenMPNumTeamsClauseModifier
static constexpr unsigned NumberOfOMPAllocateClauseModifiers
Number of allowed allocate-modifiers.
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
OpenMPDoacrossClauseModifier
OpenMP dependence types for 'doacross' clause.
OpenMPDynGroupprivateClauseFallbackModifier
MutableArrayRef< Expr * > MultiExprArg
Definition Ownership.h:259
ActionResult< ParsedType > TypeResult
Definition Ownership.h:251
OpenMPBindClauseKind
OpenMP bindings for the 'bind' clause.
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition OpenMPKinds.h:55
OpenMPGrainsizeClauseModifier
OpenMPNumTasksClauseModifier
OpenMPUseDevicePtrFallbackModifier
OpenMP 6.1 use_device_ptr fallback modifier.
OpenMPSeverityClauseKind
OpenMP attributes for 'severity' clause.
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
OpenMPAllocateClauseModifier
OpenMP modifiers for 'allocate' clause.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Definition OpenMPKinds.h:63
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition OpenMPKinds.h:25
OpenMPDynGroupprivateClauseModifier
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition Specifiers.h:133
OpenMPThreadLimitClauseModifier
OpenMPNumThreadsClauseModifier
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
OpenMPDeviceClauseModifier
OpenMP modifiers for 'device' clause.
Definition OpenMPKinds.h:48
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
Definition Ownership.h:230
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
Definition OpenMPKinds.h:28
ActionResult< Expr * > ExprResult
Definition Ownership.h:249
OpenMPOrderClauseKind
OpenMP attributes for 'order' clause.
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
Definition OpenMPKinds.h:31
ActionResult< Stmt * > StmtResult
Definition Ownership.h:250
OpenMPThreadsetKind
OpenMP modifiers for 'threadset' clause.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Definition OpenMPKinds.h:71
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Iterator range representation begin:end[:step].
Definition ExprOpenMP.h:154
This structure contains most locations needed for by an OMPVarListClause.
OMPDeclareTargetDeclAttr::MapTypeTy MT
Definition SemaOpenMP.h:311
DeclareTargetContextInfo(OpenMPDirectiveKind Kind, SourceLocation Loc)
Definition SemaOpenMP.h:329
std::optional< Expr * > Indirect
The directive with indirect clause.
Definition SemaOpenMP.h:324
OpenMPDirectiveKind Kind
The directive kind, begin declare target or declare target.
Definition SemaOpenMP.h:321
OMPDeclareTargetDeclAttr::DevTypeTy DT
The 'device_type' as parsed from the clause.
Definition SemaOpenMP.h:318
SourceLocation Loc
The directive location.
Definition SemaOpenMP.h:327
llvm::DenseMap< NamedDecl *, MapInfo > ExplicitlyMapped
Explicitly listed variables and functions in a 'to' or 'link' clause.
Definition SemaOpenMP.h:315
Data structure for iterator expression.
OMPIteratorExpr::IteratorRange Range
Data used for processing a list of variables in OpenMP clauses.
SmallVector< SourceLocation, NumberOfOMPMotionModifiers > MotionModifiersLoc
int & ExtraModifier
Additional modifier for linear, map, depend, lastprivate, use_device_ptr, or num_teams clause.
SmallVector< OpenMPMotionModifierKind, NumberOfOMPMotionModifiers > MotionModifiers
std::array< int, 2 > ExtraModifierArray
SmallVector< SourceLocation, NumberOfOMPAllocateClauseModifiers > AllocClauseModifiersLoc
SmallVector< OpenMPMapModifierKind, NumberOfOMPMapClauseModifiers > MapTypeModifiers
SmallVector< SourceLocation, NumberOfOMPMapClauseModifiers > MapTypeModifiersLoc
std::array< SourceLocation, 2 > ExtraModifierLocArray
std::array< Expr *, 2 > ExtraModifierExprArray
SmallVector< OpenMPAllocateClauseModifier, NumberOfOMPAllocateClauseModifiers > AllocClauseModifiers
'step' modifier location for linear clause
Data for list of allocators.
Expr * AllocatorTraits
Allocator traits.
SourceLocation LParenLoc
Locations of '(' and ')' symbols.