clang 23.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 {
41} // namespace sema
42
43class DeclContext;
44class DeclGroupRef;
46class ParsedAttr;
47class Scope;
48
49class SemaOpenMP : public SemaBase {
50public:
51 SemaOpenMP(Sema &S);
52
53 friend class Parser;
54 friend class Sema;
55
57 using CapturedParamNameType = std::pair<StringRef, QualType>;
58
59 /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
60 /// context is "used as device code".
61 ///
62 /// - If CurContext is a `declare target` function or it is known that the
63 /// function is emitted for the device, emits the diagnostics immediately.
64 /// - If CurContext is a non-`declare target` function and we are compiling
65 /// for the device, creates a diagnostic which is emitted if and when we
66 /// realize that the function will be codegen'ed.
67 ///
68 /// Example usage:
69 ///
70 /// // Variable-length arrays are not allowed in NVPTX device code.
71 /// if (diagIfOpenMPDeviceCode(Loc, diag::err_vla_unsupported))
72 /// return ExprError();
73 /// // Otherwise, continue parsing as normal.
75 unsigned DiagID,
76 const FunctionDecl *FD);
77
78 /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
79 /// context is "used as host code".
80 ///
81 /// - If CurContext is a `declare target` function or it is known that the
82 /// function is emitted for the host, emits the diagnostics immediately.
83 /// - If CurContext is a non-host function, just ignore it.
84 ///
85 /// Example usage:
86 ///
87 /// // Variable-length arrays are not allowed in NVPTX device code.
88 /// if (diagIfOpenMPHostode(Loc, diag::err_vla_unsupported))
89 /// return ExprError();
90 /// // Otherwise, continue parsing as normal.
92 unsigned DiagID,
93 const FunctionDecl *FD);
94
95 /// The declarator \p D defines a function in the scope \p S which is nested
96 /// in an `omp begin/end declare variant` scope. In this method we create a
97 /// declaration for \p D and rename \p D according to the OpenMP context
98 /// selector of the surrounding scope. Return all base functions in \p Bases.
100 Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists,
102
103 /// Register \p D as specialization of all base functions in \p Bases in the
104 /// current `omp begin/end declare variant` scope.
107
108 /// Act on \p D, a function definition inside of an `omp [begin/end] assumes`.
110
111 /// Can we exit an OpenMP declare variant scope at the moment.
113 return !OMPDeclareVariantScopes.empty();
114 }
115
118 bool StrictlyPositive = true,
119 bool SuppressExprDiags = false);
120
121 /// Given the potential call expression \p Call, determine if there is a
122 /// specialization via the OpenMP declare variant mechanism available. If
123 /// there is, return the specialized call expression, otherwise return the
124 /// original \p Call.
126 SourceLocation LParenLoc, MultiExprArg ArgExprs,
127 SourceLocation RParenLoc, Expr *ExecConfig);
128
129 /// Handle a `omp begin declare variant`.
131
132 /// Handle a `omp end declare variant`.
134
135 /// Function tries to capture lambda's captured variables in the OpenMP region
136 /// before the original lambda is captured.
138
139 /// Return true if the provided declaration \a VD should be captured by
140 /// reference.
141 /// \param Level Relative level of nested OpenMP construct for that the check
142 /// is performed.
143 /// \param OpenMPCaptureLevel Capture level within an OpenMP construct.
144 bool isOpenMPCapturedByRef(const ValueDecl *D, unsigned Level,
145 unsigned OpenMPCaptureLevel) const;
146
147 /// Check if the specified variable is used in one of the private
148 /// clauses (private, firstprivate, lastprivate, reduction etc.) in OpenMP
149 /// constructs.
150 VarDecl *isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo = false,
151 unsigned StopAt = 0);
152
153 /// The member expression(this->fd) needs to be rebuilt in the template
154 /// instantiation to generate private copy for OpenMP when default
155 /// clause is used. The function will return true if default
156 /// cluse is used.
158
161
162 /// If the current region is a loop-based region, mark the start of the loop
163 /// construct.
164 void startOpenMPLoop();
165
166 /// If the current region is a range loop-based region, mark the start of the
167 /// loop construct.
169
170 /// Check if the specified variable is used in 'private' clause.
171 /// \param Level Relative level of nested OpenMP construct for that the check
172 /// is performed.
174 unsigned CapLevel) const;
175
176 /// Sets OpenMP capture kind (OMPC_private, OMPC_firstprivate, OMPC_map etc.)
177 /// for \p FD based on DSA for the provided corresponding captured declaration
178 /// \p D.
179 void setOpenMPCaptureKind(FieldDecl *FD, const ValueDecl *D, unsigned Level);
180
181 /// Check if the specified variable is captured by 'target' directive.
182 /// \param Level Relative level of nested OpenMP construct for that the check
183 /// is performed.
184 bool isOpenMPTargetCapturedDecl(const ValueDecl *D, unsigned Level,
185 unsigned CaptureLevel) const;
186
187 /// Check if the specified global variable must be captured by outer capture
188 /// regions.
189 /// \param Level Relative level of nested OpenMP construct for that
190 /// the check is performed.
191 bool isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level,
192 unsigned CaptureLevel) const;
193
195 Expr *Op);
196 /// Called on start of new data sharing attribute block.
198 const DeclarationNameInfo &DirName, Scope *CurScope,
199 SourceLocation Loc);
200 /// Start analysis of clauses.
202 /// End analysis of clauses.
203 void EndOpenMPClause();
204 /// Called on end of data sharing attribute block.
205 void EndOpenMPDSABlock(Stmt *CurDirective);
206
207 /// Check if the current region is an OpenMP loop region and if it is,
208 /// mark loop control variable, used in \p Init for loop initialization, as
209 /// private by default.
210 /// \param Init First part of the for loop.
212
213 /// Called on well-formed '\#pragma omp metadirective' after parsing
214 /// of the associated statement.
216 Stmt *AStmt, SourceLocation StartLoc,
217 SourceLocation EndLoc);
218
219 // OpenMP directives and clauses.
220 /// Called on correct id-expression from the '#pragma omp
221 /// threadprivate'.
223 const DeclarationNameInfo &Id,
225 /// Called on well-formed '#pragma omp threadprivate'.
227 ArrayRef<Expr *> VarList);
228 /// Builds a new OpenMPThreadPrivateDecl and checks its correctness.
230 ArrayRef<Expr *> VarList);
231 /// Called on well-formed '#pragma omp groupprivate'.
233 ArrayRef<Expr *> VarList);
234 /// Builds a new OpenMPGroupPrivateDecl and checks its correctness.
236 ArrayRef<Expr *> VarList);
237 /// Called on well-formed '#pragma omp allocate'.
239 ArrayRef<Expr *> VarList,
240 ArrayRef<OMPClause *> Clauses,
241 DeclContext *Owner = nullptr);
242
243 /// Called on well-formed '#pragma omp [begin] assume[s]'.
246 ArrayRef<std::string> Assumptions,
247 bool SkippedClauses);
248
249 /// Check if there is an active global `omp begin assumes` directive.
250 bool isInOpenMPAssumeScope() const { return !OMPAssumeScoped.empty(); }
251
252 /// Check if there is an active global `omp assumes` directive.
253 bool hasGlobalOpenMPAssumes() const { return !OMPAssumeGlobal.empty(); }
254
255 /// Called on well-formed '#pragma omp end assumes'.
257
258 /// Called on well-formed '#pragma omp requires'.
260 ArrayRef<OMPClause *> ClauseList);
261 /// Check restrictions on Requires directive
263 ArrayRef<OMPClause *> Clauses);
264 /// Check if the specified type is allowed to be used in 'omp declare
265 /// reduction' construct.
268 /// Called on start of '#pragma omp declare reduction'.
270 Scope *S, DeclContext *DC, DeclarationName Name,
271 ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
272 AccessSpecifier AS, Decl *PrevDeclInScope = nullptr);
273 /// Initialize declare reduction construct initializer.
275 /// Finish current declare reduction construct initializer.
277 /// Initialize declare reduction construct initializer.
278 /// \return omp_priv variable.
280 /// Finish current declare reduction construct initializer.
282 VarDecl *OmpPrivParm);
283 /// Called at the end of '#pragma omp declare reduction'.
285 Scope *S, DeclGroupPtrTy DeclReductions, bool IsValid);
286
287 /// Check variable declaration in 'omp declare mapper' construct.
289 /// Check if the specified type is allowed to be used in 'omp declare
290 /// mapper' construct.
293 /// Called for '#pragma omp declare mapper'.
295 Scope *S, DeclContext *DC, DeclarationName Name, QualType MapperType,
297 Expr *MapperVarRef, ArrayRef<OMPClause *> Clauses,
298 Decl *PrevDeclInScope = nullptr);
299 /// Build the mapper variable of '#pragma omp declare mapper'.
301 QualType MapperType,
302 SourceLocation StartLoc,
303 DeclarationName VN);
305 bool isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const;
307
309 struct MapInfo {
310 OMPDeclareTargetDeclAttr::MapTypeTy MT;
312 };
313 /// Explicitly listed variables and functions in a 'to' or 'link' clause.
314 llvm::DenseMap<NamedDecl *, MapInfo> ExplicitlyMapped;
315
316 /// The 'device_type' as parsed from the clause.
317 OMPDeclareTargetDeclAttr::DevTypeTy DT = OMPDeclareTargetDeclAttr::DT_Any;
318
319 /// The directive kind, `begin declare target` or `declare target`.
321
322 /// The directive with indirect clause.
323 std::optional<Expr *> Indirect;
324
325 /// The directive location.
327
330 };
331
332 /// Called on the start of target region i.e. '#pragma omp declare target'.
333 bool ActOnStartOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
334
335 /// Called at the end of target region i.e. '#pragma omp end declare target'.
336 const DeclareTargetContextInfo ActOnOpenMPEndDeclareTargetDirective();
337
338 /// Called once a target context is completed, that can be when a
339 /// '#pragma omp end declare target' was encountered or when a
340 /// '#pragma omp declare target' without declaration-definition-seq was
341 /// encountered.
342 void ActOnFinishedOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
343
344 /// Report unterminated 'omp declare target' or 'omp begin declare target' at
345 /// the end of a compilation unit.
347
348 /// Searches for the provided declaration name for OpenMP declare target
349 /// directive.
351 CXXScopeSpec &ScopeSpec,
352 const DeclarationNameInfo &Id);
353
354 /// Called on correct id-expression from the '#pragma omp declare target'.
356 OMPDeclareTargetDeclAttr::MapTypeTy MT,
357 DeclareTargetContextInfo &DTCI);
358
359 /// Check declaration inside target region.
360 void
363
364 /// Adds OMPDeclareTargetDeclAttr to referenced variables in declare target
365 /// directive.
367
368 /// Finishes analysis of the deferred functions calls that may be declared as
369 /// host/nohost during device/host compilation.
371 const FunctionDecl *Callee,
372 SourceLocation Loc);
373
374 /// Return true if currently in OpenMP task with untied clause context.
375 bool isInOpenMPTaskUntiedContext() const;
376
377 /// Return true inside OpenMP declare target region.
379 return !DeclareTargetNesting.empty();
380 }
381 /// Return true inside OpenMP target region.
383
384 /// Return the number of captured regions created for an OpenMP directive.
386
387 /// Initialization of captured region for OpenMP region.
388 void ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope);
389
390 /// Called for syntactical loops (ForStmt or CXXForRangeStmt) associated to
391 /// an OpenMP loop directive.
393
394 /// Process a canonical OpenMP loop nest that can either be a canonical
395 /// literal loop (ForStmt or CXXForRangeStmt), or the generated loop of an
396 /// OpenMP loop transformation construct.
398
399 /// End of OpenMP region.
400 ///
401 /// \param S Statement associated with the current OpenMP region.
402 /// \param Clauses List of clauses for the current OpenMP region.
403 ///
404 /// \returns Statement for finished OpenMP region.
407 OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
408 OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
409 Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc);
410 /// Process an OpenMP informational directive.
411 ///
412 /// \param Kind The directive kind.
413 /// \param DirName Declaration name info.
414 /// \param Clauses Array of clauses for directive.
415 /// \param AStmt The associated statement.
416 /// \param StartLoc The start location.
417 /// \param EndLoc The end location.
419 OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
420 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
421 SourceLocation EndLoc);
422 /// Process an OpenMP assume directive.
423 ///
424 /// \param Clauses Array of clauses for directive.
425 /// \param AStmt The associated statement.
426 /// \param StartLoc The start location.
427 /// \param EndLoc The end location.
429 Stmt *AStmt, SourceLocation StartLoc,
430 SourceLocation EndLoc);
431
432 /// Called on well-formed '\#pragma omp parallel' after parsing
433 /// of the associated statement.
435 Stmt *AStmt, SourceLocation StartLoc,
436 SourceLocation EndLoc);
438 llvm::SmallDenseMap<const ValueDecl *, const Expr *, 4>;
439 /// Called on well-formed '\#pragma omp simd' after parsing
440 /// of the associated statement.
443 SourceLocation StartLoc, SourceLocation EndLoc,
444 VarsWithInheritedDSAType &VarsWithImplicitDSA);
445 /// Called on well-formed '#pragma omp tile' after parsing of its clauses and
446 /// the associated statement.
448 Stmt *AStmt, SourceLocation StartLoc,
449 SourceLocation EndLoc);
451 Stmt *AStmt, SourceLocation StartLoc,
452 SourceLocation EndLoc);
453 /// Called on well-formed '#pragma omp unroll' after parsing of its clauses
454 /// and the associated statement.
456 Stmt *AStmt, SourceLocation StartLoc,
457 SourceLocation EndLoc);
458 /// Called on well-formed '#pragma omp reverse'.
460 SourceLocation EndLoc);
461 /// Called on well-formed '#pragma omp split' after parsing of its
462 /// associated statement.
464 Stmt *AStmt, SourceLocation StartLoc,
465 SourceLocation EndLoc);
466 /// Called on well-formed '#pragma omp interchange' after parsing of its
467 /// clauses and the associated statement.
469 Stmt *AStmt,
470 SourceLocation StartLoc,
471 SourceLocation EndLoc);
472
473 /// Called on well-formed '#pragma omp fuse' after parsing of its
474 /// clauses and the associated statement.
476 Stmt *AStmt, SourceLocation StartLoc,
477 SourceLocation EndLoc);
478
479 /// Called on well-formed '\#pragma omp for' after parsing
480 /// of the associated statement.
483 SourceLocation StartLoc, SourceLocation EndLoc,
484 VarsWithInheritedDSAType &VarsWithImplicitDSA);
485 /// Called on well-formed '\#pragma omp for simd' after parsing
486 /// of the associated statement.
489 SourceLocation StartLoc, SourceLocation EndLoc,
490 VarsWithInheritedDSAType &VarsWithImplicitDSA);
491 /// Called on well-formed '\#pragma omp sections' after parsing
492 /// of the associated statement.
494 Stmt *AStmt, SourceLocation StartLoc,
495 SourceLocation EndLoc);
496 /// Called on well-formed '\#pragma omp section' after parsing of the
497 /// associated statement.
499 SourceLocation EndLoc);
500 /// Called on well-formed '\#pragma omp scope' after parsing of the
501 /// associated statement.
503 Stmt *AStmt, SourceLocation StartLoc,
504 SourceLocation EndLoc);
505 /// Called on well-formed '\#pragma omp single' after parsing of the
506 /// associated statement.
508 Stmt *AStmt, SourceLocation StartLoc,
509 SourceLocation EndLoc);
510 /// Called on well-formed '\#pragma omp master' after parsing of the
511 /// associated statement.
513 SourceLocation EndLoc);
514 /// Called on well-formed '\#pragma omp critical' after parsing of the
515 /// associated statement.
517 ArrayRef<OMPClause *> Clauses,
518 Stmt *AStmt, SourceLocation StartLoc,
519 SourceLocation EndLoc);
520 /// Called on well-formed '\#pragma omp parallel for' after parsing
521 /// of the associated statement.
523 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
524 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
525 /// Called on well-formed '\#pragma omp parallel for simd' after
526 /// parsing of the associated statement.
528 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
529 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
530 /// Called on well-formed '\#pragma omp parallel master' after
531 /// parsing of the associated statement.
533 Stmt *AStmt,
534 SourceLocation StartLoc,
535 SourceLocation EndLoc);
536 /// Called on well-formed '\#pragma omp parallel masked' after
537 /// parsing of the associated statement.
539 Stmt *AStmt,
540 SourceLocation StartLoc,
541 SourceLocation EndLoc);
542 /// Called on well-formed '\#pragma omp parallel sections' after
543 /// parsing of the associated statement.
545 Stmt *AStmt,
546 SourceLocation StartLoc,
547 SourceLocation EndLoc);
548 /// Called on well-formed '\#pragma omp task' after parsing of the
549 /// associated statement.
551 Stmt *AStmt, SourceLocation StartLoc,
552 SourceLocation EndLoc);
553 /// Called on well-formed '\#pragma omp taskyield'.
555 SourceLocation EndLoc);
556 /// Called on well-formed '\#pragma omp error'.
557 /// Error direcitive is allowed in both declared and excutable contexts.
558 /// Adding InExContext to identify which context is called from.
560 SourceLocation StartLoc,
561 SourceLocation EndLoc,
562 bool InExContext = true);
563 /// Called on well-formed '\#pragma omp barrier'.
565 SourceLocation EndLoc);
566 /// Called on well-formed '\#pragma omp taskwait'.
568 SourceLocation StartLoc,
569 SourceLocation EndLoc);
570 /// Called on well-formed '\#pragma omp taskgroup'.
572 Stmt *AStmt, SourceLocation StartLoc,
573 SourceLocation EndLoc);
574 /// Called on well-formed '\#pragma omp flush'.
576 SourceLocation StartLoc,
577 SourceLocation EndLoc);
578 /// Called on well-formed '\#pragma omp depobj'.
580 SourceLocation StartLoc,
581 SourceLocation EndLoc);
582 /// Called on well-formed '\#pragma omp scan'.
584 SourceLocation StartLoc,
585 SourceLocation EndLoc);
586 /// Called on well-formed '\#pragma omp ordered' after parsing of the
587 /// associated statement.
589 Stmt *AStmt, SourceLocation StartLoc,
590 SourceLocation EndLoc);
591 /// Called on well-formed '\#pragma omp atomic' after parsing of the
592 /// associated statement.
594 Stmt *AStmt, SourceLocation StartLoc,
595 SourceLocation EndLoc);
596 /// Called on well-formed '\#pragma omp target' after parsing of the
597 /// associated statement.
599 Stmt *AStmt, SourceLocation StartLoc,
600 SourceLocation EndLoc);
601 /// Called on well-formed '\#pragma omp target data' after parsing of
602 /// the associated statement.
604 Stmt *AStmt,
605 SourceLocation StartLoc,
606 SourceLocation EndLoc);
607 /// Called on well-formed '\#pragma omp target enter data' after
608 /// parsing of the associated statement.
610 SourceLocation StartLoc,
611 SourceLocation EndLoc,
612 Stmt *AStmt);
613 /// Called on well-formed '\#pragma omp target exit data' after
614 /// parsing of the associated statement.
616 SourceLocation StartLoc,
617 SourceLocation EndLoc,
618 Stmt *AStmt);
619 /// Called on well-formed '\#pragma omp target parallel' after
620 /// parsing of the associated statement.
622 Stmt *AStmt,
623 SourceLocation StartLoc,
624 SourceLocation EndLoc);
625 /// Called on well-formed '\#pragma omp target parallel for' after
626 /// parsing of the associated statement.
628 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
629 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
630 /// Called on well-formed '\#pragma omp teams' after parsing of the
631 /// associated statement.
633 Stmt *AStmt, SourceLocation StartLoc,
634 SourceLocation EndLoc);
635 /// Called on well-formed '\#pragma omp teams loop' after parsing of the
636 /// associated statement.
638 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
639 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
640 /// Called on well-formed '\#pragma omp target teams loop' after parsing of
641 /// the associated statement.
643 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
644 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
645 /// Called on well-formed '\#pragma omp parallel loop' after parsing of the
646 /// associated statement.
648 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
649 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
650 /// Called on well-formed '\#pragma omp target parallel loop' after parsing
651 /// of the associated statement.
653 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
654 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
655 /// Called on well-formed '\#pragma omp cancellation point'.
658 SourceLocation EndLoc,
659 OpenMPDirectiveKind CancelRegion);
660 /// Called on well-formed '\#pragma omp cancel'.
662 SourceLocation StartLoc,
663 SourceLocation EndLoc,
664 OpenMPDirectiveKind CancelRegion);
665 /// Called on well-formed '\#pragma omp taskloop' after parsing of the
666 /// associated statement.
669 SourceLocation StartLoc, SourceLocation EndLoc,
670 VarsWithInheritedDSAType &VarsWithImplicitDSA);
671 /// Called on well-formed '\#pragma omp taskloop simd' after parsing of
672 /// the associated statement.
674 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
675 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
676 /// Called on well-formed '\#pragma omp master taskloop' after parsing of the
677 /// associated statement.
679 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
680 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
681 /// Called on well-formed '\#pragma omp master taskloop simd' after parsing of
682 /// the associated statement.
684 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
685 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
686 /// Called on well-formed '\#pragma omp parallel master taskloop' after
687 /// parsing of the associated statement.
689 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
690 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
691 /// Called on well-formed '\#pragma omp parallel master taskloop simd' after
692 /// parsing of the associated statement.
694 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
695 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
696 /// Called on well-formed '\#pragma omp masked taskloop' after parsing of the
697 /// associated statement.
699 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
700 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
701 /// Called on well-formed '\#pragma omp masked taskloop simd' after parsing of
702 /// the associated statement.
704 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
705 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
706 /// Called on well-formed '\#pragma omp parallel masked taskloop' after
707 /// parsing of the associated statement.
709 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
710 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
711 /// Called on well-formed '\#pragma omp parallel masked taskloop simd' after
712 /// parsing of the associated statement.
714 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
715 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
716 /// Called on well-formed '\#pragma omp distribute' after parsing
717 /// of the associated statement.
720 SourceLocation StartLoc, SourceLocation EndLoc,
721 VarsWithInheritedDSAType &VarsWithImplicitDSA);
722 /// Called on well-formed '\#pragma omp target update'.
724 SourceLocation StartLoc,
725 SourceLocation EndLoc,
726 Stmt *AStmt);
727 /// Called on well-formed '\#pragma omp distribute parallel for' after
728 /// parsing of the associated statement.
730 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
731 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
732 /// Called on well-formed '\#pragma omp distribute parallel for simd'
733 /// after parsing of the associated statement.
735 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
736 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
737 /// Called on well-formed '\#pragma omp distribute simd' after
738 /// parsing of the associated statement.
740 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
741 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
742 /// Called on well-formed '\#pragma omp target parallel for simd' after
743 /// parsing of the associated statement.
745 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
746 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
747 /// Called on well-formed '\#pragma omp target simd' after parsing of
748 /// the associated statement.
751 SourceLocation StartLoc, SourceLocation EndLoc,
752 VarsWithInheritedDSAType &VarsWithImplicitDSA);
753 /// Called on well-formed '\#pragma omp teams distribute' after parsing of
754 /// the associated statement.
756 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
757 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
758 /// Called on well-formed '\#pragma omp teams distribute simd' after parsing
759 /// of the associated statement.
761 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
762 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
763 /// Called on well-formed '\#pragma omp teams distribute parallel for simd'
764 /// after parsing of the associated statement.
766 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
767 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
768 /// Called on well-formed '\#pragma omp teams distribute parallel for'
769 /// after parsing of the associated statement.
771 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
772 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
773 /// Called on well-formed '\#pragma omp target teams' after parsing of the
774 /// associated statement.
776 Stmt *AStmt,
777 SourceLocation StartLoc,
778 SourceLocation EndLoc);
779 /// Called on well-formed '\#pragma omp target teams distribute' after parsing
780 /// of the associated statement.
782 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
783 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
784 /// Called on well-formed '\#pragma omp target teams distribute parallel for'
785 /// after parsing of the associated statement.
787 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
788 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
789 /// Called on well-formed '\#pragma omp target teams distribute parallel for
790 /// simd' after parsing of the associated statement.
792 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
793 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
794 /// Called on well-formed '\#pragma omp target teams distribute simd' after
795 /// parsing of the associated statement.
797 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
798 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
799 /// Called on well-formed '\#pragma omp interop'.
801 SourceLocation StartLoc,
802 SourceLocation EndLoc);
803 /// Called on well-formed '\#pragma omp dispatch' after parsing of the
804 // /associated statement.
806 Stmt *AStmt, SourceLocation StartLoc,
807 SourceLocation EndLoc);
808 /// Called on well-formed '\#pragma omp masked' after parsing of the
809 // /associated statement.
811 Stmt *AStmt, SourceLocation StartLoc,
812 SourceLocation EndLoc);
813
814 /// Called on well-formed '\#pragma omp loop' after parsing of the
815 /// associated statement.
817 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
818 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
819
820 /// Checks correctness of linear modifiers.
822 SourceLocation LinLoc);
823 /// Checks that the specified declaration matches requirements for the linear
824 /// decls.
827 bool IsDeclareSimd = false);
828
829 /// Called on well-formed '\#pragma omp declare simd' after parsing of
830 /// the associated method/function.
832 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
833 Expr *Simdlen, ArrayRef<Expr *> Uniforms, ArrayRef<Expr *> Aligneds,
834 ArrayRef<Expr *> Alignments, ArrayRef<Expr *> Linears,
835 ArrayRef<unsigned> LinModifiers, ArrayRef<Expr *> Steps, SourceRange SR);
836
837 /// Checks '\#pragma omp declare variant' variant function and original
838 /// functions after parsing of the associated method/function.
839 /// \param DG Function declaration to which declare variant directive is
840 /// applied to.
841 /// \param VariantRef Expression that references the variant function, which
842 /// must be used instead of the original one, specified in \p DG.
843 /// \param TI The trait info object representing the match clause.
844 /// \param NumAppendArgs The number of omp_interop_t arguments to account for
845 /// in checking.
846 /// \returns std::nullopt, if the function/variant function are not compatible
847 /// with the pragma, pair of original function/variant ref expression
848 /// otherwise.
849 std::optional<std::pair<FunctionDecl *, Expr *>>
851 OMPTraitInfo &TI, unsigned NumAppendArgs,
852 SourceRange SR);
853
854 /// Called on well-formed '\#pragma omp declare variant' after parsing of
855 /// the associated method/function.
856 /// \param FD Function declaration to which declare variant directive is
857 /// applied to.
858 /// \param VariantRef Expression that references the variant function, which
859 /// must be used instead of the original one, specified in \p DG.
860 /// \param TI The context traits associated with the function variant.
861 /// \param AdjustArgsNothing The list of 'nothing' arguments.
862 /// \param AdjustArgsNeedDevicePtr The list of 'need_device_ptr' arguments.
863 /// \param AppendArgs The list of 'append_args' arguments.
864 /// \param AdjustArgsLoc The Location of an 'adjust_args' clause.
865 /// \param AppendArgsLoc The Location of an 'append_args' clause.
866 /// \param SR The SourceRange of the 'declare variant' directive.
868 FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI,
869 ArrayRef<Expr *> AdjustArgsNothing,
870 ArrayRef<Expr *> AdjustArgsNeedDevicePtr,
871 ArrayRef<Expr *> AdjustArgsNeedDeviceAddr,
872 ArrayRef<OMPInteropInfo> AppendArgs, SourceLocation AdjustArgsLoc,
873 SourceLocation AppendArgsLoc, SourceRange SR);
874
875 /// Called on device_num selector in context selectors.
876 void ActOnOpenMPDeviceNum(Expr *DeviceNumExpr);
877
879 SourceLocation StartLoc,
880 SourceLocation LParenLoc,
881 SourceLocation EndLoc);
882 /// Called on well-formed 'allocator' clause.
884 SourceLocation StartLoc,
885 SourceLocation LParenLoc,
886 SourceLocation EndLoc);
887 /// Called on well-formed 'if' clause.
889 Expr *Condition, SourceLocation StartLoc,
890 SourceLocation LParenLoc,
891 SourceLocation NameModifierLoc,
892 SourceLocation ColonLoc,
893 SourceLocation EndLoc);
894 /// Called on well-formed 'final' clause.
896 SourceLocation LParenLoc,
897 SourceLocation EndLoc);
898 /// Called on well-formed 'num_threads' clause.
900 OpenMPNumThreadsClauseModifier Modifier, Expr *NumThreads,
901 SourceLocation StartLoc, SourceLocation LParenLoc,
902 SourceLocation ModifierLoc, SourceLocation EndLoc);
903 /// Called on well-formed 'align' clause.
905 SourceLocation LParenLoc,
906 SourceLocation EndLoc);
907 /// Called on well-formed 'safelen' clause.
909 SourceLocation LParenLoc,
910 SourceLocation EndLoc);
911 /// Called on well-formed 'simdlen' clause.
913 SourceLocation LParenLoc,
914 SourceLocation EndLoc);
915 /// Called on well-form 'sizes' clause.
917 SourceLocation StartLoc,
918 SourceLocation LParenLoc,
919 SourceLocation EndLoc);
920 /// Called on well-formed 'counts' clause after parsing its arguments.
921 OMPClause *
923 SourceLocation LParenLoc, SourceLocation EndLoc,
924 std::optional<unsigned> FillIdx,
925 SourceLocation FillLoc, unsigned FillCount);
926 /// Called on well-form 'permutation' clause after parsing its arguments.
928 SourceLocation StartLoc,
929 SourceLocation LParenLoc,
930 SourceLocation EndLoc);
931 /// Called on well-form 'full' clauses.
933 SourceLocation EndLoc);
934 /// Called on well-form 'partial' clauses.
936 SourceLocation LParenLoc,
937 SourceLocation EndLoc);
938 /// Called on well-formed 'collapse' clause.
940 SourceLocation StartLoc,
941 SourceLocation LParenLoc,
942 SourceLocation EndLoc);
943
944 /// Called on well-form 'looprange' clause after parsing its arguments.
945 OMPClause *
947 SourceLocation LParenLoc, SourceLocation FirstLoc,
948 SourceLocation CountLoc, SourceLocation EndLoc);
949 /// Called on well-formed 'ordered' clause.
950 OMPClause *
952 SourceLocation LParenLoc = SourceLocation(),
953 Expr *NumForLoops = nullptr);
954 /// Called on well-formed 'grainsize' clause.
956 Expr *Size, SourceLocation StartLoc,
957 SourceLocation LParenLoc,
958 SourceLocation ModifierLoc,
959 SourceLocation EndLoc);
960 /// Called on well-formed 'num_tasks' clause.
962 Expr *NumTasks, SourceLocation StartLoc,
963 SourceLocation LParenLoc,
964 SourceLocation ModifierLoc,
965 SourceLocation EndLoc);
966 /// Called on well-formed 'hint' clause.
968 SourceLocation LParenLoc,
969 SourceLocation EndLoc);
970 /// Called on well-formed 'detach' clause.
972 SourceLocation LParenLoc,
973 SourceLocation EndLoc);
974
975 OMPClause *ActOnOpenMPSimpleClause(OpenMPClauseKind Kind, unsigned Argument,
976 SourceLocation ArgumentLoc,
977 SourceLocation StartLoc,
978 SourceLocation LParenLoc,
979 SourceLocation EndLoc);
980 /// Called on well-formed 'when' clause.
982 SourceLocation LParenLoc,
983 SourceLocation EndLoc);
984 /// Called on well-formed 'default' clause.
985 OMPClause *
986 ActOnOpenMPDefaultClause(llvm::omp::DefaultKind M, SourceLocation MLoc,
988 SourceLocation VCKindLoc, SourceLocation StartLoc,
989 SourceLocation LParenLoc, SourceLocation EndLoc);
990 /// Called on well-formed 'threadset' clause.
992 SourceLocation KindLoc,
993 SourceLocation StartLoc,
994 SourceLocation LParenLoc,
995 SourceLocation EndLoc);
996 /// Called on well-formed 'transparent' clause.
998 SourceLocation StartLoc,
999 SourceLocation LParenLoc,
1000 SourceLocation EndLoc);
1001 /// Called on well-formed 'proc_bind' clause.
1002 OMPClause *ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind,
1003 SourceLocation KindLoc,
1004 SourceLocation StartLoc,
1005 SourceLocation LParenLoc,
1006 SourceLocation EndLoc);
1007 /// Called on well-formed 'order' clause.
1010 SourceLocation StartLoc,
1011 SourceLocation LParenLoc,
1012 SourceLocation MLoc, SourceLocation KindLoc,
1013 SourceLocation EndLoc);
1014 /// Called on well-formed 'update' clause.
1016 SourceLocation KindLoc,
1017 SourceLocation StartLoc,
1018 SourceLocation LParenLoc,
1019 SourceLocation EndLoc);
1020 /// Called on well-formed 'holds' clause.
1022 SourceLocation LParenLoc,
1023 SourceLocation EndLoc);
1024 /// Called on well-formed 'absent' or 'contains' clauses.
1029 SourceLocation Loc,
1030 SourceLocation RLoc);
1031
1033 OpenMPClauseKind Kind, ArrayRef<unsigned> Arguments, Expr *Expr,
1034 SourceLocation StartLoc, SourceLocation LParenLoc,
1035 ArrayRef<SourceLocation> ArgumentsLoc, SourceLocation DelimLoc,
1036 SourceLocation EndLoc);
1037 /// Called on well-formed 'schedule' clause.
1040 OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc,
1041 SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc,
1042 SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc);
1043
1045 SourceLocation EndLoc);
1046 /// Called on well-formed 'nowait' clause.
1048 SourceLocation EndLoc,
1049 SourceLocation LParenLoc, Expr *Condition);
1050 /// Called on well-formed 'untied' clause.
1052 SourceLocation EndLoc);
1053 /// Called on well-formed 'mergeable' clause.
1055 SourceLocation EndLoc);
1056 /// Called on well-formed 'read' clause.
1058 SourceLocation EndLoc);
1059 /// Called on well-formed 'write' clause.
1061 SourceLocation EndLoc);
1062 /// Called on well-formed 'update' clause.
1064 SourceLocation EndLoc);
1065 /// Called on well-formed 'capture' clause.
1067 SourceLocation EndLoc);
1068 /// Called on well-formed 'compare' clause.
1070 SourceLocation EndLoc);
1071 /// Called on well-formed 'fail' clause.
1073 SourceLocation EndLoc);
1075 SourceLocation KindLoc,
1076 SourceLocation StartLoc,
1077 SourceLocation LParenLoc,
1078 SourceLocation EndLoc);
1079
1080 /// Called on well-formed 'seq_cst' clause.
1082 SourceLocation EndLoc);
1083 /// Called on well-formed 'acq_rel' clause.
1085 SourceLocation EndLoc);
1086 /// Called on well-formed 'acquire' clause.
1088 SourceLocation EndLoc);
1089 /// Called on well-formed 'release' clause.
1091 SourceLocation EndLoc);
1092 /// Called on well-formed 'relaxed' clause.
1094 SourceLocation EndLoc);
1095 /// Called on well-formed 'weak' clause.
1097 SourceLocation EndLoc);
1098
1099 /// Called on well-formed 'init' clause.
1100 OMPClause *
1101 ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo,
1102 SourceLocation StartLoc, SourceLocation LParenLoc,
1103 SourceLocation VarLoc, SourceLocation EndLoc);
1104
1105 /// Called on well-formed 'use' clause.
1106 OMPClause *ActOnOpenMPUseClause(Expr *InteropVar, SourceLocation StartLoc,
1107 SourceLocation LParenLoc,
1108 SourceLocation VarLoc, SourceLocation EndLoc);
1109
1110 /// Called on well-formed 'destroy' clause.
1112 SourceLocation LParenLoc,
1113 SourceLocation VarLoc,
1114 SourceLocation EndLoc);
1115 /// Called on well-formed 'novariants' clause.
1117 SourceLocation StartLoc,
1118 SourceLocation LParenLoc,
1119 SourceLocation EndLoc);
1120 /// Called on well-formed 'nocontext' clause.
1122 SourceLocation StartLoc,
1123 SourceLocation LParenLoc,
1124 SourceLocation EndLoc);
1125 /// Called on well-formed 'filter' clause.
1127 SourceLocation LParenLoc,
1128 SourceLocation EndLoc);
1129 /// Called on well-formed 'threads' clause.
1131 SourceLocation EndLoc);
1132 /// Called on well-formed 'simd' clause.
1134 SourceLocation EndLoc);
1135 /// Called on well-formed 'nogroup' clause.
1137 SourceLocation EndLoc);
1138 /// Called on well-formed 'unified_address' clause.
1140 SourceLocation EndLoc);
1141
1142 /// Called on well-formed 'unified_address' clause.
1144 SourceLocation EndLoc);
1145
1146 /// Called on well-formed 'reverse_offload' clause.
1148 SourceLocation EndLoc);
1149
1150 /// Called on well-formed 'dynamic_allocators' clause.
1152 SourceLocation EndLoc);
1153
1154 /// Called on well-formed 'atomic_default_mem_order' clause.
1157 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1158
1159 /// Called on well-formed 'self_maps' clause.
1161 SourceLocation EndLoc);
1162
1163 /// Called on well-formed 'at' clause.
1165 SourceLocation KindLoc,
1166 SourceLocation StartLoc,
1167 SourceLocation LParenLoc,
1168 SourceLocation EndLoc);
1169
1170 /// Called on well-formed 'severity' clause.
1172 SourceLocation KindLoc,
1173 SourceLocation StartLoc,
1174 SourceLocation LParenLoc,
1175 SourceLocation EndLoc);
1176
1177 /// Called on well-formed 'message' clause.
1178 /// passing string for message.
1180 SourceLocation LParenLoc,
1181 SourceLocation EndLoc);
1182
1183 /// Data used for processing a list of variables in OpenMP clauses.
1184 struct OpenMPVarListDataTy final {
1186 Expr *IteratorExpr = nullptr;
1191 int ExtraModifier = -1; ///< Additional modifier for linear, map, depend,
1192 ///< lastprivate, or use_device_ptr clause.
1193 int OriginalSharingModifier = 0; // Default is shared
1203 bool IsMapTypeImplicit = false;
1208 StepModifierLoc; /// 'step' modifier location for linear clause
1221 };
1222
1224 ArrayRef<Expr *> Vars,
1225 const OMPVarListLocTy &Locs,
1226 OpenMPVarListDataTy &Data);
1227 /// Called on well-formed 'inclusive' clause.
1229 SourceLocation StartLoc,
1230 SourceLocation LParenLoc,
1231 SourceLocation EndLoc);
1232 /// Called on well-formed 'exclusive' clause.
1234 SourceLocation StartLoc,
1235 SourceLocation LParenLoc,
1236 SourceLocation EndLoc);
1237 /// Called on well-formed 'allocate' clause.
1238 OMPClause *
1239 ActOnOpenMPAllocateClause(Expr *Allocator, Expr *Alignment,
1240 OpenMPAllocateClauseModifier FirstModifier,
1241 SourceLocation FirstModifierLoc,
1242 OpenMPAllocateClauseModifier SecondModifier,
1243 SourceLocation SecondModifierLoc,
1244 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1245 SourceLocation ColonLoc, SourceLocation LParenLoc,
1246 SourceLocation EndLoc);
1247 /// Called on well-formed 'private' clause.
1249 SourceLocation StartLoc,
1250 SourceLocation LParenLoc,
1251 SourceLocation EndLoc);
1252 /// Called on well-formed 'firstprivate' clause.
1254 SourceLocation StartLoc,
1255 SourceLocation LParenLoc,
1256 SourceLocation EndLoc);
1257 /// Called on well-formed 'lastprivate' clause.
1260 SourceLocation LPKindLoc, SourceLocation ColonLoc,
1261 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1262 /// Called on well-formed 'shared' clause.
1264 SourceLocation StartLoc,
1265 SourceLocation LParenLoc,
1266 SourceLocation EndLoc);
1267 /// Called on well-formed 'reduction' clause.
1269 ArrayRef<Expr *> VarList,
1270 OpenMPVarListDataTy::OpenMPReductionClauseModifiers Modifiers,
1271 SourceLocation StartLoc, SourceLocation LParenLoc,
1272 SourceLocation ModifierLoc, SourceLocation ColonLoc,
1273 SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec,
1274 const DeclarationNameInfo &ReductionId,
1275 ArrayRef<Expr *> UnresolvedReductions = {});
1276 /// Called on well-formed 'task_reduction' clause.
1278 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1279 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1280 CXXScopeSpec &ReductionIdScopeSpec,
1281 const DeclarationNameInfo &ReductionId,
1282 ArrayRef<Expr *> UnresolvedReductions = {});
1283 /// Called on well-formed 'in_reduction' clause.
1285 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1286 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1287 CXXScopeSpec &ReductionIdScopeSpec,
1288 const DeclarationNameInfo &ReductionId,
1289 ArrayRef<Expr *> UnresolvedReductions = {});
1290 /// Called on well-formed 'linear' clause.
1291 OMPClause *ActOnOpenMPLinearClause(
1292 ArrayRef<Expr *> VarList, Expr *Step, SourceLocation StartLoc,
1293 SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind,
1294 SourceLocation LinLoc, SourceLocation ColonLoc,
1295 SourceLocation StepModifierLoc, SourceLocation EndLoc);
1296 /// Called on well-formed 'aligned' clause.
1297 OMPClause *ActOnOpenMPAlignedClause(ArrayRef<Expr *> VarList, Expr *Alignment,
1298 SourceLocation StartLoc,
1299 SourceLocation LParenLoc,
1300 SourceLocation ColonLoc,
1301 SourceLocation EndLoc);
1302 /// Called on well-formed 'copyin' clause.
1303 OMPClause *ActOnOpenMPCopyinClause(ArrayRef<Expr *> VarList,
1304 SourceLocation StartLoc,
1305 SourceLocation LParenLoc,
1306 SourceLocation EndLoc);
1307 /// Called on well-formed 'copyprivate' clause.
1308 OMPClause *ActOnOpenMPCopyprivateClause(ArrayRef<Expr *> VarList,
1309 SourceLocation StartLoc,
1310 SourceLocation LParenLoc,
1311 SourceLocation EndLoc);
1312 /// Called on well-formed 'flush' pseudo clause.
1313 OMPClause *ActOnOpenMPFlushClause(ArrayRef<Expr *> VarList,
1314 SourceLocation StartLoc,
1315 SourceLocation LParenLoc,
1316 SourceLocation EndLoc);
1317 /// Called on well-formed 'depobj' pseudo clause.
1318 OMPClause *ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc,
1319 SourceLocation LParenLoc,
1320 SourceLocation EndLoc);
1321 /// Called on well-formed 'depend' clause.
1322 OMPClause *ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data,
1323 Expr *DepModifier,
1324 ArrayRef<Expr *> VarList,
1325 SourceLocation StartLoc,
1326 SourceLocation LParenLoc,
1327 SourceLocation EndLoc);
1328 /// Called on well-formed 'device' clause.
1330 Expr *Device, SourceLocation StartLoc,
1331 SourceLocation LParenLoc,
1332 SourceLocation ModifierLoc,
1333 SourceLocation EndLoc);
1334 /// Called on well-formed 'map' clause.
1335 OMPClause *ActOnOpenMPMapClause(
1336 Expr *IteratorModifier, ArrayRef<OpenMPMapModifierKind> MapTypeModifiers,
1337 ArrayRef<SourceLocation> MapTypeModifiersLoc,
1338 CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
1339 OpenMPMapClauseKind MapType, bool IsMapTypeImplicit,
1340 SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
1341 const OMPVarListLocTy &Locs, bool NoDiagnose = false,
1342 ArrayRef<Expr *> UnresolvedMappers = {});
1343 /// Called on well-formed 'num_teams' clause.
1344 OMPClause *ActOnOpenMPNumTeamsClause(ArrayRef<Expr *> VarList,
1345 SourceLocation StartLoc,
1346 SourceLocation LParenLoc,
1347 SourceLocation EndLoc);
1348 /// Called on well-formed 'thread_limit' clause.
1349 OMPClause *ActOnOpenMPThreadLimitClause(ArrayRef<Expr *> VarList,
1350 SourceLocation StartLoc,
1351 SourceLocation LParenLoc,
1352 SourceLocation EndLoc);
1353 /// Called on well-formed 'priority' clause.
1354 OMPClause *ActOnOpenMPPriorityClause(Expr *Priority, SourceLocation StartLoc,
1355 SourceLocation LParenLoc,
1356 SourceLocation EndLoc);
1357 /// Called on well-formed 'dist_schedule' clause.
1359 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
1360 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc,
1361 SourceLocation CommaLoc, SourceLocation EndLoc);
1362 /// Called on well-formed 'defaultmap' clause.
1363 OMPClause *ActOnOpenMPDefaultmapClause(
1365 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc,
1366 SourceLocation KindLoc, SourceLocation EndLoc);
1367 /// Called on well-formed 'to' clause.
1368 OMPClause *
1369 ActOnOpenMPToClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1370 ArrayRef<SourceLocation> MotionModifiersLoc,
1371 Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec,
1372 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1373 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1374 ArrayRef<Expr *> UnresolvedMappers = {});
1375 /// Called on well-formed 'from' clause.
1376 OMPClause *
1377 ActOnOpenMPFromClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1378 ArrayRef<SourceLocation> MotionModifiersLoc,
1379 Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec,
1380 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1381 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1382 ArrayRef<Expr *> UnresolvedMappers = {});
1383 /// Called on well-formed 'use_device_ptr' clause.
1385 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1386 OpenMPUseDevicePtrFallbackModifier FallbackModifier,
1387 SourceLocation FallbackModifierLoc);
1388 /// Called on well-formed 'use_device_addr' clause.
1389 OMPClause *ActOnOpenMPUseDeviceAddrClause(ArrayRef<Expr *> VarList,
1390 const OMPVarListLocTy &Locs);
1391 /// Called on well-formed 'is_device_ptr' clause.
1392 OMPClause *ActOnOpenMPIsDevicePtrClause(ArrayRef<Expr *> VarList,
1393 const OMPVarListLocTy &Locs);
1394 /// Called on well-formed 'has_device_addr' clause.
1395 OMPClause *ActOnOpenMPHasDeviceAddrClause(ArrayRef<Expr *> VarList,
1396 const OMPVarListLocTy &Locs);
1397 /// Called on well-formed 'nontemporal' clause.
1398 OMPClause *ActOnOpenMPNontemporalClause(ArrayRef<Expr *> VarList,
1399 SourceLocation StartLoc,
1400 SourceLocation LParenLoc,
1401 SourceLocation EndLoc);
1402
1403 /// Data for list of allocators.
1405 /// Allocator.
1406 Expr *Allocator = nullptr;
1407 /// Allocator traits.
1409 /// Locations of '(' and ')' symbols.
1411 };
1412 /// Called on well-formed 'uses_allocators' clause.
1414 SourceLocation LParenLoc,
1415 SourceLocation EndLoc,
1417 /// Called on well-formed 'affinity' clause.
1419 SourceLocation LParenLoc,
1420 SourceLocation ColonLoc,
1421 SourceLocation EndLoc, Expr *Modifier,
1422 ArrayRef<Expr *> Locators);
1423 /// Called on a well-formed 'bind' clause.
1425 SourceLocation KindLoc,
1426 SourceLocation StartLoc,
1427 SourceLocation LParenLoc,
1428 SourceLocation EndLoc);
1429
1430 /// Called on a well-formed 'ompx_dyn_cgroup_mem' clause.
1432 SourceLocation LParenLoc,
1433 SourceLocation EndLoc);
1434
1435 /// Called on a well-formed 'dyn_groupprivate' clause.
1439 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation M1Loc,
1440 SourceLocation M2Loc, SourceLocation EndLoc);
1441
1442 /// Called on well-formed 'doacross' clause.
1443 OMPClause *
1445 SourceLocation DepLoc, SourceLocation ColonLoc,
1446 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1447 SourceLocation LParenLoc, SourceLocation EndLoc);
1448
1449 /// Called on a well-formed 'ompx_attribute' clause.
1451 SourceLocation StartLoc,
1452 SourceLocation LParenLoc,
1453 SourceLocation EndLoc);
1454
1455 /// Called on a well-formed 'ompx_bare' clause.
1457 SourceLocation EndLoc);
1458
1460 Expr *LowerBound,
1461 SourceLocation ColonLocFirst,
1462 SourceLocation ColonLocSecond,
1463 Expr *Length, Expr *Stride,
1464 SourceLocation RBLoc);
1466 SourceLocation RParenLoc,
1467 ArrayRef<Expr *> Dims,
1468 ArrayRef<SourceRange> Brackets);
1469
1470 /// Data structure for iterator expression.
1480
1482 SourceLocation LLoc, SourceLocation RLoc,
1484
1485 void handleOMPAssumeAttr(Decl *D, const ParsedAttr &AL);
1486
1487 /// Setter and getter functions for device_num.
1488 void setOpenMPDeviceNum(int Num);
1489
1490 int getOpenMPDeviceNum() const;
1491
1492 void setOpenMPDeviceNumID(StringRef ID);
1493
1500
1501private:
1502 void *VarDataSharingAttributesStack;
1503
1504 /// Number of nested '#pragma omp declare target' directives.
1505 SmallVector<DeclareTargetContextInfo, 4> DeclareTargetNesting;
1506
1507 /// Initialization of data-sharing attributes stack.
1508 void InitDataSharingAttributesStack();
1509 void DestroyDataSharingAttributesStack();
1510
1511 /// Returns OpenMP nesting level for current directive.
1512 unsigned getOpenMPNestingLevel() const;
1513
1514 /// Adjusts the function scopes index for the target-based regions.
1515 void adjustOpenMPTargetScopeIndex(unsigned &FunctionScopesIndex,
1516 unsigned Level) const;
1517
1518 /// Returns the number of scopes associated with the construct on the given
1519 /// OpenMP level.
1520 int getNumberOfConstructScopes(unsigned Level) const;
1521
1522 /// Push new OpenMP function region for non-capturing function.
1523 void pushOpenMPFunctionRegion();
1524
1525 /// Pop OpenMP function region for non-capturing function.
1526 void popOpenMPFunctionRegion(const sema::FunctionScopeInfo *OldFSI);
1527
1528 /// Analyzes and checks a loop nest for use by a loop transformation.
1529 ///
1530 /// \param Kind The loop transformation directive kind.
1531 /// \param NumLoops How many nested loops the directive is expecting.
1532 /// \param AStmt Associated statement of the transformation directive.
1533 /// \param LoopHelpers [out] The loop analysis result.
1534 /// \param Body [out] The body code nested in \p NumLoops loop.
1535 /// \param OriginalInits [out] Collection of statements and declarations that
1536 /// must have been executed/declared before entering the
1537 /// loop.
1538 ///
1539 /// \return Whether there was any error.
1540 bool checkTransformableLoopNest(
1541 OpenMPDirectiveKind Kind, Stmt *AStmt, int NumLoops,
1543 Stmt *&Body, SmallVectorImpl<SmallVector<Stmt *>> &OriginalInits);
1544
1545 /// Holds the result of the analysis of a (possibly canonical) loop.
1546 struct LoopAnalysis {
1547 /// The analyzed loop or loop transformation.
1548 Stmt *AStmt = nullptr;
1549 /// Loop analyses results.
1550 OMPLoopBasedDirective::HelperExprs HelperExprs;
1551 /// The for-statement of the loop. TheForStmt equals AStmt only when the
1552 /// latter is a canonical loop (i.e. not a loop transformation).
1553 Stmt *TheForStmt = nullptr;
1554 /// Initialization statements before transformations.
1555 SmallVector<Stmt *> OriginalInits;
1556 /// Initialization statements required after transformation of this loop.
1557 SmallVector<Stmt *> TransformsPreInits;
1558
1559 explicit LoopAnalysis(Stmt *S) : AStmt(S) {}
1560
1561 bool isRegularLoop() const { return isRegularLoop(AStmt); }
1562 bool isLoopTransformation() const { return isLoopTransformation(AStmt); }
1563
1564 // Convenience functions used when building LoopSequenceAnalysis.
1565 static bool isRegularLoop(Stmt *S) {
1567 }
1568 static bool isLoopTransformation(Stmt *S) {
1570 }
1571 };
1572
1573 /// Holds the result of the analysis of a (possibly canonical) loop sequence.
1574 struct LoopSequenceAnalysis {
1575 /// Number of top level canonical loops.
1576 unsigned LoopSeqSize = 0;
1577 /// For each loop results of the analysis.
1578 SmallVector<LoopAnalysis, 2> Loops;
1579 /// Additional code required before entering the transformed loop sequence.
1580 SmallVector<Stmt *> LoopSequencePreInits;
1581
1582 // Convenience function used when building the LoopSequenceAnalysis.
1583 static bool isLoopSequenceDerivation(Stmt *S) {
1584 return LoopAnalysis::isRegularLoop(S) ||
1585 LoopAnalysis::isLoopTransformation(S);
1586 }
1587 };
1588
1589 /// The main recursive process of `checkTransformableLoopSequence` that
1590 /// performs grammatical parsing of a canonical loop sequence. It extracts
1591 /// key information, such as the number of top-level loops, loop statements,
1592 /// helper expressions, and other relevant loop-related data, all in a single
1593 /// execution to avoid redundant traversals. This analysis flattens inner
1594 /// Loop Sequences
1595 ///
1596 /// \param LoopSeqStmt The AST of the original statement.
1597 /// \param SeqAnalysis [out] Result of the analysis of \p LoopSeqStmt
1598 /// \param Context
1599 /// \param Kind The loop transformation directive kind.
1600 /// \return Whether the original statement is both syntactically and
1601 /// semantically correct according to OpenMP 6.0 canonical loop
1602 /// sequence definition.
1603 bool analyzeLoopSequence(Stmt *LoopSeqStmt, LoopSequenceAnalysis &SeqAnalysis,
1604 ASTContext &Context, OpenMPDirectiveKind Kind);
1605
1606 /// Validates and checks whether a loop sequence can be transformed according
1607 /// to the given directive, providing necessary setup and initialization
1608 /// (Driver function) before recursion using `analyzeLoopSequence`.
1609 ///
1610 /// \param Kind The loop transformation directive kind.
1611 /// \param AStmt The AST of the original statement
1612 /// \param SeqAnalysis [out] Result of the analysis of \p LoopSeqStmt
1613 /// \param Context
1614 /// \return Whether there was an absence of errors or not
1615 bool checkTransformableLoopSequence(OpenMPDirectiveKind Kind, Stmt *AStmt,
1616 LoopSequenceAnalysis &SeqAnalysis,
1617 ASTContext &Context);
1618
1619 /// Helper to keep information about the current `omp begin/end declare
1620 /// variant` nesting.
1621 struct OMPDeclareVariantScope {
1622 /// The associated OpenMP context selector.
1623 OMPTraitInfo *TI;
1624
1625 /// The associated OpenMP context selector mangling.
1626 std::string NameSuffix;
1627
1628 OMPDeclareVariantScope(OMPTraitInfo &TI);
1629 };
1630
1631 /// Return the OMPTraitInfo for the surrounding scope, if any.
1632 OMPTraitInfo *getOMPTraitInfoForSurroundingScope() {
1633 return OMPDeclareVariantScopes.empty() ? nullptr
1634 : OMPDeclareVariantScopes.back().TI;
1635 }
1636
1637 /// The current `omp begin/end declare variant` scopes.
1638 SmallVector<OMPDeclareVariantScope, 4> OMPDeclareVariantScopes;
1639
1640 /// The current `omp begin/end assumes` scopes.
1641 SmallVector<OMPAssumeAttr *, 4> OMPAssumeScoped;
1642
1643 /// All `omp assumes` we encountered so far.
1644 SmallVector<OMPAssumeAttr *, 4> OMPAssumeGlobal;
1645
1646 /// Device number specified by the context selector.
1647 int DeviceNum = -1;
1648
1649 /// Device number identifier specified by the context selector.
1650 StringRef DeviceNumID;
1651};
1652
1653} // namespace clang
1654
1655#endif // LLVM_CLANG_SEMA_SEMAOPENMP_H
#define V(N, I)
Forward declaration of all AST node types.
This file defines the classes used to store parsed information about declaration-specifiers and decla...
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
This file defines OpenMP AST classes for executable directives and clauses.
Represents a C++ nested-name-specifier or a global scope specifier.
Definition DeclSpec.h:74
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition DeclBase.h:1462
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:1921
An instance of this object exists for each enum constant that is defined.
Definition Decl.h:3438
This represents one expression.
Definition Expr.h:112
Represents a member of a struct/union/class.
Definition Decl.h:3175
Represents a function declaration or definition.
Definition Decl.h:2015
One of these records is kept for each identifier that is lexed.
This represents a decl that may have a name.
Definition Decl.h:274
This is a basic class for representing single OpenMP clause.
This represents 'pragma omp groupprivate ...' directive.
Definition DeclOpenMP.h:173
This represents 'pragma omp requires...' directive.
Definition DeclOpenMP.h:479
This represents 'pragma omp threadprivate ...' directive.
Definition DeclOpenMP.h:110
Wrapper for void* pointer.
Definition Ownership.h:51
ParsedAttr - Represents a syntactic attribute.
Definition ParsedAttr.h:119
A (possibly-)qualified type.
Definition TypeBase.h: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
SemaBase(Sema &S)
Definition SemaBase.cpp:7
StmtResult ActOnOpenMPTargetParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target parallel for' after parsing of the associated statement.
OMPClause * ActOnOpenMPNocontextClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'nocontext' clause.
OMPClause * ActOnOpenMPXDynCGroupMemClause(Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_dyn_cgroup_mem' clause.
DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveEnd(Scope *S, DeclGroupPtrTy DeclReductions, bool IsValid)
Called at the end of 'pragma omp declare reduction'.
bool isInOpenMPTaskUntiedContext() const
Return true if currently in OpenMP task with untied clause context.
OMPClause * ActOnOpenMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'untied' clause.
OMPClause * ActOnOpenMPSafelenClause(Expr *Length, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'safelen' clause.
OMPClause * ActOnOpenMPThreadsetClause(OpenMPThreadsetKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'threadset' clause.
OMPClause * ActOnOpenMPHoldsClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'holds' clause.
StmtResult ActOnOpenMPParallelMasterTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel master taskloop simd' after parsing of the associated sta...
StmtResult ActOnOpenMPParallelMasterDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel master' after parsing of the associated statement.
StmtResult ActOnOpenMPDispatchDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp dispatch' after parsing of the.
OMPClause * ActOnOpenMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'read' clause.
OMPClause * ActOnOpenMPFilterClause(Expr *ThreadID, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'filter' clause.
void ActOnOpenMPDeclareReductionCombinerEnd(Decl *D, Expr *Combiner)
Finish current declare reduction construct initializer.
ExprResult ActOnOpenMPCall(ExprResult Call, Scope *Scope, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig)
Given the potential call expression Call, determine if there is a specialization via the OpenMP decla...
void setOpenMPDeviceNum(int Num)
Setter and getter functions for device_num.
OMPClause * ActOnOpenMPFullClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-form 'full' clauses.
StmtResult ActOnOpenMPSplitDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp split' after parsing of its associated statement.
StmtResult ActOnOpenMPTargetEnterDataDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AStmt)
Called on well-formed '#pragma omp target enter data' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetTeamsGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams loop' after parsing of the associated statement.
OMPClause * ActOnOpenMPDetachClause(Expr *Evt, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'detach' clause.
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 enc...
OMPClause * ActOnOpenMPDirectivePresenceClause(OpenMPClauseKind CK, llvm::ArrayRef< OpenMPDirectiveKind > DKVec, SourceLocation Loc, SourceLocation LLoc, SourceLocation RLoc)
Called on well-formed 'absent' or 'contains' clauses.
void tryCaptureOpenMPLambdas(ValueDecl *V)
Function tries to capture lambda's captured variables in the OpenMP region before the original lambda...
StmtResult ActOnOpenMPParallelMaskedDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel masked' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetTeamsDistributeParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute parallel for' after parsing of the associa...
OMPClause * ActOnOpenMPPrivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'private' clause.
void StartOpenMPClause(OpenMPClauseKind K)
Start analysis of clauses.
bool CheckOpenMPLinearModifier(OpenMPLinearClauseKind LinKind, SourceLocation LinLoc)
Checks correctness of linear modifiers.
ExprResult ActOnOpenMPDeclareMapperDirectiveVarDecl(Scope *S, QualType MapperType, SourceLocation StartLoc, DeclarationName VN)
Build the mapper variable of 'pragma omp declare mapper'.
OMPClause * ActOnOpenMPOrderedClause(SourceLocation StartLoc, SourceLocation EndLoc, SourceLocation LParenLoc=SourceLocation(), Expr *NumForLoops=nullptr)
Called on well-formed 'ordered' clause.
OMPClause * ActOnOpenMPSelfMapsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'self_maps' clause.
bool CheckOpenMPLinearDecl(const ValueDecl *D, SourceLocation ELoc, OpenMPLinearClauseKind LinKind, QualType Type, bool IsDeclareSimd=false)
Checks that the specified declaration matches requirements for the linear decls.
OMPClause * ActOnOpenMPIsDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'is_device_ptr' clause.
OMPClause * ActOnOpenMPCountsClause(ArrayRef< Expr * > CountExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, std::optional< unsigned > FillIdx, SourceLocation FillLoc, unsigned FillCount)
Called on well-formed 'counts' clause after parsing its arguments.
OMPClause * ActOnOpenMPHasDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'has_device_addr' clause.
StmtResult ActOnOpenMPErrorDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, bool InExContext=true)
Called on well-formed '#pragma omp error'.
OMPClause * ActOnOpenMPPartialClause(Expr *FactorExpr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'partial' clauses.
StmtResult ActOnOpenMPSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPLastprivateClause(ArrayRef< Expr * > VarList, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'lastprivate' clause.
void ActOnOpenMPDeclareTargetName(NamedDecl *ND, SourceLocation Loc, OMPDeclareTargetDeclAttr::MapTypeTy MT, DeclareTargetContextInfo &DTCI)
Called on correct id-expression from the 'pragma omp declare target'.
DeclGroupPtrTy ActOnOpenMPRequiresDirective(SourceLocation Loc, ArrayRef< OMPClause * > ClauseList)
Called on well-formed 'pragma omp requires'.
OMPGroupPrivateDecl * CheckOMPGroupPrivateDecl(SourceLocation Loc, ArrayRef< Expr * > VarList)
Builds a new OpenMPGroupPrivateDecl and checks its correctness.
StmtResult ActOnOpenMPDistributeSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPFirstprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'firstprivate' clause.
StmtResult ActOnOpenMPDepobjDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp depobj'.
ExprResult getOpenMPCapturedExpr(VarDecl *Capture, ExprValueKind VK, ExprObjectKind OK, SourceLocation Loc)
OMPClause * ActOnOpenMPPriorityClause(Expr *Priority, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'priority' clause.
OMPClause * ActOnOpenMPSingleExprWithArgClause(OpenMPClauseKind Kind, ArrayRef< unsigned > Arguments, Expr *Expr, SourceLocation StartLoc, SourceLocation LParenLoc, ArrayRef< SourceLocation > ArgumentsLoc, SourceLocation DelimLoc, SourceLocation EndLoc)
void ActOnOpenMPDeclareVariantDirective(FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI, ArrayRef< Expr * > AdjustArgsNothing, ArrayRef< Expr * > AdjustArgsNeedDevicePtr, ArrayRef< Expr * > AdjustArgsNeedDeviceAddr, ArrayRef< OMPInteropInfo > AppendArgs, SourceLocation AdjustArgsLoc, SourceLocation AppendArgsLoc, SourceRange SR)
Called on well-formed '#pragma omp declare variant' after parsing of the associated method/function.
StmtResult ActOnOpenMPTargetParallelDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target parallel' after parsing of the associated statement.
OMPClause * ActOnOpenMPDistScheduleClause(OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc)
Called on well-formed 'dist_schedule' clause.
OpenMPClauseKind isOpenMPPrivateDecl(ValueDecl *D, unsigned Level, unsigned CapLevel) const
Check if the specified variable is used in 'private' clause.
OMPClause * ActOnOpenMPLoopRangeClause(Expr *First, Expr *Count, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation FirstLoc, SourceLocation CountLoc, SourceLocation EndLoc)
Called on well-form 'looprange' clause after parsing its arguments.
StmtResult ActOnOpenMPMetaDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp metadirective' after parsing of the associated statement.
OMPClause * ActOnOpenMPPermutationClause(ArrayRef< Expr * > PermExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'permutation' clause after parsing its arguments.
OMPClause * ActOnOpenMPNontemporalClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'nontemporal' clause.
OMPClause * ActOnOpenMPBindClause(OpenMPBindClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'bind' clause.
OMPClause * ActOnOpenMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'threads' clause.
OMPClause * 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.
StmtResult ActOnOpenMPFuseDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp fuse' after parsing of its clauses and the associated statement.
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,...
OMPClause * ActOnOpenMPUseDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, OpenMPUseDevicePtrFallbackModifier FallbackModifier, SourceLocation FallbackModifierLoc)
Called on well-formed 'use_device_ptr' clause.
StmtResult ActOnOpenMPMasterTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp master taskloop simd' after parsing of the associated statement.
friend class Sema
Definition SemaOpenMP.h:54
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:112
StmtResult ActOnOpenMPDistributeParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute parallel for simd' after parsing of the associated stat...
StmtResult ActOnOpenMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp barrier'.
TypeResult ActOnOpenMPDeclareMapperVarDecl(Scope *S, Declarator &D)
Check variable declaration in 'omp declare mapper' construct.
ExprResult ActOnOMPIteratorExpr(Scope *S, SourceLocation IteratorKwLoc, SourceLocation LLoc, SourceLocation RLoc, ArrayRef< OMPIteratorData > Data)
OMPClause * ActOnOpenMPUsesAllocatorClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< UsesAllocatorsData > Data)
Called on well-formed 'uses_allocators' clause.
StmtResult ActOnOpenMPRegionEnd(StmtResult S, ArrayRef< OMPClause * > Clauses)
End of OpenMP region.
DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveStart(Scope *S, DeclContext *DC, DeclarationName Name, ArrayRef< std::pair< QualType, SourceLocation > > ReductionTypes, AccessSpecifier AS, Decl *PrevDeclInScope=nullptr)
Called on start of 'pragma omp declare reduction'.
OMPClause * ActOnOpenMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'acq_rel' clause.
OMPClause * ActOnOpenMPAllocatorClause(Expr *Allocator, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'allocator' clause.
ExprResult VerifyPositiveIntegerConstantInClause(Expr *Op, OpenMPClauseKind CKind, bool StrictlyPositive=true, bool SuppressExprDiags=false)
DeclGroupPtrTy ActOnOpenMPGroupPrivateDirective(SourceLocation Loc, ArrayRef< Expr * > VarList)
Called on well-formed 'pragma omp groupprivate'.
bool isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const
OMPClause * ActOnOpenMPInclusiveClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'inclusive' clause.
SemaDiagnosticBuilder diagIfOpenMPHostCode(SourceLocation Loc, unsigned DiagID, const FunctionDecl *FD)
Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as host cod...
SemaDiagnosticBuilder diagIfOpenMPDeviceCode(SourceLocation Loc, unsigned DiagID, const FunctionDecl *FD)
Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as device c...
StmtResult ActOnOpenMPSectionsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp sections' after parsing of the associated statement.
void ActOnOpenMPEndDeclareVariant()
Handle a omp end declare variant.
OMPClause * ActOnOpenMPTaskReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'task_reduction' clause.
bool hasGlobalOpenMPAssumes() const
Check if there is an active global omp assumes directive.
Definition SemaOpenMP.h:253
OMPClause * ActOnOpenMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc, SourceLocation LParenLoc, Expr *Condition)
Called on well-formed 'nowait' clause.
StmtResult ActOnOpenMPCriticalDirective(const DeclarationNameInfo &DirName, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp critical' after parsing of the associated statement.
StmtResult ActOnOpenMPMaskedDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp masked' after parsing of the.
StmtResult ActOnOpenMPStripeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
void ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(Decl *D)
Act on D, a function definition inside of an omp [begin/end] assumes.
void EndOpenMPDSABlock(Stmt *CurDirective)
Called on end of data sharing attribute block.
OMPClause * ActOnOpenMPOrderClause(OpenMPOrderClauseModifier Modifier, OpenMPOrderClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc)
Called on well-formed 'order' clause.
llvm::SmallDenseMap< const ValueDecl *, const Expr *, 4 > VarsWithInheritedDSAType
Definition SemaOpenMP.h:437
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 statem...
bool isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level, unsigned CaptureLevel) const
Check if the specified global variable must be captured by outer capture regions.
OMPClause * ActOnOpenMPInReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'in_reduction' clause.
StmtResult ActOnOpenMPGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp loop' after parsing of the associated statement.
OMPClause * ActOnOpenMPFlushClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'flush' pseudo clause.
OMPRequiresDecl * CheckOMPRequiresDecl(SourceLocation Loc, ArrayRef< OMPClause * > Clauses)
Check restrictions on Requires directive.
void ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(Decl *D, SmallVectorImpl< FunctionDecl * > &Bases)
Register D as specialization of all base functions in Bases in the current omp begin/end declare vari...
StmtResult ActOnOpenMPExecutableDirective(OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName, OpenMPDirectiveKind CancelRegion, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
void EndOpenMPClause()
End analysis of clauses.
bool isInOpenMPAssumeScope() const
Check if there is an active global omp begin assumes directive.
Definition SemaOpenMP.h:250
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...
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:56
OMPClause * ActOnOpenMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'release' clause.
OMPClause * ActOnOpenMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'acquire' clause.
OMPClause * ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'proc_bind' clause.
OMPClause * ActOnOpenMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'simd' clause.
OMPClause * ActOnOpenMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_bare' clause.
StmtResult ActOnOpenMPInformationalDirective(OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Process an OpenMP informational directive.
StmtResult ActOnOpenMPCanonicalLoop(Stmt *AStmt)
Called for syntactical loops (ForStmt or CXXForRangeStmt) associated to an OpenMP loop directive.
OMPClause * ActOnOpenMPTransparentClause(Expr *Transparent, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'transparent' clause.
OMPClause * ActOnOpenMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'hint' clause.
OMPClause * ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
OMPClause * ActOnOpenMPNullaryAssumptionClause(OpenMPClauseKind CK, SourceLocation Loc, SourceLocation RLoc)
StmtResult ActOnOpenMPTargetTeamsDistributeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute' after parsing of the associated statement...
StmtResult ActOnOpenMPParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel for' after parsing of the associated statement.
OMPClause * ActOnOpenMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'capture' clause.
StmtResult ActOnOpenMPForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp for' after parsing of the associated statement.
StmtResult ActOnOpenMPAtomicDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp atomic' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetUpdateDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AStmt)
Called on well-formed '#pragma omp target update'.
StmtResult ActOnOpenMPOrderedDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp ordered' after parsing of the associated statement.
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:57
OMPClause * ActOnOpenMPFinalClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'final' clause.
bool isInOpenMPTargetExecutionDirective() const
Return true inside OpenMP target region.
StmtResult ActOnOpenMPTargetDataDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target data' after parsing of the associated statement.
StmtResult ActOnOpenMPMasterTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp master taskloop' after parsing of the associated statement.
void ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, SmallVectorImpl< FunctionDecl * > &Bases)
The declarator D defines a function in the scope S which is nested in an omp begin/end declare varian...
friend class Parser
Definition SemaOpenMP.h:53
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:378
OMPClause * ActOnOpenMPFromClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'from' clause.
StmtResult ActOnOpenMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Called on well-formed '#pragma omp cancellation point'.
OMPClause * ActOnOpenMPDynGroupprivateClause(OpenMPDynGroupprivateClauseModifier M1, OpenMPDynGroupprivateClauseFallbackModifier M2, Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc, SourceLocation EndLoc)
Called on a well-formed 'dyn_groupprivate' clause.
OMPClause * ActOnOpenMPVarListClause(OpenMPClauseKind Kind, ArrayRef< Expr * > Vars, const OMPVarListLocTy &Locs, OpenMPVarListDataTy &Data)
void startOpenMPLoop()
If the current region is a loop-based region, mark the start of the loop construct.
StmtResult ActOnOpenMPTargetDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target' after parsing of the associated statement.
void StartOpenMPDSABlock(OpenMPDirectiveKind K, const DeclarationNameInfo &DirName, Scope *CurScope, SourceLocation Loc)
Called on start of new data sharing attribute block.
OMPThreadPrivateDecl * CheckOMPThreadPrivateDecl(SourceLocation Loc, ArrayRef< Expr * > VarList)
Builds a new OpenMPThreadPrivateDecl and checks its correctness.
void handleOMPAssumeAttr(Decl *D, const ParsedAttr &AL)
OMPClause * ActOnOpenMPSeverityClause(OpenMPSeverityClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'severity' clause.
OMPClause * ActOnOpenMPToClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'to' clause.
void ActOnOpenMPDeclareReductionInitializerEnd(Decl *D, Expr *Initializer, VarDecl *OmpPrivParm)
Finish current declare reduction construct initializer.
OMPClause * ActOnOpenMPLinearClause(ArrayRef< Expr * > VarList, Expr *Step, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind, SourceLocation LinLoc, SourceLocation ColonLoc, SourceLocation StepModifierLoc, SourceLocation EndLoc)
Called on well-formed 'linear' clause.
OMPClause * ActOnOpenMPDefaultmapClause(OpenMPDefaultmapClauseModifier M, OpenMPDefaultmapClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc)
Called on well-formed 'defaultmap' clause.
StmtResult ActOnOpenMPMaskedTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp masked taskloop' after parsing of the associated statement.
StmtResult ActOnOpenMPTaskwaitDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp taskwait'.
StmtResult ActOnOpenMPForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp for simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPReductionClause(ArrayRef< Expr * > VarList, OpenMPVarListDataTy::OpenMPReductionClauseModifiers Modifiers, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'reduction' clause.
OMPClause * ActOnOpenMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'relaxed' clause.
OMPClause * ActOnOpenMPAlignedClause(ArrayRef< Expr * > VarList, Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Called on well-formed 'aligned' clause.
StmtResult ActOnOpenMPInteropDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp interop'.
OMPClause * ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depobj' pseudo clause.
OMPClause * ActOnOpenMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'seq_cst' clause.
void checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D, SourceLocation IdLoc=SourceLocation())
Check declaration inside target region.
OMPClause * ActOnOpenMPNovariantsClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'novariants' clause.
OMPClause * ActOnOpenMPCopyprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyprivate' clause.
OMPClause * ActOnOpenMPCollapseClause(Expr *NumForLoops, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'collapse' clause.
DeclGroupPtrTy ActOnOpenMPDeclareSimdDirective(DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS, Expr *Simdlen, ArrayRef< Expr * > Uniforms, ArrayRef< Expr * > Aligneds, ArrayRef< Expr * > Alignments, ArrayRef< Expr * > Linears, ArrayRef< unsigned > LinModifiers, ArrayRef< Expr * > Steps, SourceRange SR)
Called on well-formed '#pragma omp declare simd' after parsing of the associated method/function.
ExprResult PerformOpenMPImplicitIntegerConversion(SourceLocation OpLoc, Expr *Op)
StmtResult ActOnOpenMPTargetSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPDefaultClause(llvm::omp::DefaultKind M, SourceLocation MLoc, OpenMPDefaultClauseVariableCategory VCKind, SourceLocation VCKindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'default' clause.
OMPClause * ActOnOpenMPAlignClause(Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'align' clause.
OMPClause * ActOnOpenMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'atomic_default_mem_order' clause.
StmtResult ActOnOpenMPTeamsGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams loop' after parsing of the associated statement.
OMPClause * ActOnOpenMPWeakClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'weak' clause.
OMPClause * ActOnOpenMPXAttributeClause(ArrayRef< const Attr * > Attrs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_attribute' clause.
StmtResult ActOnOpenMPTileDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp tile' after parsing of its clauses and the associated statement.
StmtResult ActOnOpenMPParallelDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel' after parsing of the associated statement.
StmtResult ActOnOpenMPSingleDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp single' after parsing of the associated statement.
StmtResult ActOnOpenMPTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp taskloop simd' after parsing of the associated statement.
const ValueDecl * getOpenMPDeclareMapperVarName() const
StmtResult ActOnOpenMPParallelMasterTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel master taskloop' after parsing of the associated statemen...
DeclGroupPtrTy ActOnOpenMPThreadprivateDirective(SourceLocation Loc, ArrayRef< Expr * > VarList)
Called on well-formed 'pragma omp threadprivate'.
void ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope)
Initialization of captured region for OpenMP region.
NamedDecl * lookupOpenMPDeclareTargetName(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id)
Searches for the provided declaration name for OpenMP declare target directive.
OMPClause * ActOnOpenMPExclusiveClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'exclusive' clause.
OMPClause * ActOnOpenMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'write' clause.
StmtResult ActOnOpenMPTargetParallelGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target parallel loop' after parsing of the associated statement.
void ActOnOpenMPAssumesDirective(SourceLocation Loc, OpenMPDirectiveKind DKind, ArrayRef< std::string > Assumptions, bool SkippedClauses)
Called on well-formed 'pragma omp [begin] assume[s]'.
StmtResult ActOnOpenMPTargetParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target parallel for simd' after parsing of the associated statemen...
void ActOnOpenMPBeginDeclareVariant(SourceLocation Loc, OMPTraitInfo &TI)
Handle a omp begin declare variant.
StmtResult ActOnOpenMPLoopnest(Stmt *AStmt)
Process a canonical OpenMP loop nest that can either be a canonical literal loop (ForStmt or CXXForRa...
OMPClause * ActOnOpenMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'reverse_offload' clause.
StmtResult ActOnOpenMPTaskDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp task' after parsing of the associated statement.
OMPClause * ActOnOpenMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation NameModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Called on well-formed 'if' clause.
StmtResult ActOnOpenMPTargetTeamsDistributeSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute simd' after parsing of the associated stat...
const DeclareTargetContextInfo ActOnOpenMPEndDeclareTargetDirective()
Called at the end of target region i.e. 'pragma omp end declare target'.
void setOpenMPCaptureKind(FieldDecl *FD, const ValueDecl *D, unsigned Level)
Sets OpenMP capture kind (OMPC_private, OMPC_firstprivate, OMPC_map etc.) for FD based on DSA for the...
OMPClause * ActOnOpenMPClause(OpenMPClauseKind Kind, SourceLocation StartLoc, SourceLocation EndLoc)
StmtResult ActOnOpenMPCancelDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Called on well-formed '#pragma omp cancel'.
StmtResult ActOnOpenMPTaskyieldDirective(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp taskyield'.
StmtResult ActOnOpenMPTeamsDistributeSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute simd' after parsing of the associated statement.
DeclGroupPtrTy ActOnOpenMPDeclareMapperDirective(Scope *S, DeclContext *DC, DeclarationName Name, QualType MapperType, SourceLocation StartLoc, DeclarationName VN, AccessSpecifier AS, Expr *MapperVarRef, ArrayRef< OMPClause * > Clauses, Decl *PrevDeclInScope=nullptr)
Called for 'pragma omp declare mapper'.
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
Definition Stmt.h:86
The base class of the type hierarchy.
Definition TypeBase.h:1866
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:712
Represents a variable declaration or definition.
Definition Decl.h:926
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.
bool isa(CodeGen::Address addr)
Definition Address.h:330
MutableArrayRef< TemplateParameterList * > MultiTemplateParamsArg
Definition Ownership.h:263
OpenMPDefaultClauseVariableCategory
OpenMP variable-category for 'default' clause.
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
OpenMPOrderClauseModifier
OpenMP modifiers for 'order' clause.
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
Definition Specifiers.h:150
OpenMPAtClauseKind
OpenMP attributes for 'at' clause.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
Definition OpenMPKinds.h:39
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition Specifiers.h:124
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
static constexpr unsigned NumberOfOMPAllocateClauseModifiers
Number of allowed allocate-modifiers.
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
OpenMPDoacrossClauseModifier
OpenMP dependence types for 'doacross' clause.
OpenMPDynGroupprivateClauseFallbackModifier
MutableArrayRef< Expr * > MultiExprArg
Definition Ownership.h:259
ActionResult< ParsedType > TypeResult
Definition Ownership.h:251
OpenMPBindClauseKind
OpenMP bindings for the 'bind' clause.
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition OpenMPKinds.h:55
OpenMPGrainsizeClauseModifier
OpenMPNumTasksClauseModifier
OpenMPUseDevicePtrFallbackModifier
OpenMP 6.1 use_device_ptr fallback modifier.
OpenMPSeverityClauseKind
OpenMP attributes for 'severity' clause.
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
OpenMPAllocateClauseModifier
OpenMP modifiers for 'allocate' clause.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Definition OpenMPKinds.h:63
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition OpenMPKinds.h:25
OpenMPDynGroupprivateClauseModifier
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition Specifiers.h:133
OpenMPNumThreadsClauseModifier
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
OpenMPDeviceClauseModifier
OpenMP modifiers for 'device' clause.
Definition OpenMPKinds.h:48
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
Definition Ownership.h:230
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
Definition OpenMPKinds.h:28
ActionResult< Expr * > ExprResult
Definition Ownership.h:249
OpenMPOrderClauseKind
OpenMP attributes for 'order' clause.
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
Definition OpenMPKinds.h:31
ActionResult< Stmt * > StmtResult
Definition Ownership.h:250
OpenMPThreadsetKind
OpenMP modifiers for 'threadset' clause.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Definition OpenMPKinds.h:71
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Iterator range representation begin:end[:step].
Definition ExprOpenMP.h:154
This structure contains most locations needed for by an OMPVarListClause.
OMPDeclareTargetDeclAttr::MapTypeTy MT
Definition SemaOpenMP.h:310
DeclareTargetContextInfo(OpenMPDirectiveKind Kind, SourceLocation Loc)
Definition SemaOpenMP.h:328
std::optional< Expr * > Indirect
The directive with indirect clause.
Definition SemaOpenMP.h:323
OpenMPDirectiveKind Kind
The directive kind, begin declare target or declare target.
Definition SemaOpenMP.h:320
OMPDeclareTargetDeclAttr::DevTypeTy DT
The 'device_type' as parsed from the clause.
Definition SemaOpenMP.h:317
SourceLocation Loc
The directive location.
Definition SemaOpenMP.h:326
llvm::DenseMap< NamedDecl *, MapInfo > ExplicitlyMapped
Explicitly listed variables and functions in a 'to' or 'link' clause.
Definition SemaOpenMP.h:314
Data structure for iterator expression.
OMPIteratorExpr::IteratorRange Range
Data used for processing a list of variables in OpenMP clauses.
SmallVector< SourceLocation, NumberOfOMPMotionModifiers > MotionModifiersLoc
SmallVector< OpenMPMotionModifierKind, NumberOfOMPMotionModifiers > MotionModifiers
SmallVector< SourceLocation, NumberOfOMPAllocateClauseModifiers > AllocClauseModifiersLoc
SmallVector< OpenMPMapModifierKind, NumberOfOMPMapClauseModifiers > MapTypeModifiers
SmallVector< SourceLocation, NumberOfOMPMapClauseModifiers > MapTypeModifiersLoc
int ExtraModifier
Additional modifier for linear, map, depend, lastprivate, or use_device_ptr clause.
SmallVector< OpenMPAllocateClauseModifier, NumberOfOMPAllocateClauseModifiers > AllocClauseModifiers
'step' modifier location for linear clause
Data for list of allocators.
Expr * AllocatorTraits
Allocator traits.
SourceLocation LParenLoc
Locations of '(' and ')' symbols.