clang 22.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 <optional>
35#include <string>
36#include <utility>
37
38namespace clang {
39namespace sema {
40class FunctionScopeInfo;
41} // namespace sema
42
43class DeclContext;
44class DeclGroupRef;
45class ParsedAttr;
46class Scope;
47
48class SemaOpenMP : public SemaBase {
49public:
50 SemaOpenMP(Sema &S);
51
52 friend class Parser;
53 friend class Sema;
54
56 using CapturedParamNameType = std::pair<StringRef, QualType>;
57
58 /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
59 /// context is "used as device code".
60 ///
61 /// - If CurContext is a `declare target` function or it is known that the
62 /// function is emitted for the device, emits the diagnostics immediately.
63 /// - If CurContext is a non-`declare target` function and we are compiling
64 /// for the device, creates a diagnostic which is emitted if and when we
65 /// realize that the function will be codegen'ed.
66 ///
67 /// Example usage:
68 ///
69 /// // Variable-length arrays are not allowed in NVPTX device code.
70 /// if (diagIfOpenMPDeviceCode(Loc, diag::err_vla_unsupported))
71 /// return ExprError();
72 /// // Otherwise, continue parsing as normal.
74 unsigned DiagID,
75 const FunctionDecl *FD);
76
77 /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
78 /// context is "used as host code".
79 ///
80 /// - If CurContext is a `declare target` function or it is known that the
81 /// function is emitted for the host, emits the diagnostics immediately.
82 /// - If CurContext is a non-host function, just ignore it.
83 ///
84 /// Example usage:
85 ///
86 /// // Variable-length arrays are not allowed in NVPTX device code.
87 /// if (diagIfOpenMPHostode(Loc, diag::err_vla_unsupported))
88 /// return ExprError();
89 /// // Otherwise, continue parsing as normal.
91 unsigned DiagID,
92 const FunctionDecl *FD);
93
94 /// The declarator \p D defines a function in the scope \p S which is nested
95 /// in an `omp begin/end declare variant` scope. In this method we create a
96 /// declaration for \p D and rename \p D according to the OpenMP context
97 /// selector of the surrounding scope. Return all base functions in \p Bases.
99 Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists,
101
102 /// Register \p D as specialization of all base functions in \p Bases in the
103 /// current `omp begin/end declare variant` scope.
106
107 /// Act on \p D, a function definition inside of an `omp [begin/end] assumes`.
109
110 /// Can we exit an OpenMP declare variant scope at the moment.
112 return !OMPDeclareVariantScopes.empty();
113 }
114
117 bool StrictlyPositive = true,
118 bool SuppressExprDiags = false);
119
120 /// Given the potential call expression \p Call, determine if there is a
121 /// specialization via the OpenMP declare variant mechanism available. If
122 /// there is, return the specialized call expression, otherwise return the
123 /// original \p Call.
125 SourceLocation LParenLoc, MultiExprArg ArgExprs,
126 SourceLocation RParenLoc, Expr *ExecConfig);
127
128 /// Handle a `omp begin declare variant`.
130
131 /// Handle a `omp end declare variant`.
133
134 /// Function tries to capture lambda's captured variables in the OpenMP region
135 /// before the original lambda is captured.
137
138 /// Return true if the provided declaration \a VD should be captured by
139 /// reference.
140 /// \param Level Relative level of nested OpenMP construct for that the check
141 /// is performed.
142 /// \param OpenMPCaptureLevel Capture level within an OpenMP construct.
143 bool isOpenMPCapturedByRef(const ValueDecl *D, unsigned Level,
144 unsigned OpenMPCaptureLevel) const;
145
146 /// Check if the specified variable is used in one of the private
147 /// clauses (private, firstprivate, lastprivate, reduction etc.) in OpenMP
148 /// constructs.
149 VarDecl *isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo = false,
150 unsigned StopAt = 0);
151
152 /// The member expression(this->fd) needs to be rebuilt in the template
153 /// instantiation to generate private copy for OpenMP when default
154 /// clause is used. The function will return true if default
155 /// cluse is used.
157
160
161 /// If the current region is a loop-based region, mark the start of the loop
162 /// construct.
163 void startOpenMPLoop();
164
165 /// If the current region is a range loop-based region, mark the start of the
166 /// loop construct.
168
169 /// Check if the specified variable is used in 'private' clause.
170 /// \param Level Relative level of nested OpenMP construct for that the check
171 /// is performed.
173 unsigned CapLevel) const;
174
175 /// Sets OpenMP capture kind (OMPC_private, OMPC_firstprivate, OMPC_map etc.)
176 /// for \p FD based on DSA for the provided corresponding captured declaration
177 /// \p D.
178 void setOpenMPCaptureKind(FieldDecl *FD, const ValueDecl *D, unsigned Level);
179
180 /// Check if the specified variable is captured by 'target' directive.
181 /// \param Level Relative level of nested OpenMP construct for that the check
182 /// is performed.
183 bool isOpenMPTargetCapturedDecl(const ValueDecl *D, unsigned Level,
184 unsigned CaptureLevel) const;
185
186 /// Check if the specified global variable must be captured by outer capture
187 /// regions.
188 /// \param Level Relative level of nested OpenMP construct for that
189 /// the check is performed.
190 bool isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level,
191 unsigned CaptureLevel) const;
192
194 Expr *Op);
195 /// Called on start of new data sharing attribute block.
197 const DeclarationNameInfo &DirName, Scope *CurScope,
199 /// Start analysis of clauses.
201 /// End analysis of clauses.
202 void EndOpenMPClause();
203 /// Called on end of data sharing attribute block.
204 void EndOpenMPDSABlock(Stmt *CurDirective);
205
206 /// Check if the current region is an OpenMP loop region and if it is,
207 /// mark loop control variable, used in \p Init for loop initialization, as
208 /// private by default.
209 /// \param Init First part of the for loop.
211
212 /// Called on well-formed '\#pragma omp metadirective' after parsing
213 /// of the associated statement.
215 Stmt *AStmt, SourceLocation StartLoc,
216 SourceLocation EndLoc);
217
218 // OpenMP directives and clauses.
219 /// Called on correct id-expression from the '#pragma omp
220 /// threadprivate'.
222 const DeclarationNameInfo &Id,
224 /// Called on well-formed '#pragma omp threadprivate'.
226 ArrayRef<Expr *> VarList);
227 /// Builds a new OpenMPThreadPrivateDecl and checks its correctness.
229 ArrayRef<Expr *> VarList);
230 /// Called on well-formed '#pragma omp allocate'.
232 ArrayRef<Expr *> VarList,
233 ArrayRef<OMPClause *> Clauses,
234 DeclContext *Owner = nullptr);
235
236 /// Called on well-formed '#pragma omp [begin] assume[s]'.
239 ArrayRef<std::string> Assumptions,
240 bool SkippedClauses);
241
242 /// Check if there is an active global `omp begin assumes` directive.
243 bool isInOpenMPAssumeScope() const { return !OMPAssumeScoped.empty(); }
244
245 /// Check if there is an active global `omp assumes` directive.
246 bool hasGlobalOpenMPAssumes() const { return !OMPAssumeGlobal.empty(); }
247
248 /// Called on well-formed '#pragma omp end assumes'.
250
251 /// Called on well-formed '#pragma omp requires'.
253 ArrayRef<OMPClause *> ClauseList);
254 /// Check restrictions on Requires directive
256 ArrayRef<OMPClause *> Clauses);
257 /// Check if the specified type is allowed to be used in 'omp declare
258 /// reduction' construct.
261 /// Called on start of '#pragma omp declare reduction'.
263 Scope *S, DeclContext *DC, DeclarationName Name,
264 ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
265 AccessSpecifier AS, Decl *PrevDeclInScope = nullptr);
266 /// Initialize declare reduction construct initializer.
268 /// Finish current declare reduction construct initializer.
270 /// Initialize declare reduction construct initializer.
271 /// \return omp_priv variable.
273 /// Finish current declare reduction construct initializer.
275 VarDecl *OmpPrivParm);
276 /// Called at the end of '#pragma omp declare reduction'.
278 Scope *S, DeclGroupPtrTy DeclReductions, bool IsValid);
279
280 /// Check variable declaration in 'omp declare mapper' construct.
282 /// Check if the specified type is allowed to be used in 'omp declare
283 /// mapper' construct.
286 /// Called for '#pragma omp declare mapper'.
288 Scope *S, DeclContext *DC, DeclarationName Name, QualType MapperType,
290 Expr *MapperVarRef, ArrayRef<OMPClause *> Clauses,
291 Decl *PrevDeclInScope = nullptr);
292 /// Build the mapper variable of '#pragma omp declare mapper'.
294 QualType MapperType,
295 SourceLocation StartLoc,
296 DeclarationName VN);
298 bool isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const;
300
302 struct MapInfo {
303 OMPDeclareTargetDeclAttr::MapTypeTy MT;
305 };
306 /// Explicitly listed variables and functions in a 'to' or 'link' clause.
307 llvm::DenseMap<NamedDecl *, MapInfo> ExplicitlyMapped;
308
309 /// The 'device_type' as parsed from the clause.
310 OMPDeclareTargetDeclAttr::DevTypeTy DT = OMPDeclareTargetDeclAttr::DT_Any;
311
312 /// The directive kind, `begin declare target` or `declare target`.
314
315 /// The directive with indirect clause.
316 std::optional<Expr *> Indirect;
317
318 /// The directive location.
320
322 : Kind(Kind), Loc(Loc) {}
323 };
324
325 /// Called on the start of target region i.e. '#pragma omp declare target'.
326 bool ActOnStartOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
327
328 /// Called at the end of target region i.e. '#pragma omp end declare target'.
329 const DeclareTargetContextInfo ActOnOpenMPEndDeclareTargetDirective();
330
331 /// Called once a target context is completed, that can be when a
332 /// '#pragma omp end declare target' was encountered or when a
333 /// '#pragma omp declare target' without declaration-definition-seq was
334 /// encountered.
335 void ActOnFinishedOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
336
337 /// Report unterminated 'omp declare target' or 'omp begin declare target' at
338 /// the end of a compilation unit.
340
341 /// Searches for the provided declaration name for OpenMP declare target
342 /// directive.
344 CXXScopeSpec &ScopeSpec,
345 const DeclarationNameInfo &Id);
346
347 /// Called on correct id-expression from the '#pragma omp declare target'.
349 OMPDeclareTargetDeclAttr::MapTypeTy MT,
350 DeclareTargetContextInfo &DTCI);
351
352 /// Check declaration inside target region.
353 void
356
357 /// Adds OMPDeclareTargetDeclAttr to referenced variables in declare target
358 /// directive.
360
361 /// Finishes analysis of the deferred functions calls that may be declared as
362 /// host/nohost during device/host compilation.
364 const FunctionDecl *Callee,
366
367 /// Return true if currently in OpenMP task with untied clause context.
368 bool isInOpenMPTaskUntiedContext() const;
369
370 /// Return true inside OpenMP declare target region.
372 return !DeclareTargetNesting.empty();
373 }
374 /// Return true inside OpenMP target region.
376
377 /// Return the number of captured regions created for an OpenMP directive.
379
380 /// Initialization of captured region for OpenMP region.
381 void ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope);
382
383 /// Called for syntactical loops (ForStmt or CXXForRangeStmt) associated to
384 /// an OpenMP loop directive.
386
387 /// Process a canonical OpenMP loop nest that can either be a canonical
388 /// literal loop (ForStmt or CXXForRangeStmt), or the generated loop of an
389 /// OpenMP loop transformation construct.
391
392 /// End of OpenMP region.
393 ///
394 /// \param S Statement associated with the current OpenMP region.
395 /// \param Clauses List of clauses for the current OpenMP region.
396 ///
397 /// \returns Statement for finished OpenMP region.
401 OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
402 Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc);
403 /// Process an OpenMP informational directive.
404 ///
405 /// \param Kind The directive kind.
406 /// \param DirName Declaration name info.
407 /// \param Clauses Array of clauses for directive.
408 /// \param AStmt The associated statement.
409 /// \param StartLoc The start location.
410 /// \param EndLoc The end location.
413 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
414 SourceLocation EndLoc);
415 /// Process an OpenMP assume directive.
416 ///
417 /// \param Clauses Array of clauses for directive.
418 /// \param AStmt The associated statement.
419 /// \param StartLoc The start location.
420 /// \param EndLoc The end location.
422 Stmt *AStmt, SourceLocation StartLoc,
423 SourceLocation EndLoc);
424
425 /// Called on well-formed '\#pragma omp parallel' after parsing
426 /// of the associated statement.
428 Stmt *AStmt, SourceLocation StartLoc,
429 SourceLocation EndLoc);
431 llvm::SmallDenseMap<const ValueDecl *, const Expr *, 4>;
432 /// Called on well-formed '\#pragma omp simd' after parsing
433 /// of the associated statement.
436 SourceLocation StartLoc, SourceLocation EndLoc,
437 VarsWithInheritedDSAType &VarsWithImplicitDSA);
438 /// Called on well-formed '#pragma omp tile' after parsing of its clauses and
439 /// the associated statement.
441 Stmt *AStmt, SourceLocation StartLoc,
442 SourceLocation EndLoc);
444 Stmt *AStmt, SourceLocation StartLoc,
445 SourceLocation EndLoc);
446 /// Called on well-formed '#pragma omp unroll' after parsing of its clauses
447 /// and the associated statement.
449 Stmt *AStmt, SourceLocation StartLoc,
450 SourceLocation EndLoc);
451 /// Called on well-formed '#pragma omp reverse'.
453 SourceLocation EndLoc);
454 /// Called on well-formed '#pragma omp interchange' after parsing of its
455 /// clauses and the associated statement.
457 Stmt *AStmt,
458 SourceLocation StartLoc,
459 SourceLocation EndLoc);
460 /// Called on well-formed '\#pragma omp for' after parsing
461 /// of the associated statement.
464 SourceLocation StartLoc, SourceLocation EndLoc,
465 VarsWithInheritedDSAType &VarsWithImplicitDSA);
466 /// Called on well-formed '\#pragma omp for simd' after parsing
467 /// of the associated statement.
470 SourceLocation StartLoc, SourceLocation EndLoc,
471 VarsWithInheritedDSAType &VarsWithImplicitDSA);
472 /// Called on well-formed '\#pragma omp sections' after parsing
473 /// of the associated statement.
475 Stmt *AStmt, SourceLocation StartLoc,
476 SourceLocation EndLoc);
477 /// Called on well-formed '\#pragma omp section' after parsing of the
478 /// associated statement.
480 SourceLocation EndLoc);
481 /// Called on well-formed '\#pragma omp scope' after parsing of the
482 /// associated statement.
484 Stmt *AStmt, SourceLocation StartLoc,
485 SourceLocation EndLoc);
486 /// Called on well-formed '\#pragma omp single' after parsing of the
487 /// associated statement.
489 Stmt *AStmt, SourceLocation StartLoc,
490 SourceLocation EndLoc);
491 /// Called on well-formed '\#pragma omp master' after parsing of the
492 /// associated statement.
494 SourceLocation EndLoc);
495 /// Called on well-formed '\#pragma omp critical' after parsing of the
496 /// associated statement.
498 ArrayRef<OMPClause *> Clauses,
499 Stmt *AStmt, SourceLocation StartLoc,
500 SourceLocation EndLoc);
501 /// Called on well-formed '\#pragma omp parallel for' after parsing
502 /// of the associated statement.
504 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
505 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
506 /// Called on well-formed '\#pragma omp parallel for simd' after
507 /// parsing of the associated statement.
509 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
510 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
511 /// Called on well-formed '\#pragma omp parallel master' after
512 /// parsing of the associated statement.
514 Stmt *AStmt,
515 SourceLocation StartLoc,
516 SourceLocation EndLoc);
517 /// Called on well-formed '\#pragma omp parallel masked' after
518 /// parsing of the associated statement.
520 Stmt *AStmt,
521 SourceLocation StartLoc,
522 SourceLocation EndLoc);
523 /// Called on well-formed '\#pragma omp parallel sections' after
524 /// parsing of the associated statement.
526 Stmt *AStmt,
527 SourceLocation StartLoc,
528 SourceLocation EndLoc);
529 /// Called on well-formed '\#pragma omp task' after parsing of the
530 /// associated statement.
532 Stmt *AStmt, SourceLocation StartLoc,
533 SourceLocation EndLoc);
534 /// Called on well-formed '\#pragma omp taskyield'.
536 SourceLocation EndLoc);
537 /// Called on well-formed '\#pragma omp error'.
538 /// Error direcitive is allowed in both declared and excutable contexts.
539 /// Adding InExContext to identify which context is called from.
541 SourceLocation StartLoc,
542 SourceLocation EndLoc,
543 bool InExContext = true);
544 /// Called on well-formed '\#pragma omp barrier'.
546 SourceLocation EndLoc);
547 /// Called on well-formed '\#pragma omp taskwait'.
549 SourceLocation StartLoc,
550 SourceLocation EndLoc);
551 /// Called on well-formed '\#pragma omp taskgroup'.
553 Stmt *AStmt, SourceLocation StartLoc,
554 SourceLocation EndLoc);
555 /// Called on well-formed '\#pragma omp flush'.
557 SourceLocation StartLoc,
558 SourceLocation EndLoc);
559 /// Called on well-formed '\#pragma omp depobj'.
561 SourceLocation StartLoc,
562 SourceLocation EndLoc);
563 /// Called on well-formed '\#pragma omp scan'.
565 SourceLocation StartLoc,
566 SourceLocation EndLoc);
567 /// Called on well-formed '\#pragma omp ordered' after parsing of the
568 /// associated statement.
570 Stmt *AStmt, SourceLocation StartLoc,
571 SourceLocation EndLoc);
572 /// Called on well-formed '\#pragma omp atomic' after parsing of the
573 /// associated statement.
575 Stmt *AStmt, SourceLocation StartLoc,
576 SourceLocation EndLoc);
577 /// Called on well-formed '\#pragma omp target' after parsing of the
578 /// associated statement.
580 Stmt *AStmt, SourceLocation StartLoc,
581 SourceLocation EndLoc);
582 /// Called on well-formed '\#pragma omp target data' after parsing of
583 /// the associated statement.
585 Stmt *AStmt,
586 SourceLocation StartLoc,
587 SourceLocation EndLoc);
588 /// Called on well-formed '\#pragma omp target enter data' after
589 /// parsing of the associated statement.
591 SourceLocation StartLoc,
592 SourceLocation EndLoc,
593 Stmt *AStmt);
594 /// Called on well-formed '\#pragma omp target exit data' after
595 /// parsing of the associated statement.
597 SourceLocation StartLoc,
598 SourceLocation EndLoc,
599 Stmt *AStmt);
600 /// Called on well-formed '\#pragma omp target parallel' after
601 /// parsing of the associated statement.
603 Stmt *AStmt,
604 SourceLocation StartLoc,
605 SourceLocation EndLoc);
606 /// Called on well-formed '\#pragma omp target parallel for' after
607 /// parsing of the associated statement.
609 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
610 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
611 /// Called on well-formed '\#pragma omp teams' after parsing of the
612 /// associated statement.
614 Stmt *AStmt, SourceLocation StartLoc,
615 SourceLocation EndLoc);
616 /// Called on well-formed '\#pragma omp teams loop' after parsing of the
617 /// associated statement.
619 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
620 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
621 /// Called on well-formed '\#pragma omp target teams loop' after parsing of
622 /// the associated statement.
624 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
625 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
626 /// Called on well-formed '\#pragma omp parallel loop' after parsing of the
627 /// associated statement.
629 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
630 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
631 /// Called on well-formed '\#pragma omp target parallel loop' after parsing
632 /// of the associated statement.
634 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
635 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
636 /// Called on well-formed '\#pragma omp cancellation point'.
639 SourceLocation EndLoc,
640 OpenMPDirectiveKind CancelRegion);
641 /// Called on well-formed '\#pragma omp cancel'.
643 SourceLocation StartLoc,
644 SourceLocation EndLoc,
645 OpenMPDirectiveKind CancelRegion);
646 /// Called on well-formed '\#pragma omp taskloop' after parsing of the
647 /// associated statement.
650 SourceLocation StartLoc, SourceLocation EndLoc,
651 VarsWithInheritedDSAType &VarsWithImplicitDSA);
652 /// Called on well-formed '\#pragma omp taskloop simd' after parsing of
653 /// the associated statement.
655 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
656 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
657 /// Called on well-formed '\#pragma omp master taskloop' after parsing of the
658 /// associated statement.
660 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
661 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
662 /// Called on well-formed '\#pragma omp master taskloop simd' after parsing of
663 /// the associated statement.
665 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
666 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
667 /// Called on well-formed '\#pragma omp parallel master taskloop' after
668 /// parsing of the associated statement.
670 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
671 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
672 /// Called on well-formed '\#pragma omp parallel master taskloop simd' after
673 /// parsing of the associated statement.
675 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
676 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
677 /// Called on well-formed '\#pragma omp masked taskloop' after parsing of the
678 /// associated statement.
680 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
681 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
682 /// Called on well-formed '\#pragma omp masked taskloop simd' after parsing of
683 /// the associated statement.
685 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
686 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
687 /// Called on well-formed '\#pragma omp parallel masked taskloop' after
688 /// parsing of the associated statement.
690 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
691 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
692 /// Called on well-formed '\#pragma omp parallel masked taskloop simd' after
693 /// parsing of the associated statement.
695 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
696 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
697 /// Called on well-formed '\#pragma omp distribute' after parsing
698 /// of the associated statement.
701 SourceLocation StartLoc, SourceLocation EndLoc,
702 VarsWithInheritedDSAType &VarsWithImplicitDSA);
703 /// Called on well-formed '\#pragma omp target update'.
705 SourceLocation StartLoc,
706 SourceLocation EndLoc,
707 Stmt *AStmt);
708 /// Called on well-formed '\#pragma omp distribute parallel for' after
709 /// parsing of the associated statement.
711 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
712 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
713 /// Called on well-formed '\#pragma omp distribute parallel for simd'
714 /// after 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 distribute 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 target parallel for simd' after
724 /// parsing of the associated statement.
726 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
727 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
728 /// Called on well-formed '\#pragma omp target simd' after parsing of
729 /// the associated statement.
732 SourceLocation StartLoc, SourceLocation EndLoc,
733 VarsWithInheritedDSAType &VarsWithImplicitDSA);
734 /// Called on well-formed '\#pragma omp teams distribute' after parsing of
735 /// the associated statement.
737 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
738 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
739 /// Called on well-formed '\#pragma omp teams distribute simd' after parsing
740 /// of the associated statement.
742 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
743 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
744 /// Called on well-formed '\#pragma omp teams distribute parallel for simd'
745 /// after 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 teams distribute parallel for'
750 /// after 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 teams' after parsing of the
755 /// associated statement.
757 Stmt *AStmt,
758 SourceLocation StartLoc,
759 SourceLocation EndLoc);
760 /// Called on well-formed '\#pragma omp target teams distribute' after parsing
761 /// of the associated statement.
763 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
764 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
765 /// Called on well-formed '\#pragma omp target teams distribute parallel for'
766 /// after parsing of the associated statement.
768 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
769 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
770 /// Called on well-formed '\#pragma omp target teams distribute parallel for
771 /// simd' 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 target teams distribute simd' after
776 /// 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 interop'.
782 SourceLocation StartLoc,
783 SourceLocation EndLoc);
784 /// Called on well-formed '\#pragma omp dispatch' after parsing of the
785 // /associated statement.
787 Stmt *AStmt, SourceLocation StartLoc,
788 SourceLocation EndLoc);
789 /// Called on well-formed '\#pragma omp masked' after parsing of the
790 // /associated statement.
792 Stmt *AStmt, SourceLocation StartLoc,
793 SourceLocation EndLoc);
794
795 /// Called on well-formed '\#pragma omp loop' after parsing of the
796 /// associated statement.
798 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
799 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
800
801 /// Checks correctness of linear modifiers.
803 SourceLocation LinLoc);
804 /// Checks that the specified declaration matches requirements for the linear
805 /// decls.
808 bool IsDeclareSimd = false);
809
810 /// Called on well-formed '\#pragma omp declare simd' after parsing of
811 /// the associated method/function.
813 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
814 Expr *Simdlen, ArrayRef<Expr *> Uniforms, ArrayRef<Expr *> Aligneds,
815 ArrayRef<Expr *> Alignments, ArrayRef<Expr *> Linears,
816 ArrayRef<unsigned> LinModifiers, ArrayRef<Expr *> Steps, SourceRange SR);
817
818 /// Checks '\#pragma omp declare variant' variant function and original
819 /// functions after parsing of the associated method/function.
820 /// \param DG Function declaration to which declare variant directive is
821 /// applied to.
822 /// \param VariantRef Expression that references the variant function, which
823 /// must be used instead of the original one, specified in \p DG.
824 /// \param TI The trait info object representing the match clause.
825 /// \param NumAppendArgs The number of omp_interop_t arguments to account for
826 /// in checking.
827 /// \returns std::nullopt, if the function/variant function are not compatible
828 /// with the pragma, pair of original function/variant ref expression
829 /// otherwise.
830 std::optional<std::pair<FunctionDecl *, Expr *>>
832 OMPTraitInfo &TI, unsigned NumAppendArgs,
833 SourceRange SR);
834
835 /// Called on well-formed '\#pragma omp declare variant' after parsing of
836 /// the associated method/function.
837 /// \param FD Function declaration to which declare variant directive is
838 /// applied to.
839 /// \param VariantRef Expression that references the variant function, which
840 /// must be used instead of the original one, specified in \p DG.
841 /// \param TI The context traits associated with the function variant.
842 /// \param AdjustArgsNothing The list of 'nothing' arguments.
843 /// \param AdjustArgsNeedDevicePtr The list of 'need_device_ptr' arguments.
844 /// \param AppendArgs The list of 'append_args' arguments.
845 /// \param AdjustArgsLoc The Location of an 'adjust_args' clause.
846 /// \param AppendArgsLoc The Location of an 'append_args' clause.
847 /// \param SR The SourceRange of the 'declare variant' directive.
849 FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI,
850 ArrayRef<Expr *> AdjustArgsNothing,
851 ArrayRef<Expr *> AdjustArgsNeedDevicePtr,
852 ArrayRef<Expr *> AdjustArgsNeedDeviceAddr,
853 ArrayRef<OMPInteropInfo> AppendArgs, SourceLocation AdjustArgsLoc,
854 SourceLocation AppendArgsLoc, SourceRange SR);
855
856 /// Called on device_num selector in context selectors.
857 void ActOnOpenMPDeviceNum(Expr *DeviceNumExpr);
858
860 SourceLocation StartLoc,
861 SourceLocation LParenLoc,
862 SourceLocation EndLoc);
863 /// Called on well-formed 'allocator' clause.
865 SourceLocation StartLoc,
866 SourceLocation LParenLoc,
867 SourceLocation EndLoc);
868 /// Called on well-formed 'if' clause.
870 Expr *Condition, SourceLocation StartLoc,
871 SourceLocation LParenLoc,
872 SourceLocation NameModifierLoc,
873 SourceLocation ColonLoc,
874 SourceLocation EndLoc);
875 /// Called on well-formed 'final' clause.
877 SourceLocation LParenLoc,
878 SourceLocation EndLoc);
879 /// Called on well-formed 'num_threads' clause.
881 OpenMPNumThreadsClauseModifier Modifier, Expr *NumThreads,
882 SourceLocation StartLoc, SourceLocation LParenLoc,
883 SourceLocation ModifierLoc, SourceLocation EndLoc);
884 /// Called on well-formed 'align' clause.
886 SourceLocation LParenLoc,
887 SourceLocation EndLoc);
888 /// Called on well-formed 'safelen' clause.
890 SourceLocation LParenLoc,
891 SourceLocation EndLoc);
892 /// Called on well-formed 'simdlen' clause.
894 SourceLocation LParenLoc,
895 SourceLocation EndLoc);
896 /// Called on well-form 'sizes' clause.
898 SourceLocation StartLoc,
899 SourceLocation LParenLoc,
900 SourceLocation EndLoc);
901 /// Called on well-form 'permutation' clause after parsing its arguments.
903 SourceLocation StartLoc,
904 SourceLocation LParenLoc,
905 SourceLocation EndLoc);
906 /// Called on well-form 'full' clauses.
908 SourceLocation EndLoc);
909 /// Called on well-form 'partial' clauses.
911 SourceLocation LParenLoc,
912 SourceLocation EndLoc);
913 /// Called on well-formed 'collapse' clause.
915 SourceLocation StartLoc,
916 SourceLocation LParenLoc,
917 SourceLocation EndLoc);
918 /// Called on well-formed 'ordered' clause.
919 OMPClause *
921 SourceLocation LParenLoc = SourceLocation(),
922 Expr *NumForLoops = nullptr);
923 /// Called on well-formed 'grainsize' clause.
925 Expr *Size, SourceLocation StartLoc,
926 SourceLocation LParenLoc,
927 SourceLocation ModifierLoc,
928 SourceLocation EndLoc);
929 /// Called on well-formed 'num_tasks' clause.
931 Expr *NumTasks, SourceLocation StartLoc,
932 SourceLocation LParenLoc,
933 SourceLocation ModifierLoc,
934 SourceLocation EndLoc);
935 /// Called on well-formed 'hint' clause.
937 SourceLocation LParenLoc,
938 SourceLocation EndLoc);
939 /// Called on well-formed 'detach' clause.
941 SourceLocation LParenLoc,
942 SourceLocation EndLoc);
943
945 SourceLocation ArgumentLoc,
946 SourceLocation StartLoc,
947 SourceLocation LParenLoc,
948 SourceLocation EndLoc);
949 /// Called on well-formed 'when' clause.
951 SourceLocation LParenLoc,
952 SourceLocation EndLoc);
953 /// Called on well-formed 'default' clause.
954 OMPClause *ActOnOpenMPDefaultClause(llvm::omp::DefaultKind Kind,
955 SourceLocation KindLoc,
956 SourceLocation StartLoc,
957 SourceLocation LParenLoc,
958 SourceLocation EndLoc);
959 /// Called on well-formed 'proc_bind' clause.
960 OMPClause *ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind,
961 SourceLocation KindLoc,
962 SourceLocation StartLoc,
963 SourceLocation LParenLoc,
964 SourceLocation EndLoc);
965 /// Called on well-formed 'order' clause.
968 SourceLocation StartLoc,
969 SourceLocation LParenLoc,
970 SourceLocation MLoc, SourceLocation KindLoc,
971 SourceLocation EndLoc);
972 /// Called on well-formed 'update' clause.
974 SourceLocation KindLoc,
975 SourceLocation StartLoc,
976 SourceLocation LParenLoc,
977 SourceLocation EndLoc);
978 /// Called on well-formed 'holds' clause.
980 SourceLocation LParenLoc,
981 SourceLocation EndLoc);
982 /// Called on well-formed 'absent' or 'contains' clauses.
988 SourceLocation RLoc);
989
992 SourceLocation StartLoc, SourceLocation LParenLoc,
993 ArrayRef<SourceLocation> ArgumentsLoc, SourceLocation DelimLoc,
994 SourceLocation EndLoc);
995 /// Called on well-formed 'schedule' clause.
998 OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc,
999 SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc,
1000 SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc);
1001
1003 SourceLocation EndLoc);
1004 /// Called on well-formed 'nowait' clause.
1006 SourceLocation EndLoc);
1007 /// Called on well-formed 'untied' clause.
1009 SourceLocation EndLoc);
1010 /// Called on well-formed 'mergeable' clause.
1012 SourceLocation EndLoc);
1013 /// Called on well-formed 'read' clause.
1015 SourceLocation EndLoc);
1016 /// Called on well-formed 'write' clause.
1018 SourceLocation EndLoc);
1019 /// Called on well-formed 'update' clause.
1021 SourceLocation EndLoc);
1022 /// Called on well-formed 'capture' clause.
1024 SourceLocation EndLoc);
1025 /// Called on well-formed 'compare' clause.
1027 SourceLocation EndLoc);
1028 /// Called on well-formed 'fail' clause.
1030 SourceLocation EndLoc);
1032 SourceLocation KindLoc,
1033 SourceLocation StartLoc,
1034 SourceLocation LParenLoc,
1035 SourceLocation EndLoc);
1036
1037 /// Called on well-formed 'seq_cst' clause.
1039 SourceLocation EndLoc);
1040 /// Called on well-formed 'acq_rel' clause.
1042 SourceLocation EndLoc);
1043 /// Called on well-formed 'acquire' clause.
1045 SourceLocation EndLoc);
1046 /// Called on well-formed 'release' clause.
1048 SourceLocation EndLoc);
1049 /// Called on well-formed 'relaxed' clause.
1051 SourceLocation EndLoc);
1052 /// Called on well-formed 'weak' clause.
1054 SourceLocation EndLoc);
1055
1056 /// Called on well-formed 'init' clause.
1057 OMPClause *
1058 ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo,
1059 SourceLocation StartLoc, SourceLocation LParenLoc,
1060 SourceLocation VarLoc, SourceLocation EndLoc);
1061
1062 /// Called on well-formed 'use' clause.
1063 OMPClause *ActOnOpenMPUseClause(Expr *InteropVar, SourceLocation StartLoc,
1064 SourceLocation LParenLoc,
1065 SourceLocation VarLoc, SourceLocation EndLoc);
1066
1067 /// Called on well-formed 'destroy' clause.
1069 SourceLocation LParenLoc,
1070 SourceLocation VarLoc,
1071 SourceLocation EndLoc);
1072 /// Called on well-formed 'novariants' clause.
1074 SourceLocation StartLoc,
1075 SourceLocation LParenLoc,
1076 SourceLocation EndLoc);
1077 /// Called on well-formed 'nocontext' clause.
1079 SourceLocation StartLoc,
1080 SourceLocation LParenLoc,
1081 SourceLocation EndLoc);
1082 /// Called on well-formed 'filter' clause.
1084 SourceLocation LParenLoc,
1085 SourceLocation EndLoc);
1086 /// Called on well-formed 'threads' clause.
1088 SourceLocation EndLoc);
1089 /// Called on well-formed 'simd' clause.
1091 SourceLocation EndLoc);
1092 /// Called on well-formed 'nogroup' clause.
1094 SourceLocation EndLoc);
1095 /// Called on well-formed 'unified_address' clause.
1097 SourceLocation EndLoc);
1098
1099 /// Called on well-formed 'unified_address' clause.
1101 SourceLocation EndLoc);
1102
1103 /// Called on well-formed 'reverse_offload' clause.
1105 SourceLocation EndLoc);
1106
1107 /// Called on well-formed 'dynamic_allocators' clause.
1109 SourceLocation EndLoc);
1110
1111 /// Called on well-formed 'atomic_default_mem_order' clause.
1114 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1115
1116 /// Called on well-formed 'self_maps' clause.
1118 SourceLocation EndLoc);
1119
1120 /// Called on well-formed 'at' clause.
1122 SourceLocation KindLoc,
1123 SourceLocation StartLoc,
1124 SourceLocation LParenLoc,
1125 SourceLocation EndLoc);
1126
1127 /// Called on well-formed 'severity' clause.
1129 SourceLocation KindLoc,
1130 SourceLocation StartLoc,
1131 SourceLocation LParenLoc,
1132 SourceLocation EndLoc);
1133
1134 /// Called on well-formed 'message' clause.
1135 /// passing string for message.
1137 SourceLocation LParenLoc,
1138 SourceLocation EndLoc);
1139
1140 /// Data used for processing a list of variables in OpenMP clauses.
1141 struct OpenMPVarListDataTy final {
1143 Expr *IteratorExpr = nullptr;
1148 int ExtraModifier = -1; ///< Additional modifier for linear, map, depend or
1149 ///< lastprivate clause.
1150 int OriginalSharingModifier = 0; // Default is shared
1158 bool IsMapTypeImplicit = false;
1163 StepModifierLoc; /// 'step' modifier location for linear clause
1175 };
1176 };
1177
1179 ArrayRef<Expr *> Vars,
1180 const OMPVarListLocTy &Locs,
1181 OpenMPVarListDataTy &Data);
1182 /// Called on well-formed 'inclusive' clause.
1184 SourceLocation StartLoc,
1185 SourceLocation LParenLoc,
1186 SourceLocation EndLoc);
1187 /// Called on well-formed 'exclusive' clause.
1189 SourceLocation StartLoc,
1190 SourceLocation LParenLoc,
1191 SourceLocation EndLoc);
1192 /// Called on well-formed 'allocate' clause.
1193 OMPClause *
1194 ActOnOpenMPAllocateClause(Expr *Allocator, Expr *Alignment,
1195 OpenMPAllocateClauseModifier FirstModifier,
1196 SourceLocation FirstModifierLoc,
1197 OpenMPAllocateClauseModifier SecondModifier,
1198 SourceLocation SecondModifierLoc,
1199 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1200 SourceLocation ColonLoc, SourceLocation LParenLoc,
1201 SourceLocation EndLoc);
1202 /// Called on well-formed 'private' clause.
1204 SourceLocation StartLoc,
1205 SourceLocation LParenLoc,
1206 SourceLocation EndLoc);
1207 /// Called on well-formed 'firstprivate' clause.
1209 SourceLocation StartLoc,
1210 SourceLocation LParenLoc,
1211 SourceLocation EndLoc);
1212 /// Called on well-formed 'lastprivate' clause.
1215 SourceLocation LPKindLoc, SourceLocation ColonLoc,
1216 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1217 /// Called on well-formed 'shared' clause.
1219 SourceLocation StartLoc,
1220 SourceLocation LParenLoc,
1221 SourceLocation EndLoc);
1222 /// Called on well-formed 'reduction' clause.
1224 ArrayRef<Expr *> VarList,
1225 OpenMPVarListDataTy::OpenMPReductionClauseModifiers Modifiers,
1226 SourceLocation StartLoc, SourceLocation LParenLoc,
1227 SourceLocation ModifierLoc, SourceLocation ColonLoc,
1228 SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec,
1229 const DeclarationNameInfo &ReductionId,
1230 ArrayRef<Expr *> UnresolvedReductions = {});
1231 /// Called on well-formed 'task_reduction' clause.
1233 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1234 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1235 CXXScopeSpec &ReductionIdScopeSpec,
1236 const DeclarationNameInfo &ReductionId,
1237 ArrayRef<Expr *> UnresolvedReductions = {});
1238 /// Called on well-formed 'in_reduction' clause.
1240 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1241 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1242 CXXScopeSpec &ReductionIdScopeSpec,
1243 const DeclarationNameInfo &ReductionId,
1244 ArrayRef<Expr *> UnresolvedReductions = {});
1245 /// Called on well-formed 'linear' clause.
1246 OMPClause *ActOnOpenMPLinearClause(
1247 ArrayRef<Expr *> VarList, Expr *Step, SourceLocation StartLoc,
1248 SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind,
1249 SourceLocation LinLoc, SourceLocation ColonLoc,
1250 SourceLocation StepModifierLoc, SourceLocation EndLoc);
1251 /// Called on well-formed 'aligned' clause.
1252 OMPClause *ActOnOpenMPAlignedClause(ArrayRef<Expr *> VarList, Expr *Alignment,
1253 SourceLocation StartLoc,
1254 SourceLocation LParenLoc,
1255 SourceLocation ColonLoc,
1256 SourceLocation EndLoc);
1257 /// Called on well-formed 'copyin' clause.
1258 OMPClause *ActOnOpenMPCopyinClause(ArrayRef<Expr *> VarList,
1259 SourceLocation StartLoc,
1260 SourceLocation LParenLoc,
1261 SourceLocation EndLoc);
1262 /// Called on well-formed 'copyprivate' clause.
1263 OMPClause *ActOnOpenMPCopyprivateClause(ArrayRef<Expr *> VarList,
1264 SourceLocation StartLoc,
1265 SourceLocation LParenLoc,
1266 SourceLocation EndLoc);
1267 /// Called on well-formed 'flush' pseudo clause.
1268 OMPClause *ActOnOpenMPFlushClause(ArrayRef<Expr *> VarList,
1269 SourceLocation StartLoc,
1270 SourceLocation LParenLoc,
1271 SourceLocation EndLoc);
1272 /// Called on well-formed 'depobj' pseudo clause.
1273 OMPClause *ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc,
1274 SourceLocation LParenLoc,
1275 SourceLocation EndLoc);
1276 /// Called on well-formed 'depend' clause.
1277 OMPClause *ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data,
1278 Expr *DepModifier,
1279 ArrayRef<Expr *> VarList,
1280 SourceLocation StartLoc,
1281 SourceLocation LParenLoc,
1282 SourceLocation EndLoc);
1283 /// Called on well-formed 'device' clause.
1285 Expr *Device, SourceLocation StartLoc,
1286 SourceLocation LParenLoc,
1287 SourceLocation ModifierLoc,
1288 SourceLocation EndLoc);
1289 /// Called on well-formed 'map' clause.
1290 OMPClause *ActOnOpenMPMapClause(
1291 Expr *IteratorModifier, ArrayRef<OpenMPMapModifierKind> MapTypeModifiers,
1292 ArrayRef<SourceLocation> MapTypeModifiersLoc,
1293 CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
1294 OpenMPMapClauseKind MapType, bool IsMapTypeImplicit,
1295 SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
1296 const OMPVarListLocTy &Locs, bool NoDiagnose = false,
1297 ArrayRef<Expr *> UnresolvedMappers = {});
1298 /// Called on well-formed 'num_teams' clause.
1299 OMPClause *ActOnOpenMPNumTeamsClause(ArrayRef<Expr *> VarList,
1300 SourceLocation StartLoc,
1301 SourceLocation LParenLoc,
1302 SourceLocation EndLoc);
1303 /// Called on well-formed 'thread_limit' clause.
1304 OMPClause *ActOnOpenMPThreadLimitClause(ArrayRef<Expr *> VarList,
1305 SourceLocation StartLoc,
1306 SourceLocation LParenLoc,
1307 SourceLocation EndLoc);
1308 /// Called on well-formed 'priority' clause.
1309 OMPClause *ActOnOpenMPPriorityClause(Expr *Priority, SourceLocation StartLoc,
1310 SourceLocation LParenLoc,
1311 SourceLocation EndLoc);
1312 /// Called on well-formed 'dist_schedule' clause.
1314 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
1315 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc,
1316 SourceLocation CommaLoc, SourceLocation EndLoc);
1317 /// Called on well-formed 'defaultmap' clause.
1318 OMPClause *ActOnOpenMPDefaultmapClause(
1320 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc,
1321 SourceLocation KindLoc, SourceLocation EndLoc);
1322 /// Called on well-formed 'to' clause.
1323 OMPClause *
1324 ActOnOpenMPToClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1325 ArrayRef<SourceLocation> MotionModifiersLoc,
1326 CXXScopeSpec &MapperIdScopeSpec,
1327 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1328 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1329 ArrayRef<Expr *> UnresolvedMappers = {});
1330 /// Called on well-formed 'from' clause.
1331 OMPClause *
1332 ActOnOpenMPFromClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1333 ArrayRef<SourceLocation> MotionModifiersLoc,
1334 CXXScopeSpec &MapperIdScopeSpec,
1335 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1336 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1337 ArrayRef<Expr *> UnresolvedMappers = {});
1338 /// Called on well-formed 'use_device_ptr' clause.
1339 OMPClause *ActOnOpenMPUseDevicePtrClause(ArrayRef<Expr *> VarList,
1340 const OMPVarListLocTy &Locs);
1341 /// Called on well-formed 'use_device_addr' clause.
1342 OMPClause *ActOnOpenMPUseDeviceAddrClause(ArrayRef<Expr *> VarList,
1343 const OMPVarListLocTy &Locs);
1344 /// Called on well-formed 'is_device_ptr' clause.
1345 OMPClause *ActOnOpenMPIsDevicePtrClause(ArrayRef<Expr *> VarList,
1346 const OMPVarListLocTy &Locs);
1347 /// Called on well-formed 'has_device_addr' clause.
1348 OMPClause *ActOnOpenMPHasDeviceAddrClause(ArrayRef<Expr *> VarList,
1349 const OMPVarListLocTy &Locs);
1350 /// Called on well-formed 'nontemporal' clause.
1351 OMPClause *ActOnOpenMPNontemporalClause(ArrayRef<Expr *> VarList,
1352 SourceLocation StartLoc,
1353 SourceLocation LParenLoc,
1354 SourceLocation EndLoc);
1355
1356 /// Data for list of allocators.
1358 /// Allocator.
1359 Expr *Allocator = nullptr;
1360 /// Allocator traits.
1362 /// Locations of '(' and ')' symbols.
1364 };
1365 /// Called on well-formed 'uses_allocators' clause.
1367 SourceLocation LParenLoc,
1368 SourceLocation EndLoc,
1370 /// Called on well-formed 'affinity' clause.
1372 SourceLocation LParenLoc,
1373 SourceLocation ColonLoc,
1374 SourceLocation EndLoc, Expr *Modifier,
1375 ArrayRef<Expr *> Locators);
1376 /// Called on a well-formed 'bind' clause.
1378 SourceLocation KindLoc,
1379 SourceLocation StartLoc,
1380 SourceLocation LParenLoc,
1381 SourceLocation EndLoc);
1382
1383 /// Called on a well-formed 'ompx_dyn_cgroup_mem' clause.
1385 SourceLocation LParenLoc,
1386 SourceLocation EndLoc);
1387
1388 /// Called on well-formed 'doacross' clause.
1389 OMPClause *
1391 SourceLocation DepLoc, SourceLocation ColonLoc,
1392 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1393 SourceLocation LParenLoc, SourceLocation EndLoc);
1394
1395 /// Called on a well-formed 'ompx_attribute' clause.
1397 SourceLocation StartLoc,
1398 SourceLocation LParenLoc,
1399 SourceLocation EndLoc);
1400
1401 /// Called on a well-formed 'ompx_bare' clause.
1403 SourceLocation EndLoc);
1404
1406 Expr *LowerBound,
1407 SourceLocation ColonLocFirst,
1408 SourceLocation ColonLocSecond,
1409 Expr *Length, Expr *Stride,
1410 SourceLocation RBLoc);
1412 SourceLocation RParenLoc,
1413 ArrayRef<Expr *> Dims,
1414 ArrayRef<SourceRange> Brackets);
1415
1416 /// Data structure for iterator expression.
1425 };
1426
1428 SourceLocation LLoc, SourceLocation RLoc,
1430
1431 void handleOMPAssumeAttr(Decl *D, const ParsedAttr &AL);
1432
1433 /// Setter and getter functions for device_num.
1434 void setOpenMPDeviceNum(int Num);
1435
1436 int getOpenMPDeviceNum() const;
1437
1438 void setOpenMPDeviceNumID(StringRef ID);
1439
1440private:
1441 void *VarDataSharingAttributesStack;
1442
1443 /// Number of nested '#pragma omp declare target' directives.
1444 SmallVector<DeclareTargetContextInfo, 4> DeclareTargetNesting;
1445
1446 /// Initialization of data-sharing attributes stack.
1447 void InitDataSharingAttributesStack();
1448 void DestroyDataSharingAttributesStack();
1449
1450 /// Returns OpenMP nesting level for current directive.
1451 unsigned getOpenMPNestingLevel() const;
1452
1453 /// Adjusts the function scopes index for the target-based regions.
1454 void adjustOpenMPTargetScopeIndex(unsigned &FunctionScopesIndex,
1455 unsigned Level) const;
1456
1457 /// Returns the number of scopes associated with the construct on the given
1458 /// OpenMP level.
1459 int getNumberOfConstructScopes(unsigned Level) const;
1460
1461 /// Push new OpenMP function region for non-capturing function.
1462 void pushOpenMPFunctionRegion();
1463
1464 /// Pop OpenMP function region for non-capturing function.
1465 void popOpenMPFunctionRegion(const sema::FunctionScopeInfo *OldFSI);
1466
1467 /// Analyzes and checks a loop nest for use by a loop transformation.
1468 ///
1469 /// \param Kind The loop transformation directive kind.
1470 /// \param NumLoops How many nested loops the directive is expecting.
1471 /// \param AStmt Associated statement of the transformation directive.
1472 /// \param LoopHelpers [out] The loop analysis result.
1473 /// \param Body [out] The body code nested in \p NumLoops loop.
1474 /// \param OriginalInits [out] Collection of statements and declarations that
1475 /// must have been executed/declared before entering the
1476 /// loop.
1477 ///
1478 /// \return Whether there was any error.
1479 bool checkTransformableLoopNest(
1480 OpenMPDirectiveKind Kind, Stmt *AStmt, int NumLoops,
1482 Stmt *&Body, SmallVectorImpl<SmallVector<Stmt *, 0>> &OriginalInits);
1483
1484 /// Helper to keep information about the current `omp begin/end declare
1485 /// variant` nesting.
1486 struct OMPDeclareVariantScope {
1487 /// The associated OpenMP context selector.
1488 OMPTraitInfo *TI;
1489
1490 /// The associated OpenMP context selector mangling.
1491 std::string NameSuffix;
1492
1493 OMPDeclareVariantScope(OMPTraitInfo &TI);
1494 };
1495
1496 /// Return the OMPTraitInfo for the surrounding scope, if any.
1497 OMPTraitInfo *getOMPTraitInfoForSurroundingScope() {
1498 return OMPDeclareVariantScopes.empty() ? nullptr
1499 : OMPDeclareVariantScopes.back().TI;
1500 }
1501
1502 /// The current `omp begin/end declare variant` scopes.
1503 SmallVector<OMPDeclareVariantScope, 4> OMPDeclareVariantScopes;
1504
1505 /// The current `omp begin/end assumes` scopes.
1506 SmallVector<OMPAssumeAttr *, 4> OMPAssumeScoped;
1507
1508 /// All `omp assumes` we encountered so far.
1509 SmallVector<OMPAssumeAttr *, 4> OMPAssumeGlobal;
1510
1511 /// Device number specified by the context selector.
1512 int DeviceNum = -1;
1513
1514 /// Device number identifier specified by the context selector.
1515 StringRef DeviceNumID;
1516};
1517
1518} // namespace clang
1519
1520#endif // LLVM_CLANG_SEMA_SEMAOPENMP_H
#define V(N, I)
Definition: ASTContext.h:3597
Forward declaration of all AST node types.
static char ID
Definition: Arena.cpp:183
const Decl * D
enum clang::sema::@1840::IndirectLocalPathEntry::EntryKind Kind
Expr * E
int Priority
Definition: Format.cpp:3181
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.
uint32_t Id
Definition: SemaARM.cpp:1179
SourceLocation Loc
Definition: SemaObjC.cpp:754
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:73
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1449
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:1874
This represents one expression.
Definition: Expr.h:112
Represents a member of a struct/union/class.
Definition: Decl.h:3157
Represents a function declaration or definition.
Definition: Decl.h:1999
One of these records is kept for each identifier that is lexed.
This represents a decl that may have a name.
Definition: Decl.h:273
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:55
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:417
This represents '#pragma omp threadprivate ...' directive.
Definition: DeclOpenMP.h:110
Helper data structure representing the traits in a match clause of an declare variant or metadirectiv...
Wrapper for void* pointer.
Definition: Ownership.h:51
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:119
Parser - This implements a parser for the C family of languages.
Definition: Parser.h:171
A (possibly-)qualified type.
Definition: TypeBase.h:937
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
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 * 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...
OMPClause * ActOnOpenMPDefaultClause(llvm::omp::DefaultKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'default' clause.
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 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.
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.
void ActOnFinishedOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI)
Called once a target context is completed, that can be when a '#pragma omp end declare target' was en...
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...
OMPClause * ActOnOpenMPToClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'to' clause.
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 * 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.
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'.
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 * ActOnOpenMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'nowait' clause.
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 * ActOnOpenMPFromClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'from' 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 * ActOnOpenMPThreadLimitClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'thread_limit' 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.
OMPClause * ActOnOpenMPNumTeamsClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'num_teams' clause.
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 * ActOnOpenMPUpdateClause(OpenMPDependClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'update' clause.
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,...
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.
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 * 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:111
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)
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:246
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.
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.
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 state...
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:243
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.
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...
OMPClause * ActOnOpenMPUseDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'use_device_ptr' clause.
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:55
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 * 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.
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 * ActOnOpenMPNumThreadsClause(OpenMPNumThreadsClauseModifier Modifier, Expr *NumThreads, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'num_threads' clause.
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:56
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...
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:371
StmtResult ActOnOpenMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Called on well-formed '#pragma omp cancellation point'.
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.
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 * 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.
llvm::SmallDenseMap< const ValueDecl *, const Expr *, 4 > VarsWithInheritedDSAType
Definition: SemaOpenMP.h:431
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'.
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'.
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:850
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:1833
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:711
Represents a variable declaration or definition.
Definition: Decl.h:925
Retains information about a function, method, or block that is currently being parsed.
Definition: ScopeInfo.h:104
Definition: SPIR.cpp:47
The JSON file list parser is used to communicate input to InstallAPI.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:25
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
Definition: OpenMPKinds.h:119
OpenMPOrderClauseModifier
OpenMP modifiers for 'order' clause.
Definition: OpenMPKinds.h:172
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
Definition: Specifiers.h:149
OpenMPAtClauseKind
OpenMP attributes for 'at' clause.
Definition: OpenMPKinds.h:136
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:123
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
Definition: OpenMPKinds.h:28
static constexpr unsigned NumberOfOMPAllocateClauseModifiers
Number of allowed allocate-modifiers.
Definition: OpenMPKinds.h:247
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
Definition: OpenMPKinds.h:104
OpenMPDoacrossClauseModifier
OpenMP dependence types for 'doacross' clause.
Definition: OpenMPKinds.h:233
OpenMPBindClauseKind
OpenMP bindings for the 'bind' clause.
Definition: OpenMPKinds.h:208
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
Definition: OpenMPKinds.h:158
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition: OpenMPKinds.h:55
OpenMPGrainsizeClauseModifier
Definition: OpenMPKinds.h:214
OpenMPNumTasksClauseModifier
Definition: OpenMPKinds.h:220
OpenMPSeverityClauseKind
OpenMP attributes for 'severity' clause.
Definition: OpenMPKinds.h:143
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
Definition: OpenMPKinds.h:111
OpenMPAllocateClauseModifier
OpenMP modifiers for 'allocate' clause.
Definition: OpenMPKinds.h:240
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Definition: OpenMPKinds.h:63
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition: Specifiers.h:132
OpenMPNumThreadsClauseModifier
Definition: OpenMPKinds.h:226
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
Definition: OpenMPKinds.h:128
OpenMPDeviceClauseModifier
OpenMP modifiers for 'device' clause.
Definition: OpenMPKinds.h:48
OpenMPOrderClauseKind
OpenMP attributes for 'order' clause.
Definition: OpenMPKinds.h:165
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
Definition: OpenMPKinds.h:31
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.
Definition: OpenMPClause.h:259
OMPDeclareTargetDeclAttr::MapTypeTy MT
Definition: SemaOpenMP.h:303
DeclareTargetContextInfo(OpenMPDirectiveKind Kind, SourceLocation Loc)
Definition: SemaOpenMP.h:321
std::optional< Expr * > Indirect
The directive with indirect clause.
Definition: SemaOpenMP.h:316
OpenMPDirectiveKind Kind
The directive kind, begin declare target or declare target.
Definition: SemaOpenMP.h:313
OMPDeclareTargetDeclAttr::DevTypeTy DT
The 'device_type' as parsed from the clause.
Definition: SemaOpenMP.h:310
SourceLocation Loc
The directive location.
Definition: SemaOpenMP.h:319
llvm::DenseMap< NamedDecl *, MapInfo > ExplicitlyMapped
Explicitly listed variables and functions in a 'to' or 'link' clause.
Definition: SemaOpenMP.h:307
Data structure for iterator expression.
Definition: SemaOpenMP.h:1417
OMPIteratorExpr::IteratorRange Range
Definition: SemaOpenMP.h:1421
Data used for processing a list of variables in OpenMP clauses.
Definition: SemaOpenMP.h:1141
SmallVector< SourceLocation, NumberOfOMPMotionModifiers > MotionModifiersLoc
Definition: SemaOpenMP.h:1157
SmallVector< OpenMPMotionModifierKind, NumberOfOMPMotionModifiers > MotionModifiers
Definition: SemaOpenMP.h:1156
SmallVector< SourceLocation, NumberOfOMPAllocateClauseModifiers > AllocClauseModifiersLoc
Definition: SemaOpenMP.h:1168
SmallVector< OpenMPMapModifierKind, NumberOfOMPMapClauseModifiers > MapTypeModifiers
Definition: SemaOpenMP.h:1152
SmallVector< SourceLocation, NumberOfOMPMapClauseModifiers > MapTypeModifiersLoc
Definition: SemaOpenMP.h:1154
DeclarationNameInfo ReductionOrMapperId
Definition: SemaOpenMP.h:1147
int ExtraModifier
Additional modifier for linear, map, depend or lastprivate clause.
Definition: SemaOpenMP.h:1148
SmallVector< OpenMPAllocateClauseModifier, NumberOfOMPAllocateClauseModifiers > AllocClauseModifiers
'step' modifier location for linear clause
Definition: SemaOpenMP.h:1166
Data for list of allocators.
Definition: SemaOpenMP.h:1357
Expr * AllocatorTraits
Allocator traits.
Definition: SemaOpenMP.h:1361
SourceLocation LParenLoc
Locations of '(' and ')' symbols.
Definition: SemaOpenMP.h:1363