Thanks to visit codestin.com
Credit goes to clang.llvm.org

clang 22.0.0git
SemaOpenMP.h
Go to the documentation of this file.
1//===----- SemaOpenMP.h -- Semantic Analysis for OpenMP constructs -------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9/// This file declares semantic analysis for OpenMP constructs and
10/// clauses.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_SEMA_SEMAOPENMP_H
15#define LLVM_CLANG_SEMA_SEMAOPENMP_H
16
17#include "clang/AST/ASTFwd.h"
18#include "clang/AST/Attr.h"
24#include "clang/Basic/LLVM.h"
28#include "clang/Sema/DeclSpec.h"
30#include "clang/Sema/SemaBase.h"
31#include "llvm/ADT/DenseMap.h"
32#include "llvm/Frontend/OpenMP/OMP.h.inc"
33#include "llvm/Frontend/OpenMP/OMPConstants.h"
34#include <optional>
35#include <string>
36#include <utility>
37
38namespace clang {
39namespace sema {
41} // namespace sema
42
43class DeclContext;
44class DeclGroupRef;
45class ParsedAttr;
46class Scope;
47
48class SemaOpenMP : public SemaBase {
49public:
50 SemaOpenMP(Sema &S);
51
52 friend class Parser;
53 friend class Sema;
54
56 using CapturedParamNameType = std::pair<StringRef, QualType>;
57
58 /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
59 /// context is "used as device code".
60 ///
61 /// - If CurContext is a `declare target` function or it is known that the
62 /// function is emitted for the device, emits the diagnostics immediately.
63 /// - If CurContext is a non-`declare target` function and we are compiling
64 /// for the device, creates a diagnostic which is emitted if and when we
65 /// realize that the function will be codegen'ed.
66 ///
67 /// Example usage:
68 ///
69 /// // Variable-length arrays are not allowed in NVPTX device code.
70 /// if (diagIfOpenMPDeviceCode(Loc, diag::err_vla_unsupported))
71 /// return ExprError();
72 /// // Otherwise, continue parsing as normal.
74 unsigned DiagID,
75 const FunctionDecl *FD);
76
77 /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
78 /// context is "used as host code".
79 ///
80 /// - If CurContext is a `declare target` function or it is known that the
81 /// function is emitted for the host, emits the diagnostics immediately.
82 /// - If CurContext is a non-host function, just ignore it.
83 ///
84 /// Example usage:
85 ///
86 /// // Variable-length arrays are not allowed in NVPTX device code.
87 /// if (diagIfOpenMPHostode(Loc, diag::err_vla_unsupported))
88 /// return ExprError();
89 /// // Otherwise, continue parsing as normal.
91 unsigned DiagID,
92 const FunctionDecl *FD);
93
94 /// The declarator \p D defines a function in the scope \p S which is nested
95 /// in an `omp begin/end declare variant` scope. In this method we create a
96 /// declaration for \p D and rename \p D according to the OpenMP context
97 /// selector of the surrounding scope. Return all base functions in \p Bases.
99 Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists,
101
102 /// Register \p D as specialization of all base functions in \p Bases in the
103 /// current `omp begin/end declare variant` scope.
106
107 /// Act on \p D, a function definition inside of an `omp [begin/end] assumes`.
109
110 /// Can we exit an OpenMP declare variant scope at the moment.
112 return !OMPDeclareVariantScopes.empty();
113 }
114
117 bool StrictlyPositive = true,
118 bool SuppressExprDiags = false);
119
120 /// Given the potential call expression \p Call, determine if there is a
121 /// specialization via the OpenMP declare variant mechanism available. If
122 /// there is, return the specialized call expression, otherwise return the
123 /// original \p Call.
125 SourceLocation LParenLoc, MultiExprArg ArgExprs,
126 SourceLocation RParenLoc, Expr *ExecConfig);
127
128 /// Handle a `omp begin declare variant`.
130
131 /// Handle a `omp end declare variant`.
133
134 /// Function tries to capture lambda's captured variables in the OpenMP region
135 /// before the original lambda is captured.
137
138 /// Return true if the provided declaration \a VD should be captured by
139 /// reference.
140 /// \param Level Relative level of nested OpenMP construct for that the check
141 /// is performed.
142 /// \param OpenMPCaptureLevel Capture level within an OpenMP construct.
143 bool isOpenMPCapturedByRef(const ValueDecl *D, unsigned Level,
144 unsigned OpenMPCaptureLevel) const;
145
146 /// Check if the specified variable is used in one of the private
147 /// clauses (private, firstprivate, lastprivate, reduction etc.) in OpenMP
148 /// constructs.
149 VarDecl *isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo = false,
150 unsigned StopAt = 0);
151
152 /// The member expression(this->fd) needs to be rebuilt in the template
153 /// instantiation to generate private copy for OpenMP when default
154 /// clause is used. The function will return true if default
155 /// cluse is used.
157
160
161 /// If the current region is a loop-based region, mark the start of the loop
162 /// construct.
163 void startOpenMPLoop();
164
165 /// If the current region is a range loop-based region, mark the start of the
166 /// loop construct.
168
169 /// Check if the specified variable is used in 'private' clause.
170 /// \param Level Relative level of nested OpenMP construct for that the check
171 /// is performed.
173 unsigned CapLevel) const;
174
175 /// Sets OpenMP capture kind (OMPC_private, OMPC_firstprivate, OMPC_map etc.)
176 /// for \p FD based on DSA for the provided corresponding captured declaration
177 /// \p D.
178 void setOpenMPCaptureKind(FieldDecl *FD, const ValueDecl *D, unsigned Level);
179
180 /// Check if the specified variable is captured by 'target' directive.
181 /// \param Level Relative level of nested OpenMP construct for that the check
182 /// is performed.
183 bool isOpenMPTargetCapturedDecl(const ValueDecl *D, unsigned Level,
184 unsigned CaptureLevel) const;
185
186 /// Check if the specified global variable must be captured by outer capture
187 /// regions.
188 /// \param Level Relative level of nested OpenMP construct for that
189 /// the check is performed.
190 bool isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level,
191 unsigned CaptureLevel) const;
192
194 Expr *Op);
195 /// Called on start of new data sharing attribute block.
197 const DeclarationNameInfo &DirName, Scope *CurScope,
198 SourceLocation Loc);
199 /// Start analysis of clauses.
201 /// End analysis of clauses.
202 void EndOpenMPClause();
203 /// Called on end of data sharing attribute block.
204 void EndOpenMPDSABlock(Stmt *CurDirective);
205
206 /// Check if the current region is an OpenMP loop region and if it is,
207 /// mark loop control variable, used in \p Init for loop initialization, as
208 /// private by default.
209 /// \param Init First part of the for loop.
211
212 /// Called on well-formed '\#pragma omp metadirective' after parsing
213 /// of the associated statement.
215 Stmt *AStmt, SourceLocation StartLoc,
216 SourceLocation EndLoc);
217
218 // OpenMP directives and clauses.
219 /// Called on correct id-expression from the '#pragma omp
220 /// threadprivate'.
222 const DeclarationNameInfo &Id,
224 /// Called on well-formed '#pragma omp threadprivate'.
226 ArrayRef<Expr *> VarList);
227 /// Builds a new OpenMPThreadPrivateDecl and checks its correctness.
229 ArrayRef<Expr *> VarList);
230 /// Called on well-formed '#pragma omp groupprivate'.
232 ArrayRef<Expr *> VarList);
233 /// Builds a new OpenMPGroupPrivateDecl and checks its correctness.
235 ArrayRef<Expr *> VarList);
236 /// Called on well-formed '#pragma omp allocate'.
238 ArrayRef<Expr *> VarList,
239 ArrayRef<OMPClause *> Clauses,
240 DeclContext *Owner = nullptr);
241
242 /// Called on well-formed '#pragma omp [begin] assume[s]'.
245 ArrayRef<std::string> Assumptions,
246 bool SkippedClauses);
247
248 /// Check if there is an active global `omp begin assumes` directive.
249 bool isInOpenMPAssumeScope() const { return !OMPAssumeScoped.empty(); }
250
251 /// Check if there is an active global `omp assumes` directive.
252 bool hasGlobalOpenMPAssumes() const { return !OMPAssumeGlobal.empty(); }
253
254 /// Called on well-formed '#pragma omp end assumes'.
256
257 /// Called on well-formed '#pragma omp requires'.
259 ArrayRef<OMPClause *> ClauseList);
260 /// Check restrictions on Requires directive
262 ArrayRef<OMPClause *> Clauses);
263 /// Check if the specified type is allowed to be used in 'omp declare
264 /// reduction' construct.
267 /// Called on start of '#pragma omp declare reduction'.
269 Scope *S, DeclContext *DC, DeclarationName Name,
270 ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
271 AccessSpecifier AS, Decl *PrevDeclInScope = nullptr);
272 /// Initialize declare reduction construct initializer.
274 /// Finish current declare reduction construct initializer.
276 /// Initialize declare reduction construct initializer.
277 /// \return omp_priv variable.
279 /// Finish current declare reduction construct initializer.
281 VarDecl *OmpPrivParm);
282 /// Called at the end of '#pragma omp declare reduction'.
284 Scope *S, DeclGroupPtrTy DeclReductions, bool IsValid);
285
286 /// Check variable declaration in 'omp declare mapper' construct.
288 /// Check if the specified type is allowed to be used in 'omp declare
289 /// mapper' construct.
292 /// Called for '#pragma omp declare mapper'.
294 Scope *S, DeclContext *DC, DeclarationName Name, QualType MapperType,
296 Expr *MapperVarRef, ArrayRef<OMPClause *> Clauses,
297 Decl *PrevDeclInScope = nullptr);
298 /// Build the mapper variable of '#pragma omp declare mapper'.
300 QualType MapperType,
301 SourceLocation StartLoc,
302 DeclarationName VN);
304 bool isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const;
306
308 struct MapInfo {
309 OMPDeclareTargetDeclAttr::MapTypeTy MT;
311 };
312 /// Explicitly listed variables and functions in a 'to' or 'link' clause.
313 llvm::DenseMap<NamedDecl *, MapInfo> ExplicitlyMapped;
314
315 /// The 'device_type' as parsed from the clause.
316 OMPDeclareTargetDeclAttr::DevTypeTy DT = OMPDeclareTargetDeclAttr::DT_Any;
317
318 /// The directive kind, `begin declare target` or `declare target`.
320
321 /// The directive with indirect clause.
322 std::optional<Expr *> Indirect;
323
324 /// The directive location.
326
329 };
330
331 /// Called on the start of target region i.e. '#pragma omp declare target'.
332 bool ActOnStartOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
333
334 /// Called at the end of target region i.e. '#pragma omp end declare target'.
335 const DeclareTargetContextInfo ActOnOpenMPEndDeclareTargetDirective();
336
337 /// Called once a target context is completed, that can be when a
338 /// '#pragma omp end declare target' was encountered or when a
339 /// '#pragma omp declare target' without declaration-definition-seq was
340 /// encountered.
341 void ActOnFinishedOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
342
343 /// Report unterminated 'omp declare target' or 'omp begin declare target' at
344 /// the end of a compilation unit.
346
347 /// Searches for the provided declaration name for OpenMP declare target
348 /// directive.
350 CXXScopeSpec &ScopeSpec,
351 const DeclarationNameInfo &Id);
352
353 /// Called on correct id-expression from the '#pragma omp declare target'.
355 OMPDeclareTargetDeclAttr::MapTypeTy MT,
356 DeclareTargetContextInfo &DTCI);
357
358 /// Check declaration inside target region.
359 void
362
363 /// Adds OMPDeclareTargetDeclAttr to referenced variables in declare target
364 /// directive.
366
367 /// Finishes analysis of the deferred functions calls that may be declared as
368 /// host/nohost during device/host compilation.
370 const FunctionDecl *Callee,
371 SourceLocation Loc);
372
373 /// Return true if currently in OpenMP task with untied clause context.
374 bool isInOpenMPTaskUntiedContext() const;
375
376 /// Return true inside OpenMP declare target region.
378 return !DeclareTargetNesting.empty();
379 }
380 /// Return true inside OpenMP target region.
382
383 /// Return the number of captured regions created for an OpenMP directive.
385
386 /// Initialization of captured region for OpenMP region.
387 void ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope);
388
389 /// Called for syntactical loops (ForStmt or CXXForRangeStmt) associated to
390 /// an OpenMP loop directive.
392
393 /// Process a canonical OpenMP loop nest that can either be a canonical
394 /// literal loop (ForStmt or CXXForRangeStmt), or the generated loop of an
395 /// OpenMP loop transformation construct.
397
398 /// End of OpenMP region.
399 ///
400 /// \param S Statement associated with the current OpenMP region.
401 /// \param Clauses List of clauses for the current OpenMP region.
402 ///
403 /// \returns Statement for finished OpenMP region.
406 OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
407 OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
408 Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc);
409 /// Process an OpenMP informational directive.
410 ///
411 /// \param Kind The directive kind.
412 /// \param DirName Declaration name info.
413 /// \param Clauses Array of clauses for directive.
414 /// \param AStmt The associated statement.
415 /// \param StartLoc The start location.
416 /// \param EndLoc The end location.
418 OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
419 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
420 SourceLocation EndLoc);
421 /// Process an OpenMP assume directive.
422 ///
423 /// \param Clauses Array of clauses for directive.
424 /// \param AStmt The associated statement.
425 /// \param StartLoc The start location.
426 /// \param EndLoc The end location.
428 Stmt *AStmt, SourceLocation StartLoc,
429 SourceLocation EndLoc);
430
431 /// Called on well-formed '\#pragma omp parallel' after parsing
432 /// of the associated statement.
434 Stmt *AStmt, SourceLocation StartLoc,
435 SourceLocation EndLoc);
437 llvm::SmallDenseMap<const ValueDecl *, const Expr *, 4>;
438 /// Called on well-formed '\#pragma omp simd' after parsing
439 /// of the associated statement.
442 SourceLocation StartLoc, SourceLocation EndLoc,
443 VarsWithInheritedDSAType &VarsWithImplicitDSA);
444 /// Called on well-formed '#pragma omp tile' after parsing of its clauses and
445 /// the associated statement.
447 Stmt *AStmt, SourceLocation StartLoc,
448 SourceLocation EndLoc);
450 Stmt *AStmt, SourceLocation StartLoc,
451 SourceLocation EndLoc);
452 /// Called on well-formed '#pragma omp unroll' after parsing of its clauses
453 /// and the associated statement.
455 Stmt *AStmt, SourceLocation StartLoc,
456 SourceLocation EndLoc);
457 /// Called on well-formed '#pragma omp reverse'.
459 SourceLocation EndLoc);
460 /// Called on well-formed '#pragma omp interchange' after parsing of its
461 /// clauses and the associated statement.
463 Stmt *AStmt,
464 SourceLocation StartLoc,
465 SourceLocation EndLoc);
466
467 /// Called on well-formed '#pragma omp fuse' after parsing of its
468 /// clauses and the associated statement.
470 Stmt *AStmt, SourceLocation StartLoc,
471 SourceLocation EndLoc);
472
473 /// Called on well-formed '\#pragma omp for' after parsing
474 /// of the associated statement.
477 SourceLocation StartLoc, SourceLocation EndLoc,
478 VarsWithInheritedDSAType &VarsWithImplicitDSA);
479 /// Called on well-formed '\#pragma omp for simd' after parsing
480 /// of the associated statement.
483 SourceLocation StartLoc, SourceLocation EndLoc,
484 VarsWithInheritedDSAType &VarsWithImplicitDSA);
485 /// Called on well-formed '\#pragma omp sections' after parsing
486 /// of the associated statement.
488 Stmt *AStmt, SourceLocation StartLoc,
489 SourceLocation EndLoc);
490 /// Called on well-formed '\#pragma omp section' after parsing of the
491 /// associated statement.
493 SourceLocation EndLoc);
494 /// Called on well-formed '\#pragma omp scope' after parsing of the
495 /// associated statement.
497 Stmt *AStmt, SourceLocation StartLoc,
498 SourceLocation EndLoc);
499 /// Called on well-formed '\#pragma omp single' after parsing of the
500 /// associated statement.
502 Stmt *AStmt, SourceLocation StartLoc,
503 SourceLocation EndLoc);
504 /// Called on well-formed '\#pragma omp master' after parsing of the
505 /// associated statement.
507 SourceLocation EndLoc);
508 /// Called on well-formed '\#pragma omp critical' after parsing of the
509 /// associated statement.
511 ArrayRef<OMPClause *> Clauses,
512 Stmt *AStmt, SourceLocation StartLoc,
513 SourceLocation EndLoc);
514 /// Called on well-formed '\#pragma omp parallel for' after parsing
515 /// of the associated statement.
517 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
518 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
519 /// Called on well-formed '\#pragma omp parallel for simd' after
520 /// parsing of the associated statement.
522 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
523 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
524 /// Called on well-formed '\#pragma omp parallel master' after
525 /// parsing of the associated statement.
527 Stmt *AStmt,
528 SourceLocation StartLoc,
529 SourceLocation EndLoc);
530 /// Called on well-formed '\#pragma omp parallel masked' after
531 /// parsing of the associated statement.
533 Stmt *AStmt,
534 SourceLocation StartLoc,
535 SourceLocation EndLoc);
536 /// Called on well-formed '\#pragma omp parallel sections' after
537 /// parsing of the associated statement.
539 Stmt *AStmt,
540 SourceLocation StartLoc,
541 SourceLocation EndLoc);
542 /// Called on well-formed '\#pragma omp task' after parsing of the
543 /// associated statement.
545 Stmt *AStmt, SourceLocation StartLoc,
546 SourceLocation EndLoc);
547 /// Called on well-formed '\#pragma omp taskyield'.
549 SourceLocation EndLoc);
550 /// Called on well-formed '\#pragma omp error'.
551 /// Error direcitive is allowed in both declared and excutable contexts.
552 /// Adding InExContext to identify which context is called from.
554 SourceLocation StartLoc,
555 SourceLocation EndLoc,
556 bool InExContext = true);
557 /// Called on well-formed '\#pragma omp barrier'.
559 SourceLocation EndLoc);
560 /// Called on well-formed '\#pragma omp taskwait'.
562 SourceLocation StartLoc,
563 SourceLocation EndLoc);
564 /// Called on well-formed '\#pragma omp taskgroup'.
566 Stmt *AStmt, SourceLocation StartLoc,
567 SourceLocation EndLoc);
568 /// Called on well-formed '\#pragma omp flush'.
570 SourceLocation StartLoc,
571 SourceLocation EndLoc);
572 /// Called on well-formed '\#pragma omp depobj'.
574 SourceLocation StartLoc,
575 SourceLocation EndLoc);
576 /// Called on well-formed '\#pragma omp scan'.
578 SourceLocation StartLoc,
579 SourceLocation EndLoc);
580 /// Called on well-formed '\#pragma omp ordered' after parsing of the
581 /// associated statement.
583 Stmt *AStmt, SourceLocation StartLoc,
584 SourceLocation EndLoc);
585 /// Called on well-formed '\#pragma omp atomic' after parsing of the
586 /// associated statement.
588 Stmt *AStmt, SourceLocation StartLoc,
589 SourceLocation EndLoc);
590 /// Called on well-formed '\#pragma omp target' after parsing of the
591 /// associated statement.
593 Stmt *AStmt, SourceLocation StartLoc,
594 SourceLocation EndLoc);
595 /// Called on well-formed '\#pragma omp target data' after parsing of
596 /// the associated statement.
598 Stmt *AStmt,
599 SourceLocation StartLoc,
600 SourceLocation EndLoc);
601 /// Called on well-formed '\#pragma omp target enter data' after
602 /// parsing of the associated statement.
604 SourceLocation StartLoc,
605 SourceLocation EndLoc,
606 Stmt *AStmt);
607 /// Called on well-formed '\#pragma omp target exit 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 parallel' after
614 /// parsing of the associated statement.
616 Stmt *AStmt,
617 SourceLocation StartLoc,
618 SourceLocation EndLoc);
619 /// Called on well-formed '\#pragma omp target parallel for' after
620 /// parsing of the associated statement.
622 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
623 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
624 /// Called on well-formed '\#pragma omp teams' after parsing of the
625 /// associated statement.
627 Stmt *AStmt, SourceLocation StartLoc,
628 SourceLocation EndLoc);
629 /// Called on well-formed '\#pragma omp teams loop' after parsing of the
630 /// associated statement.
632 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
633 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
634 /// Called on well-formed '\#pragma omp target teams loop' after parsing of
635 /// the associated statement.
637 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
638 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
639 /// Called on well-formed '\#pragma omp parallel loop' after parsing of the
640 /// associated statement.
642 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
643 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
644 /// Called on well-formed '\#pragma omp target parallel loop' after parsing
645 /// of the associated statement.
647 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
648 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
649 /// Called on well-formed '\#pragma omp cancellation point'.
652 SourceLocation EndLoc,
653 OpenMPDirectiveKind CancelRegion);
654 /// Called on well-formed '\#pragma omp cancel'.
656 SourceLocation StartLoc,
657 SourceLocation EndLoc,
658 OpenMPDirectiveKind CancelRegion);
659 /// Called on well-formed '\#pragma omp taskloop' after parsing of the
660 /// associated statement.
663 SourceLocation StartLoc, SourceLocation EndLoc,
664 VarsWithInheritedDSAType &VarsWithImplicitDSA);
665 /// Called on well-formed '\#pragma omp taskloop simd' after parsing of
666 /// the associated statement.
668 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
669 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
670 /// Called on well-formed '\#pragma omp master taskloop' after parsing of the
671 /// associated statement.
673 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
674 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
675 /// Called on well-formed '\#pragma omp master taskloop simd' after parsing of
676 /// the associated statement.
678 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
679 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
680 /// Called on well-formed '\#pragma omp parallel master taskloop' after
681 /// parsing of the associated statement.
683 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
684 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
685 /// Called on well-formed '\#pragma omp parallel master taskloop simd' after
686 /// parsing of the associated statement.
688 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
689 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
690 /// Called on well-formed '\#pragma omp masked taskloop' after parsing of the
691 /// associated statement.
693 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
694 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
695 /// Called on well-formed '\#pragma omp masked taskloop simd' after parsing of
696 /// the associated statement.
698 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
699 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
700 /// Called on well-formed '\#pragma omp parallel masked taskloop' after
701 /// parsing of the associated statement.
703 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
704 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
705 /// Called on well-formed '\#pragma omp parallel masked taskloop simd' after
706 /// parsing of the associated statement.
708 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
709 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
710 /// Called on well-formed '\#pragma omp distribute' after parsing
711 /// of the associated statement.
714 SourceLocation StartLoc, SourceLocation EndLoc,
715 VarsWithInheritedDSAType &VarsWithImplicitDSA);
716 /// Called on well-formed '\#pragma omp target update'.
718 SourceLocation StartLoc,
719 SourceLocation EndLoc,
720 Stmt *AStmt);
721 /// Called on well-formed '\#pragma omp distribute parallel for' after
722 /// parsing of the associated statement.
724 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
725 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
726 /// Called on well-formed '\#pragma omp distribute parallel for simd'
727 /// after parsing of the associated statement.
729 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
730 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
731 /// Called on well-formed '\#pragma omp distribute simd' after
732 /// parsing of the associated statement.
734 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
735 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
736 /// Called on well-formed '\#pragma omp target parallel for simd' after
737 /// parsing of the associated statement.
739 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
740 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
741 /// Called on well-formed '\#pragma omp target simd' after parsing of
742 /// the associated statement.
745 SourceLocation StartLoc, SourceLocation EndLoc,
746 VarsWithInheritedDSAType &VarsWithImplicitDSA);
747 /// Called on well-formed '\#pragma omp teams distribute' after parsing of
748 /// the associated statement.
750 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
751 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
752 /// Called on well-formed '\#pragma omp teams distribute simd' after parsing
753 /// of the associated statement.
755 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
756 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
757 /// Called on well-formed '\#pragma omp teams distribute parallel for simd'
758 /// after parsing of the associated statement.
760 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
761 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
762 /// Called on well-formed '\#pragma omp teams distribute parallel for'
763 /// after parsing of the associated statement.
765 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
766 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
767 /// Called on well-formed '\#pragma omp target teams' after parsing of the
768 /// associated statement.
770 Stmt *AStmt,
771 SourceLocation StartLoc,
772 SourceLocation EndLoc);
773 /// Called on well-formed '\#pragma omp target teams distribute' after parsing
774 /// of the associated statement.
776 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
777 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
778 /// Called on well-formed '\#pragma omp target teams distribute parallel for'
779 /// after parsing of the associated statement.
781 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
782 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
783 /// Called on well-formed '\#pragma omp target teams distribute parallel for
784 /// simd' after parsing of the associated statement.
786 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
787 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
788 /// Called on well-formed '\#pragma omp target teams distribute simd' after
789 /// parsing of the associated statement.
791 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
792 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
793 /// Called on well-formed '\#pragma omp interop'.
795 SourceLocation StartLoc,
796 SourceLocation EndLoc);
797 /// Called on well-formed '\#pragma omp dispatch' after parsing of the
798 // /associated statement.
800 Stmt *AStmt, SourceLocation StartLoc,
801 SourceLocation EndLoc);
802 /// Called on well-formed '\#pragma omp masked' after parsing of the
803 // /associated statement.
805 Stmt *AStmt, SourceLocation StartLoc,
806 SourceLocation EndLoc);
807
808 /// Called on well-formed '\#pragma omp loop' after parsing of the
809 /// associated statement.
811 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
812 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
813
814 /// Checks correctness of linear modifiers.
816 SourceLocation LinLoc);
817 /// Checks that the specified declaration matches requirements for the linear
818 /// decls.
821 bool IsDeclareSimd = false);
822
823 /// Called on well-formed '\#pragma omp declare simd' after parsing of
824 /// the associated method/function.
826 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
827 Expr *Simdlen, ArrayRef<Expr *> Uniforms, ArrayRef<Expr *> Aligneds,
828 ArrayRef<Expr *> Alignments, ArrayRef<Expr *> Linears,
829 ArrayRef<unsigned> LinModifiers, ArrayRef<Expr *> Steps, SourceRange SR);
830
831 /// Checks '\#pragma omp declare variant' variant function and original
832 /// functions after parsing of the associated method/function.
833 /// \param DG Function declaration to which declare variant directive is
834 /// applied to.
835 /// \param VariantRef Expression that references the variant function, which
836 /// must be used instead of the original one, specified in \p DG.
837 /// \param TI The trait info object representing the match clause.
838 /// \param NumAppendArgs The number of omp_interop_t arguments to account for
839 /// in checking.
840 /// \returns std::nullopt, if the function/variant function are not compatible
841 /// with the pragma, pair of original function/variant ref expression
842 /// otherwise.
843 std::optional<std::pair<FunctionDecl *, Expr *>>
845 OMPTraitInfo &TI, unsigned NumAppendArgs,
846 SourceRange SR);
847
848 /// Called on well-formed '\#pragma omp declare variant' after parsing of
849 /// the associated method/function.
850 /// \param FD Function declaration to which declare variant directive is
851 /// applied to.
852 /// \param VariantRef Expression that references the variant function, which
853 /// must be used instead of the original one, specified in \p DG.
854 /// \param TI The context traits associated with the function variant.
855 /// \param AdjustArgsNothing The list of 'nothing' arguments.
856 /// \param AdjustArgsNeedDevicePtr The list of 'need_device_ptr' arguments.
857 /// \param AppendArgs The list of 'append_args' arguments.
858 /// \param AdjustArgsLoc The Location of an 'adjust_args' clause.
859 /// \param AppendArgsLoc The Location of an 'append_args' clause.
860 /// \param SR The SourceRange of the 'declare variant' directive.
862 FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI,
863 ArrayRef<Expr *> AdjustArgsNothing,
864 ArrayRef<Expr *> AdjustArgsNeedDevicePtr,
865 ArrayRef<Expr *> AdjustArgsNeedDeviceAddr,
866 ArrayRef<OMPInteropInfo> AppendArgs, SourceLocation AdjustArgsLoc,
867 SourceLocation AppendArgsLoc, SourceRange SR);
868
869 /// Called on device_num selector in context selectors.
870 void ActOnOpenMPDeviceNum(Expr *DeviceNumExpr);
871
873 SourceLocation StartLoc,
874 SourceLocation LParenLoc,
875 SourceLocation EndLoc);
876 /// Called on well-formed 'allocator' clause.
878 SourceLocation StartLoc,
879 SourceLocation LParenLoc,
880 SourceLocation EndLoc);
881 /// Called on well-formed 'if' clause.
883 Expr *Condition, SourceLocation StartLoc,
884 SourceLocation LParenLoc,
885 SourceLocation NameModifierLoc,
886 SourceLocation ColonLoc,
887 SourceLocation EndLoc);
888 /// Called on well-formed 'final' clause.
890 SourceLocation LParenLoc,
891 SourceLocation EndLoc);
892 /// Called on well-formed 'num_threads' clause.
894 OpenMPNumThreadsClauseModifier Modifier, Expr *NumThreads,
895 SourceLocation StartLoc, SourceLocation LParenLoc,
896 SourceLocation ModifierLoc, SourceLocation EndLoc);
897 /// Called on well-formed 'align' clause.
899 SourceLocation LParenLoc,
900 SourceLocation EndLoc);
901 /// Called on well-formed 'safelen' clause.
903 SourceLocation LParenLoc,
904 SourceLocation EndLoc);
905 /// Called on well-formed 'simdlen' clause.
907 SourceLocation LParenLoc,
908 SourceLocation EndLoc);
909 /// Called on well-form 'sizes' clause.
911 SourceLocation StartLoc,
912 SourceLocation LParenLoc,
913 SourceLocation EndLoc);
914 /// Called on well-form 'permutation' clause after parsing its arguments.
916 SourceLocation StartLoc,
917 SourceLocation LParenLoc,
918 SourceLocation EndLoc);
919 /// Called on well-form 'full' clauses.
921 SourceLocation EndLoc);
922 /// Called on well-form 'partial' clauses.
924 SourceLocation LParenLoc,
925 SourceLocation EndLoc);
926 /// Called on well-formed 'collapse' clause.
928 SourceLocation StartLoc,
929 SourceLocation LParenLoc,
930 SourceLocation EndLoc);
931
932 /// Called on well-form 'looprange' clause after parsing its arguments.
933 OMPClause *
935 SourceLocation LParenLoc, SourceLocation FirstLoc,
936 SourceLocation CountLoc, SourceLocation EndLoc);
937 /// Called on well-formed 'ordered' clause.
938 OMPClause *
940 SourceLocation LParenLoc = SourceLocation(),
941 Expr *NumForLoops = nullptr);
942 /// Called on well-formed 'grainsize' clause.
944 Expr *Size, SourceLocation StartLoc,
945 SourceLocation LParenLoc,
946 SourceLocation ModifierLoc,
947 SourceLocation EndLoc);
948 /// Called on well-formed 'num_tasks' clause.
950 Expr *NumTasks, SourceLocation StartLoc,
951 SourceLocation LParenLoc,
952 SourceLocation ModifierLoc,
953 SourceLocation EndLoc);
954 /// Called on well-formed 'hint' clause.
956 SourceLocation LParenLoc,
957 SourceLocation EndLoc);
958 /// Called on well-formed 'detach' clause.
960 SourceLocation LParenLoc,
961 SourceLocation EndLoc);
962
963 OMPClause *ActOnOpenMPSimpleClause(OpenMPClauseKind Kind, unsigned Argument,
964 SourceLocation ArgumentLoc,
965 SourceLocation StartLoc,
966 SourceLocation LParenLoc,
967 SourceLocation EndLoc);
968 /// Called on well-formed 'when' clause.
970 SourceLocation LParenLoc,
971 SourceLocation EndLoc);
972 /// Called on well-formed 'default' clause.
973 OMPClause *
974 ActOnOpenMPDefaultClause(llvm::omp::DefaultKind M, SourceLocation MLoc,
976 SourceLocation VCKindLoc, SourceLocation StartLoc,
977 SourceLocation LParenLoc, SourceLocation EndLoc);
978 /// Called on well-formed 'proc_bind' clause.
979 OMPClause *ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind,
980 SourceLocation KindLoc,
981 SourceLocation StartLoc,
982 SourceLocation LParenLoc,
983 SourceLocation EndLoc);
984 /// Called on well-formed 'order' clause.
987 SourceLocation StartLoc,
988 SourceLocation LParenLoc,
989 SourceLocation MLoc, SourceLocation KindLoc,
990 SourceLocation EndLoc);
991 /// Called on well-formed 'update' clause.
993 SourceLocation KindLoc,
994 SourceLocation StartLoc,
995 SourceLocation LParenLoc,
996 SourceLocation EndLoc);
997 /// Called on well-formed 'holds' clause.
999 SourceLocation LParenLoc,
1000 SourceLocation EndLoc);
1001 /// Called on well-formed 'absent' or 'contains' clauses.
1006 SourceLocation Loc,
1007 SourceLocation RLoc);
1008
1010 OpenMPClauseKind Kind, ArrayRef<unsigned> Arguments, Expr *Expr,
1011 SourceLocation StartLoc, SourceLocation LParenLoc,
1012 ArrayRef<SourceLocation> ArgumentsLoc, SourceLocation DelimLoc,
1013 SourceLocation EndLoc);
1014 /// Called on well-formed 'schedule' clause.
1017 OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc,
1018 SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc,
1019 SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc);
1020
1022 SourceLocation EndLoc);
1023 /// Called on well-formed 'nowait' clause.
1025 SourceLocation EndLoc);
1026 /// Called on well-formed 'untied' clause.
1028 SourceLocation EndLoc);
1029 /// Called on well-formed 'mergeable' clause.
1031 SourceLocation EndLoc);
1032 /// Called on well-formed 'read' clause.
1034 SourceLocation EndLoc);
1035 /// Called on well-formed 'write' clause.
1037 SourceLocation EndLoc);
1038 /// Called on well-formed 'update' clause.
1040 SourceLocation EndLoc);
1041 /// Called on well-formed 'capture' clause.
1043 SourceLocation EndLoc);
1044 /// Called on well-formed 'compare' clause.
1046 SourceLocation EndLoc);
1047 /// Called on well-formed 'fail' clause.
1049 SourceLocation EndLoc);
1051 SourceLocation KindLoc,
1052 SourceLocation StartLoc,
1053 SourceLocation LParenLoc,
1054 SourceLocation EndLoc);
1055
1056 /// Called on well-formed 'seq_cst' clause.
1058 SourceLocation EndLoc);
1059 /// Called on well-formed 'acq_rel' clause.
1061 SourceLocation EndLoc);
1062 /// Called on well-formed 'acquire' clause.
1064 SourceLocation EndLoc);
1065 /// Called on well-formed 'release' clause.
1067 SourceLocation EndLoc);
1068 /// Called on well-formed 'relaxed' clause.
1070 SourceLocation EndLoc);
1071 /// Called on well-formed 'weak' clause.
1073 SourceLocation EndLoc);
1074
1075 /// Called on well-formed 'init' clause.
1076 OMPClause *
1077 ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo,
1078 SourceLocation StartLoc, SourceLocation LParenLoc,
1079 SourceLocation VarLoc, SourceLocation EndLoc);
1080
1081 /// Called on well-formed 'use' clause.
1082 OMPClause *ActOnOpenMPUseClause(Expr *InteropVar, SourceLocation StartLoc,
1083 SourceLocation LParenLoc,
1084 SourceLocation VarLoc, SourceLocation EndLoc);
1085
1086 /// Called on well-formed 'destroy' clause.
1088 SourceLocation LParenLoc,
1089 SourceLocation VarLoc,
1090 SourceLocation EndLoc);
1091 /// Called on well-formed 'novariants' clause.
1093 SourceLocation StartLoc,
1094 SourceLocation LParenLoc,
1095 SourceLocation EndLoc);
1096 /// Called on well-formed 'nocontext' clause.
1098 SourceLocation StartLoc,
1099 SourceLocation LParenLoc,
1100 SourceLocation EndLoc);
1101 /// Called on well-formed 'filter' clause.
1103 SourceLocation LParenLoc,
1104 SourceLocation EndLoc);
1105 /// Called on well-formed 'threads' clause.
1107 SourceLocation EndLoc);
1108 /// Called on well-formed 'simd' clause.
1110 SourceLocation EndLoc);
1111 /// Called on well-formed 'nogroup' clause.
1113 SourceLocation EndLoc);
1114 /// Called on well-formed 'unified_address' clause.
1116 SourceLocation EndLoc);
1117
1118 /// Called on well-formed 'unified_address' clause.
1120 SourceLocation EndLoc);
1121
1122 /// Called on well-formed 'reverse_offload' clause.
1124 SourceLocation EndLoc);
1125
1126 /// Called on well-formed 'dynamic_allocators' clause.
1128 SourceLocation EndLoc);
1129
1130 /// Called on well-formed 'atomic_default_mem_order' clause.
1133 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1134
1135 /// Called on well-formed 'self_maps' clause.
1137 SourceLocation EndLoc);
1138
1139 /// Called on well-formed 'at' clause.
1141 SourceLocation KindLoc,
1142 SourceLocation StartLoc,
1143 SourceLocation LParenLoc,
1144 SourceLocation EndLoc);
1145
1146 /// Called on well-formed 'severity' clause.
1148 SourceLocation KindLoc,
1149 SourceLocation StartLoc,
1150 SourceLocation LParenLoc,
1151 SourceLocation EndLoc);
1152
1153 /// Called on well-formed 'message' clause.
1154 /// passing string for message.
1156 SourceLocation LParenLoc,
1157 SourceLocation EndLoc);
1158
1159 /// Data used for processing a list of variables in OpenMP clauses.
1160 struct OpenMPVarListDataTy final {
1162 Expr *IteratorExpr = nullptr;
1167 int ExtraModifier = -1; ///< Additional modifier for linear, map, depend or
1168 ///< lastprivate clause.
1169 int OriginalSharingModifier = 0; // Default is shared
1177 bool IsMapTypeImplicit = false;
1182 StepModifierLoc; /// 'step' modifier location for linear clause
1195 };
1196
1198 ArrayRef<Expr *> Vars,
1199 const OMPVarListLocTy &Locs,
1200 OpenMPVarListDataTy &Data);
1201 /// Called on well-formed 'inclusive' clause.
1203 SourceLocation StartLoc,
1204 SourceLocation LParenLoc,
1205 SourceLocation EndLoc);
1206 /// Called on well-formed 'exclusive' clause.
1208 SourceLocation StartLoc,
1209 SourceLocation LParenLoc,
1210 SourceLocation EndLoc);
1211 /// Called on well-formed 'allocate' clause.
1212 OMPClause *
1213 ActOnOpenMPAllocateClause(Expr *Allocator, Expr *Alignment,
1214 OpenMPAllocateClauseModifier FirstModifier,
1215 SourceLocation FirstModifierLoc,
1216 OpenMPAllocateClauseModifier SecondModifier,
1217 SourceLocation SecondModifierLoc,
1218 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1219 SourceLocation ColonLoc, SourceLocation LParenLoc,
1220 SourceLocation EndLoc);
1221 /// Called on well-formed 'private' clause.
1223 SourceLocation StartLoc,
1224 SourceLocation LParenLoc,
1225 SourceLocation EndLoc);
1226 /// Called on well-formed 'firstprivate' clause.
1228 SourceLocation StartLoc,
1229 SourceLocation LParenLoc,
1230 SourceLocation EndLoc);
1231 /// Called on well-formed 'lastprivate' clause.
1234 SourceLocation LPKindLoc, SourceLocation ColonLoc,
1235 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1236 /// Called on well-formed 'shared' clause.
1238 SourceLocation StartLoc,
1239 SourceLocation LParenLoc,
1240 SourceLocation EndLoc);
1241 /// Called on well-formed 'reduction' clause.
1243 ArrayRef<Expr *> VarList,
1244 OpenMPVarListDataTy::OpenMPReductionClauseModifiers Modifiers,
1245 SourceLocation StartLoc, SourceLocation LParenLoc,
1246 SourceLocation ModifierLoc, SourceLocation ColonLoc,
1247 SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec,
1248 const DeclarationNameInfo &ReductionId,
1249 ArrayRef<Expr *> UnresolvedReductions = {});
1250 /// Called on well-formed 'task_reduction' clause.
1252 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1253 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1254 CXXScopeSpec &ReductionIdScopeSpec,
1255 const DeclarationNameInfo &ReductionId,
1256 ArrayRef<Expr *> UnresolvedReductions = {});
1257 /// Called on well-formed 'in_reduction' clause.
1259 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1260 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1261 CXXScopeSpec &ReductionIdScopeSpec,
1262 const DeclarationNameInfo &ReductionId,
1263 ArrayRef<Expr *> UnresolvedReductions = {});
1264 /// Called on well-formed 'linear' clause.
1265 OMPClause *ActOnOpenMPLinearClause(
1266 ArrayRef<Expr *> VarList, Expr *Step, SourceLocation StartLoc,
1267 SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind,
1268 SourceLocation LinLoc, SourceLocation ColonLoc,
1269 SourceLocation StepModifierLoc, SourceLocation EndLoc);
1270 /// Called on well-formed 'aligned' clause.
1271 OMPClause *ActOnOpenMPAlignedClause(ArrayRef<Expr *> VarList, Expr *Alignment,
1272 SourceLocation StartLoc,
1273 SourceLocation LParenLoc,
1274 SourceLocation ColonLoc,
1275 SourceLocation EndLoc);
1276 /// Called on well-formed 'copyin' clause.
1277 OMPClause *ActOnOpenMPCopyinClause(ArrayRef<Expr *> VarList,
1278 SourceLocation StartLoc,
1279 SourceLocation LParenLoc,
1280 SourceLocation EndLoc);
1281 /// Called on well-formed 'copyprivate' clause.
1282 OMPClause *ActOnOpenMPCopyprivateClause(ArrayRef<Expr *> VarList,
1283 SourceLocation StartLoc,
1284 SourceLocation LParenLoc,
1285 SourceLocation EndLoc);
1286 /// Called on well-formed 'flush' pseudo clause.
1287 OMPClause *ActOnOpenMPFlushClause(ArrayRef<Expr *> VarList,
1288 SourceLocation StartLoc,
1289 SourceLocation LParenLoc,
1290 SourceLocation EndLoc);
1291 /// Called on well-formed 'depobj' pseudo clause.
1292 OMPClause *ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc,
1293 SourceLocation LParenLoc,
1294 SourceLocation EndLoc);
1295 /// Called on well-formed 'depend' clause.
1296 OMPClause *ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data,
1297 Expr *DepModifier,
1298 ArrayRef<Expr *> VarList,
1299 SourceLocation StartLoc,
1300 SourceLocation LParenLoc,
1301 SourceLocation EndLoc);
1302 /// Called on well-formed 'device' clause.
1304 Expr *Device, SourceLocation StartLoc,
1305 SourceLocation LParenLoc,
1306 SourceLocation ModifierLoc,
1307 SourceLocation EndLoc);
1308 /// Called on well-formed 'map' clause.
1309 OMPClause *ActOnOpenMPMapClause(
1310 Expr *IteratorModifier, ArrayRef<OpenMPMapModifierKind> MapTypeModifiers,
1311 ArrayRef<SourceLocation> MapTypeModifiersLoc,
1312 CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
1313 OpenMPMapClauseKind MapType, bool IsMapTypeImplicit,
1314 SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
1315 const OMPVarListLocTy &Locs, bool NoDiagnose = false,
1316 ArrayRef<Expr *> UnresolvedMappers = {});
1317 /// Called on well-formed 'num_teams' clause.
1318 OMPClause *ActOnOpenMPNumTeamsClause(ArrayRef<Expr *> VarList,
1319 SourceLocation StartLoc,
1320 SourceLocation LParenLoc,
1321 SourceLocation EndLoc);
1322 /// Called on well-formed 'thread_limit' clause.
1323 OMPClause *ActOnOpenMPThreadLimitClause(ArrayRef<Expr *> VarList,
1324 SourceLocation StartLoc,
1325 SourceLocation LParenLoc,
1326 SourceLocation EndLoc);
1327 /// Called on well-formed 'priority' clause.
1328 OMPClause *ActOnOpenMPPriorityClause(Expr *Priority, SourceLocation StartLoc,
1329 SourceLocation LParenLoc,
1330 SourceLocation EndLoc);
1331 /// Called on well-formed 'dist_schedule' clause.
1333 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
1334 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc,
1335 SourceLocation CommaLoc, SourceLocation EndLoc);
1336 /// Called on well-formed 'defaultmap' clause.
1337 OMPClause *ActOnOpenMPDefaultmapClause(
1339 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc,
1340 SourceLocation KindLoc, SourceLocation EndLoc);
1341 /// Called on well-formed 'to' clause.
1342 OMPClause *
1343 ActOnOpenMPToClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1344 ArrayRef<SourceLocation> MotionModifiersLoc,
1345 CXXScopeSpec &MapperIdScopeSpec,
1346 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1347 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1348 ArrayRef<Expr *> UnresolvedMappers = {});
1349 /// Called on well-formed 'from' clause.
1350 OMPClause *
1351 ActOnOpenMPFromClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1352 ArrayRef<SourceLocation> MotionModifiersLoc,
1353 CXXScopeSpec &MapperIdScopeSpec,
1354 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1355 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1356 ArrayRef<Expr *> UnresolvedMappers = {});
1357 /// Called on well-formed 'use_device_ptr' clause.
1358 OMPClause *ActOnOpenMPUseDevicePtrClause(ArrayRef<Expr *> VarList,
1359 const OMPVarListLocTy &Locs);
1360 /// Called on well-formed 'use_device_addr' clause.
1361 OMPClause *ActOnOpenMPUseDeviceAddrClause(ArrayRef<Expr *> VarList,
1362 const OMPVarListLocTy &Locs);
1363 /// Called on well-formed 'is_device_ptr' clause.
1364 OMPClause *ActOnOpenMPIsDevicePtrClause(ArrayRef<Expr *> VarList,
1365 const OMPVarListLocTy &Locs);
1366 /// Called on well-formed 'has_device_addr' clause.
1367 OMPClause *ActOnOpenMPHasDeviceAddrClause(ArrayRef<Expr *> VarList,
1368 const OMPVarListLocTy &Locs);
1369 /// Called on well-formed 'nontemporal' clause.
1370 OMPClause *ActOnOpenMPNontemporalClause(ArrayRef<Expr *> VarList,
1371 SourceLocation StartLoc,
1372 SourceLocation LParenLoc,
1373 SourceLocation EndLoc);
1374
1375 /// Data for list of allocators.
1377 /// Allocator.
1378 Expr *Allocator = nullptr;
1379 /// Allocator traits.
1381 /// Locations of '(' and ')' symbols.
1383 };
1384 /// Called on well-formed 'uses_allocators' clause.
1386 SourceLocation LParenLoc,
1387 SourceLocation EndLoc,
1389 /// Called on well-formed 'affinity' clause.
1391 SourceLocation LParenLoc,
1392 SourceLocation ColonLoc,
1393 SourceLocation EndLoc, Expr *Modifier,
1394 ArrayRef<Expr *> Locators);
1395 /// Called on a well-formed 'bind' clause.
1397 SourceLocation KindLoc,
1398 SourceLocation StartLoc,
1399 SourceLocation LParenLoc,
1400 SourceLocation EndLoc);
1401
1402 /// Called on a well-formed 'ompx_dyn_cgroup_mem' clause.
1404 SourceLocation LParenLoc,
1405 SourceLocation EndLoc);
1406
1407 /// Called on well-formed 'doacross' clause.
1408 OMPClause *
1410 SourceLocation DepLoc, SourceLocation ColonLoc,
1411 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1412 SourceLocation LParenLoc, SourceLocation EndLoc);
1413
1414 /// Called on a well-formed 'ompx_attribute' clause.
1416 SourceLocation StartLoc,
1417 SourceLocation LParenLoc,
1418 SourceLocation EndLoc);
1419
1420 /// Called on a well-formed 'ompx_bare' clause.
1422 SourceLocation EndLoc);
1423
1425 Expr *LowerBound,
1426 SourceLocation ColonLocFirst,
1427 SourceLocation ColonLocSecond,
1428 Expr *Length, Expr *Stride,
1429 SourceLocation RBLoc);
1431 SourceLocation RParenLoc,
1432 ArrayRef<Expr *> Dims,
1433 ArrayRef<SourceRange> Brackets);
1434
1435 /// Data structure for iterator expression.
1445
1447 SourceLocation LLoc, SourceLocation RLoc,
1449
1450 void handleOMPAssumeAttr(Decl *D, const ParsedAttr &AL);
1451
1452 /// Setter and getter functions for device_num.
1453 void setOpenMPDeviceNum(int Num);
1454
1455 int getOpenMPDeviceNum() const;
1456
1457 void setOpenMPDeviceNumID(StringRef ID);
1458
1459private:
1460 void *VarDataSharingAttributesStack;
1461
1462 /// Number of nested '#pragma omp declare target' directives.
1463 SmallVector<DeclareTargetContextInfo, 4> DeclareTargetNesting;
1464
1465 /// Initialization of data-sharing attributes stack.
1466 void InitDataSharingAttributesStack();
1467 void DestroyDataSharingAttributesStack();
1468
1469 /// Returns OpenMP nesting level for current directive.
1470 unsigned getOpenMPNestingLevel() const;
1471
1472 /// Adjusts the function scopes index for the target-based regions.
1473 void adjustOpenMPTargetScopeIndex(unsigned &FunctionScopesIndex,
1474 unsigned Level) const;
1475
1476 /// Returns the number of scopes associated with the construct on the given
1477 /// OpenMP level.
1478 int getNumberOfConstructScopes(unsigned Level) const;
1479
1480 /// Push new OpenMP function region for non-capturing function.
1481 void pushOpenMPFunctionRegion();
1482
1483 /// Pop OpenMP function region for non-capturing function.
1484 void popOpenMPFunctionRegion(const sema::FunctionScopeInfo *OldFSI);
1485
1486 /// Analyzes and checks a loop nest for use by a loop transformation.
1487 ///
1488 /// \param Kind The loop transformation directive kind.
1489 /// \param NumLoops How many nested loops the directive is expecting.
1490 /// \param AStmt Associated statement of the transformation directive.
1491 /// \param LoopHelpers [out] The loop analysis result.
1492 /// \param Body [out] The body code nested in \p NumLoops loop.
1493 /// \param OriginalInits [out] Collection of statements and declarations that
1494 /// must have been executed/declared before entering the
1495 /// loop.
1496 ///
1497 /// \return Whether there was any error.
1498 bool checkTransformableLoopNest(
1499 OpenMPDirectiveKind Kind, Stmt *AStmt, int NumLoops,
1501 Stmt *&Body, SmallVectorImpl<SmallVector<Stmt *>> &OriginalInits);
1502
1503 /// Holds the result of the analysis of a (possibly canonical) loop.
1504 struct LoopAnalysis {
1505 /// The analyzed loop or loop transformation.
1506 Stmt *AStmt = nullptr;
1507 /// Loop analyses results.
1508 OMPLoopBasedDirective::HelperExprs HelperExprs;
1509 /// The for-statement of the loop. TheForStmt equals AStmt only when the
1510 /// latter is a canonical loop (i.e. not a loop transformation).
1511 Stmt *TheForStmt = nullptr;
1512 /// Initialization statements before transformations.
1513 SmallVector<Stmt *> OriginalInits;
1514 /// Initialization statements required after transformation of this loop.
1515 SmallVector<Stmt *> TransformsPreInits;
1516
1517 explicit LoopAnalysis(Stmt *S) : AStmt(S) {}
1518
1519 bool isRegularLoop() const { return isRegularLoop(AStmt); }
1520 bool isLoopTransformation() const { return isLoopTransformation(AStmt); }
1521
1522 // Convenience functions used when building LoopSequenceAnalysis.
1523 static bool isRegularLoop(Stmt *S) {
1525 }
1526 static bool isLoopTransformation(Stmt *S) {
1528 }
1529 };
1530
1531 /// Holds the result of the analysis of a (possibly canonical) loop sequence.
1532 struct LoopSequenceAnalysis {
1533 /// Number of top level canonical loops.
1534 unsigned LoopSeqSize = 0;
1535 /// For each loop results of the analysis.
1536 SmallVector<LoopAnalysis, 2> Loops;
1537 /// Additional code required before entering the transformed loop sequence.
1538 SmallVector<Stmt *> LoopSequencePreInits;
1539
1540 // Convenience function used when building the LoopSequenceAnalysis.
1541 static bool isLoopSequenceDerivation(Stmt *S) {
1542 return LoopAnalysis::isRegularLoop(S) ||
1543 LoopAnalysis::isLoopTransformation(S);
1544 }
1545 };
1546
1547 /// The main recursive process of `checkTransformableLoopSequence` that
1548 /// performs grammatical parsing of a canonical loop sequence. It extracts
1549 /// key information, such as the number of top-level loops, loop statements,
1550 /// helper expressions, and other relevant loop-related data, all in a single
1551 /// execution to avoid redundant traversals. This analysis flattens inner
1552 /// Loop Sequences
1553 ///
1554 /// \param LoopSeqStmt The AST of the original statement.
1555 /// \param SeqAnalysis [out] Result of the analysis of \p LoopSeqStmt
1556 /// \param Context
1557 /// \param Kind The loop transformation directive kind.
1558 /// \return Whether the original statement is both syntactically and
1559 /// semantically correct according to OpenMP 6.0 canonical loop
1560 /// sequence definition.
1561 bool analyzeLoopSequence(Stmt *LoopSeqStmt, LoopSequenceAnalysis &SeqAnalysis,
1562 ASTContext &Context, OpenMPDirectiveKind Kind);
1563
1564 /// Validates and checks whether a loop sequence can be transformed according
1565 /// to the given directive, providing necessary setup and initialization
1566 /// (Driver function) before recursion using `analyzeLoopSequence`.
1567 ///
1568 /// \param Kind The loop transformation directive kind.
1569 /// \param AStmt The AST of the original statement
1570 /// \param SeqAnalysis [out] Result of the analysis of \p LoopSeqStmt
1571 /// \param Context
1572 /// \return Whether there was an absence of errors or not
1573 bool checkTransformableLoopSequence(OpenMPDirectiveKind Kind, Stmt *AStmt,
1574 LoopSequenceAnalysis &SeqAnalysis,
1575 ASTContext &Context);
1576
1577 /// Helper to keep information about the current `omp begin/end declare
1578 /// variant` nesting.
1579 struct OMPDeclareVariantScope {
1580 /// The associated OpenMP context selector.
1581 OMPTraitInfo *TI;
1582
1583 /// The associated OpenMP context selector mangling.
1584 std::string NameSuffix;
1585
1586 OMPDeclareVariantScope(OMPTraitInfo &TI);
1587 };
1588
1589 /// Return the OMPTraitInfo for the surrounding scope, if any.
1590 OMPTraitInfo *getOMPTraitInfoForSurroundingScope() {
1591 return OMPDeclareVariantScopes.empty() ? nullptr
1592 : OMPDeclareVariantScopes.back().TI;
1593 }
1594
1595 /// The current `omp begin/end declare variant` scopes.
1596 SmallVector<OMPDeclareVariantScope, 4> OMPDeclareVariantScopes;
1597
1598 /// The current `omp begin/end assumes` scopes.
1599 SmallVector<OMPAssumeAttr *, 4> OMPAssumeScoped;
1600
1601 /// All `omp assumes` we encountered so far.
1602 SmallVector<OMPAssumeAttr *, 4> OMPAssumeGlobal;
1603
1604 /// Device number specified by the context selector.
1605 int DeviceNum = -1;
1606
1607 /// Device number identifier specified by the context selector.
1608 StringRef DeviceNumID;
1609};
1610
1611} // namespace clang
1612
1613#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:73
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition DeclBase.h:1449
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
The name of a declaration.
Information about one declarator, including the parsed type information and the identifier.
Definition DeclSpec.h:1874
This represents one expression.
Definition Expr.h:112
Represents a member of a struct/union/class.
Definition Decl.h:3157
Represents a function declaration or definition.
Definition Decl.h:1999
One of these records is kept for each identifier that is lexed.
This represents a decl that may have a name.
Definition Decl.h:273
This is a basic class for representing single OpenMP clause.
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
Helper data structure representing the traits in a match clause of an declare variant or metadirectiv...
Wrapper for void* pointer.
Definition Ownership.h:51
ParsedAttr - Represents a syntactic attribute.
Definition ParsedAttr.h:119
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 * 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 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...
OMPClause * ActOnOpenMPToClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'to' clause.
StmtResult ActOnOpenMPParallelMaskedDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel masked' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetTeamsDistributeParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute parallel for' after parsing of the associa...
OMPClause * ActOnOpenMPPrivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'private' clause.
void StartOpenMPClause(OpenMPClauseKind K)
Start analysis of clauses.
bool CheckOpenMPLinearModifier(OpenMPLinearClauseKind LinKind, SourceLocation LinLoc)
Checks correctness of linear modifiers.
ExprResult ActOnOpenMPDeclareMapperDirectiveVarDecl(Scope *S, QualType MapperType, SourceLocation StartLoc, DeclarationName VN)
Build the mapper variable of 'pragma omp declare mapper'.
OMPClause * ActOnOpenMPOrderedClause(SourceLocation StartLoc, SourceLocation EndLoc, SourceLocation LParenLoc=SourceLocation(), Expr *NumForLoops=nullptr)
Called on well-formed 'ordered' clause.
OMPClause * ActOnOpenMPSelfMapsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'self_maps' clause.
bool CheckOpenMPLinearDecl(const ValueDecl *D, SourceLocation ELoc, OpenMPLinearClauseKind LinKind, QualType Type, bool IsDeclareSimd=false)
Checks that the specified declaration matches requirements for the linear decls.
OMPClause * ActOnOpenMPIsDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'is_device_ptr' clause.
OMPClause * ActOnOpenMPHasDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'has_device_addr' clause.
StmtResult ActOnOpenMPErrorDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, bool InExContext=true)
Called on well-formed '#pragma omp error'.
OMPClause * ActOnOpenMPPartialClause(Expr *FactorExpr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'partial' clauses.
StmtResult ActOnOpenMPSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPLastprivateClause(ArrayRef< Expr * > VarList, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'lastprivate' clause.
void ActOnOpenMPDeclareTargetName(NamedDecl *ND, SourceLocation Loc, OMPDeclareTargetDeclAttr::MapTypeTy MT, DeclareTargetContextInfo &DTCI)
Called on correct id-expression from the 'pragma omp declare target'.
DeclGroupPtrTy ActOnOpenMPRequiresDirective(SourceLocation Loc, ArrayRef< OMPClause * > ClauseList)
Called on well-formed 'pragma omp requires'.
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 * ActOnOpenMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'nowait' 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 * ActOnOpenMPFromClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'from' clause.
OMPClause * ActOnOpenMPBindClause(OpenMPBindClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'bind' clause.
OMPClause * ActOnOpenMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'threads' clause.
OMPClause * ActOnOpenMPThreadLimitClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'thread_limit' clause.
OMPClause * ActOnOpenMPSharedClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'shared' clause.
StmtResult ActOnOpenMPTargetExitDataDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AStmt)
Called on well-formed '#pragma omp target exit data' after parsing of the associated statement.
StmtResult ActOnOpenMPTeamsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp teams' after parsing of the associated statement.
OMPClause * ActOnOpenMPCopyinClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyin' clause.
OMPClause * ActOnOpenMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'mergeable' clause.
void startOpenMPCXXRangeFor()
If the current region is a range loop-based region, mark the start of the loop construct.
OMPClause * ActOnOpenMPDestroyClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'destroy' clause.
StmtResult ActOnOpenMPParallelMaskedTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel masked taskloop' after parsing of the associated statemen...
OMPClause * ActOnOpenMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, Expr *Modifier, ArrayRef< Expr * > Locators)
Called on well-formed 'affinity' clause.
OMPClause * ActOnOpenMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'compare' clause.
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,...
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:53
ExprResult ActOnOpenMPIdExpression(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id, OpenMPDirectiveKind Kind)
Called on correct id-expression from the 'pragma omp threadprivate'.
void ActOnOpenMPEndAssumesDirective()
Called on well-formed 'pragma omp end assumes'.
OMPClause * ActOnOpenMPNogroupClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'nogroup' clause.
OMPClause * ActOnOpenMPGrainsizeClause(OpenMPGrainsizeClauseModifier Modifier, Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'grainsize' clause.
ExprResult ActOnOMPArraySectionExpr(Expr *Base, SourceLocation LBLoc, Expr *LowerBound, SourceLocation ColonLocFirst, SourceLocation ColonLocSecond, Expr *Length, Expr *Stride, SourceLocation RBLoc)
bool isOpenMPRebuildMemberExpr(ValueDecl *D)
The member expression(this->fd) needs to be rebuilt in the template instantiation to generate private...
void ActOnOpenMPDeviceNum(Expr *DeviceNumExpr)
Called on device_num selector in context selectors.
QualType ActOnOpenMPDeclareReductionType(SourceLocation TyLoc, TypeResult ParsedType)
Check if the specified type is allowed to be used in 'omp declare reduction' construct.
StmtResult ActOnOpenMPMaskedTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp masked taskloop simd' after parsing of the associated statement.
bool isOpenMPCapturedByRef(const ValueDecl *D, unsigned Level, unsigned OpenMPCaptureLevel) const
Return true if the provided declaration VD should be captured by reference.
OMPClause * ActOnOpenMPWhenClause(OMPTraitInfo &TI, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'when' clause.
StmtResult ActOnOpenMPParallelGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel loop' after parsing of the associated statement.
DeclGroupPtrTy ActOnOpenMPAllocateDirective(SourceLocation Loc, ArrayRef< Expr * > VarList, ArrayRef< OMPClause * > Clauses, DeclContext *Owner=nullptr)
Called on well-formed 'pragma omp allocate'.
OMPClause * ActOnOpenMPSimpleClause(OpenMPClauseKind Kind, unsigned Argument, SourceLocation ArgumentLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
OMPClause * ActOnOpenMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'unified_address' clause.
static int getOpenMPCaptureLevels(OpenMPDirectiveKind Kind)
Return the number of captured regions created for an OpenMP directive.
bool isOpenMPTargetCapturedDecl(const ValueDecl *D, unsigned Level, unsigned CaptureLevel) const
Check if the specified variable is captured by 'target' directive.
StmtResult ActOnOpenMPParallelMaskedTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel masked taskloop simd' after parsing of the associated sta...
OMPClause * ActOnOpenMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'dynamic_allocators' clause.
StmtResult ActOnOpenMPScopeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp scope' after parsing of the associated statement.
void ActOnOpenMPIteratorVarDecl(VarDecl *VD)
bool isInOpenMPDeclareVariantScope() const
Can we exit an OpenMP declare variant scope at the moment.
Definition SemaOpenMP.h:111
StmtResult ActOnOpenMPDistributeParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute parallel for simd' after parsing of the associated stat...
StmtResult ActOnOpenMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp barrier'.
TypeResult ActOnOpenMPDeclareMapperVarDecl(Scope *S, Declarator &D)
Check variable declaration in 'omp declare mapper' construct.
ExprResult ActOnOMPIteratorExpr(Scope *S, SourceLocation IteratorKwLoc, SourceLocation LLoc, SourceLocation RLoc, ArrayRef< OMPIteratorData > Data)
OMPClause * ActOnOpenMPUsesAllocatorClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< UsesAllocatorsData > Data)
Called on well-formed 'uses_allocators' clause.
StmtResult ActOnOpenMPRegionEnd(StmtResult S, ArrayRef< OMPClause * > Clauses)
End of OpenMP region.
DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveStart(Scope *S, DeclContext *DC, DeclarationName Name, ArrayRef< std::pair< QualType, SourceLocation > > ReductionTypes, AccessSpecifier AS, Decl *PrevDeclInScope=nullptr)
Called on start of 'pragma omp declare reduction'.
OMPClause * ActOnOpenMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'acq_rel' clause.
OMPClause * ActOnOpenMPAllocatorClause(Expr *Allocator, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'allocator' clause.
ExprResult VerifyPositiveIntegerConstantInClause(Expr *Op, OpenMPClauseKind CKind, bool StrictlyPositive=true, bool SuppressExprDiags=false)
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:252
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:436
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:249
void setOpenMPDeviceNumID(StringRef ID)
StmtResult ActOnOpenMPDistributeParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute parallel for' after parsing of the associated statement...
QualType ActOnOpenMPDeclareMapperType(SourceLocation TyLoc, TypeResult ParsedType)
Check if the specified type is allowed to be used in 'omp declare mapper' construct.
StmtResult ActOnOpenMPTeamsDistributeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetTeamsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target teams' after parsing of the associated statement.
OMPClause * ActOnOpenMPMessageClause(Expr *MS, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'message' clause.
int getOpenMPDeviceNum() const
StmtResult ActOnOpenMPScanDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp scan'.
OMPClause * ActOnOpenMPScheduleClause(OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2, OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc, SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc)
Called on well-formed 'schedule' clause.
void ActOnOpenMPLoopInitialization(SourceLocation ForLoc, Stmt *Init)
Check if the current region is an OpenMP loop region and if it is, mark loop control variable,...
OMPClause * ActOnOpenMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'unified_address' clause.
void DiagnoseUnterminatedOpenMPDeclareTarget()
Report unterminated 'omp declare target' or 'omp begin declare target' at the end of a compilation un...
void finalizeOpenMPDelayedAnalysis(const FunctionDecl *Caller, const FunctionDecl *Callee, SourceLocation Loc)
Finishes analysis of the deferred functions calls that may be declared as host/nohost during device/h...
OMPClause * ActOnOpenMPSimdlenClause(Expr *Length, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'simdlen' clause.
std::optional< std::pair< FunctionDecl *, Expr * > > checkOpenMPDeclareVariantFunction(DeclGroupPtrTy DG, Expr *VariantRef, OMPTraitInfo &TI, unsigned NumAppendArgs, SourceRange SR)
Checks '#pragma omp declare variant' variant function and original functions after parsing of the ass...
OMPClause * ActOnOpenMPUseDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'use_device_ptr' clause.
StmtResult ActOnOpenMPParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel for simd' after parsing of the associated statement.
OpaquePtr< DeclGroupRef > DeclGroupPtrTy
Definition SemaOpenMP.h:55
OMPClause * ActOnOpenMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'release' clause.
OMPClause * ActOnOpenMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'acquire' clause.
OMPClause * ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'proc_bind' clause.
OMPClause * ActOnOpenMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'simd' clause.
OMPClause * ActOnOpenMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_bare' clause.
StmtResult ActOnOpenMPInformationalDirective(OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Process an OpenMP informational directive.
StmtResult ActOnOpenMPCanonicalLoop(Stmt *AStmt)
Called for syntactical loops (ForStmt or CXXForRangeStmt) associated to an OpenMP loop directive.
OMPClause * ActOnOpenMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'hint' clause.
OMPClause * ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
OMPClause * ActOnOpenMPNullaryAssumptionClause(OpenMPClauseKind CK, SourceLocation Loc, SourceLocation RLoc)
StmtResult ActOnOpenMPTargetTeamsDistributeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute' after parsing of the associated statement...
StmtResult ActOnOpenMPParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel for' after parsing of the associated statement.
OMPClause * ActOnOpenMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'capture' clause.
StmtResult ActOnOpenMPForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp for' after parsing of the associated statement.
StmtResult ActOnOpenMPAtomicDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp atomic' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetUpdateDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AStmt)
Called on well-formed '#pragma omp target update'.
StmtResult ActOnOpenMPOrderedDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp ordered' after parsing of the associated statement.
StmtResult ActOnOpenMPReverseDirective(Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'pragma omp reverse'.
ExprResult ActOnOMPArrayShapingExpr(Expr *Base, SourceLocation LParenLoc, SourceLocation RParenLoc, ArrayRef< Expr * > Dims, ArrayRef< SourceRange > Brackets)
OMPClause * ActOnOpenMPNumThreadsClause(OpenMPNumThreadsClauseModifier Modifier, Expr *NumThreads, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'num_threads' clause.
OMPClause * ActOnOpenMPAtClause(OpenMPAtClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'at' clause.
StmtResult ActOnOpenMPTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp taskloop' after parsing of the associated statement.
OMPClause * ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'init' clause.
OMPClause * ActOnOpenMPUseDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'use_device_addr' clause.
void ActOnOpenMPDeclareReductionCombinerStart(Scope *S, Decl *D)
Initialize declare reduction construct initializer.
OMPClause * ActOnOpenMPAllocateClause(Expr *Allocator, Expr *Alignment, OpenMPAllocateClauseModifier FirstModifier, SourceLocation FirstModifierLoc, OpenMPAllocateClauseModifier SecondModifier, SourceLocation SecondModifierLoc, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation ColonLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'allocate' clause.
std::pair< StringRef, QualType > CapturedParamNameType
Definition SemaOpenMP.h:56
OMPClause * ActOnOpenMPFinalClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'final' clause.
bool isInOpenMPTargetExecutionDirective() const
Return true inside OpenMP target region.
StmtResult ActOnOpenMPTargetDataDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target data' after parsing of the associated statement.
StmtResult ActOnOpenMPMasterTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp master taskloop' after parsing of the associated statement.
void ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, SmallVectorImpl< FunctionDecl * > &Bases)
The declarator D defines a function in the scope S which is nested in an omp begin/end declare varian...
friend class Parser
Definition SemaOpenMP.h:52
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:377
StmtResult ActOnOpenMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Called on well-formed '#pragma omp cancellation point'.
OMPClause * ActOnOpenMPVarListClause(OpenMPClauseKind Kind, ArrayRef< Expr * > Vars, const OMPVarListLocTy &Locs, OpenMPVarListDataTy &Data)
void startOpenMPLoop()
If the current region is a loop-based region, mark the start of the loop construct.
StmtResult ActOnOpenMPTargetDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target' after parsing of the associated statement.
void StartOpenMPDSABlock(OpenMPDirectiveKind K, const DeclarationNameInfo &DirName, Scope *CurScope, SourceLocation Loc)
Called on start of new data sharing attribute block.
OMPThreadPrivateDecl * CheckOMPThreadPrivateDecl(SourceLocation Loc, ArrayRef< Expr * > VarList)
Builds a new OpenMPThreadPrivateDecl and checks its correctness.
void handleOMPAssumeAttr(Decl *D, const ParsedAttr &AL)
OMPClause * ActOnOpenMPSeverityClause(OpenMPSeverityClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'severity' clause.
void ActOnOpenMPDeclareReductionInitializerEnd(Decl *D, Expr *Initializer, VarDecl *OmpPrivParm)
Finish current declare reduction construct initializer.
OMPClause * ActOnOpenMPLinearClause(ArrayRef< Expr * > VarList, Expr *Step, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind, SourceLocation LinLoc, SourceLocation ColonLoc, SourceLocation StepModifierLoc, SourceLocation EndLoc)
Called on well-formed 'linear' clause.
OMPClause * ActOnOpenMPDefaultmapClause(OpenMPDefaultmapClauseModifier M, OpenMPDefaultmapClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc)
Called on well-formed 'defaultmap' clause.
StmtResult ActOnOpenMPMaskedTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp masked taskloop' after parsing of the associated statement.
StmtResult ActOnOpenMPTaskwaitDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp taskwait'.
StmtResult ActOnOpenMPForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp for simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPReductionClause(ArrayRef< Expr * > VarList, OpenMPVarListDataTy::OpenMPReductionClauseModifiers Modifiers, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'reduction' clause.
OMPClause * ActOnOpenMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'relaxed' clause.
OMPClause * ActOnOpenMPAlignedClause(ArrayRef< Expr * > VarList, Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Called on well-formed 'aligned' clause.
StmtResult ActOnOpenMPInteropDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp interop'.
OMPClause * ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depobj' pseudo clause.
OMPClause * ActOnOpenMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'seq_cst' clause.
void checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D, SourceLocation IdLoc=SourceLocation())
Check declaration inside target region.
OMPClause * ActOnOpenMPNovariantsClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'novariants' clause.
OMPClause * ActOnOpenMPCopyprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyprivate' clause.
OMPClause * ActOnOpenMPCollapseClause(Expr *NumForLoops, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'collapse' clause.
DeclGroupPtrTy ActOnOpenMPDeclareSimdDirective(DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS, Expr *Simdlen, ArrayRef< Expr * > Uniforms, ArrayRef< Expr * > Aligneds, ArrayRef< Expr * > Alignments, ArrayRef< Expr * > Linears, ArrayRef< unsigned > LinModifiers, ArrayRef< Expr * > Steps, SourceRange SR)
Called on well-formed '#pragma omp declare simd' after parsing of the associated method/function.
ExprResult PerformOpenMPImplicitIntegerConversion(SourceLocation OpLoc, Expr *Op)
StmtResult ActOnOpenMPTargetSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target simd' after parsing of the associated statement.
OMPClause * 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:85
The base class of the type hierarchy.
Definition TypeBase.h:1833
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:711
Represents a variable declaration or definition.
Definition Decl.h:925
Retains information about a function, method, or block that is currently being parsed.
Definition ScopeInfo.h:104
Definition SPIR.cpp:47
The JSON file list parser is used to communicate input to InstallAPI.
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:149
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:123
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.
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
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
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition Specifiers.h:132
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
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:309
DeclareTargetContextInfo(OpenMPDirectiveKind Kind, SourceLocation Loc)
Definition SemaOpenMP.h:327
std::optional< Expr * > Indirect
The directive with indirect clause.
Definition SemaOpenMP.h:322
OpenMPDirectiveKind Kind
The directive kind, begin declare target or declare target.
Definition SemaOpenMP.h:319
OMPDeclareTargetDeclAttr::DevTypeTy DT
The 'device_type' as parsed from the clause.
Definition SemaOpenMP.h:316
SourceLocation Loc
The directive location.
Definition SemaOpenMP.h:325
llvm::DenseMap< NamedDecl *, MapInfo > ExplicitlyMapped
Explicitly listed variables and functions in a 'to' or 'link' clause.
Definition SemaOpenMP.h:313
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 or lastprivate 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.