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 /// Called on well-formed '\#pragma omp for' after parsing
467 /// of the associated statement.
470 SourceLocation StartLoc, SourceLocation EndLoc,
471 VarsWithInheritedDSAType &VarsWithImplicitDSA);
472 /// Called on well-formed '\#pragma omp for simd' after parsing
473 /// of the associated statement.
476 SourceLocation StartLoc, SourceLocation EndLoc,
477 VarsWithInheritedDSAType &VarsWithImplicitDSA);
478 /// Called on well-formed '\#pragma omp sections' after parsing
479 /// of the associated statement.
481 Stmt *AStmt, SourceLocation StartLoc,
482 SourceLocation EndLoc);
483 /// Called on well-formed '\#pragma omp section' after parsing of the
484 /// associated statement.
486 SourceLocation EndLoc);
487 /// Called on well-formed '\#pragma omp scope' after parsing of the
488 /// associated statement.
490 Stmt *AStmt, SourceLocation StartLoc,
491 SourceLocation EndLoc);
492 /// Called on well-formed '\#pragma omp single' after parsing of the
493 /// associated statement.
495 Stmt *AStmt, SourceLocation StartLoc,
496 SourceLocation EndLoc);
497 /// Called on well-formed '\#pragma omp master' after parsing of the
498 /// associated statement.
500 SourceLocation EndLoc);
501 /// Called on well-formed '\#pragma omp critical' after parsing of the
502 /// associated statement.
504 ArrayRef<OMPClause *> Clauses,
505 Stmt *AStmt, SourceLocation StartLoc,
506 SourceLocation EndLoc);
507 /// Called on well-formed '\#pragma omp parallel for' after parsing
508 /// of the associated statement.
510 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
511 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
512 /// Called on well-formed '\#pragma omp parallel for simd' after
513 /// parsing of the associated statement.
515 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
516 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
517 /// Called on well-formed '\#pragma omp parallel master' after
518 /// parsing of the associated statement.
520 Stmt *AStmt,
521 SourceLocation StartLoc,
522 SourceLocation EndLoc);
523 /// Called on well-formed '\#pragma omp parallel masked' after
524 /// parsing of the associated statement.
526 Stmt *AStmt,
527 SourceLocation StartLoc,
528 SourceLocation EndLoc);
529 /// Called on well-formed '\#pragma omp parallel sections' after
530 /// parsing of the associated statement.
532 Stmt *AStmt,
533 SourceLocation StartLoc,
534 SourceLocation EndLoc);
535 /// Called on well-formed '\#pragma omp task' after parsing of the
536 /// associated statement.
538 Stmt *AStmt, SourceLocation StartLoc,
539 SourceLocation EndLoc);
540 /// Called on well-formed '\#pragma omp taskyield'.
542 SourceLocation EndLoc);
543 /// Called on well-formed '\#pragma omp error'.
544 /// Error direcitive is allowed in both declared and excutable contexts.
545 /// Adding InExContext to identify which context is called from.
547 SourceLocation StartLoc,
548 SourceLocation EndLoc,
549 bool InExContext = true);
550 /// Called on well-formed '\#pragma omp barrier'.
552 SourceLocation EndLoc);
553 /// Called on well-formed '\#pragma omp taskwait'.
555 SourceLocation StartLoc,
556 SourceLocation EndLoc);
557 /// Called on well-formed '\#pragma omp taskgroup'.
559 Stmt *AStmt, SourceLocation StartLoc,
560 SourceLocation EndLoc);
561 /// Called on well-formed '\#pragma omp flush'.
563 SourceLocation StartLoc,
564 SourceLocation EndLoc);
565 /// Called on well-formed '\#pragma omp depobj'.
567 SourceLocation StartLoc,
568 SourceLocation EndLoc);
569 /// Called on well-formed '\#pragma omp scan'.
571 SourceLocation StartLoc,
572 SourceLocation EndLoc);
573 /// Called on well-formed '\#pragma omp ordered' after parsing of the
574 /// associated statement.
576 Stmt *AStmt, SourceLocation StartLoc,
577 SourceLocation EndLoc);
578 /// Called on well-formed '\#pragma omp atomic' after parsing of the
579 /// associated statement.
581 Stmt *AStmt, SourceLocation StartLoc,
582 SourceLocation EndLoc);
583 /// Called on well-formed '\#pragma omp target' after parsing of the
584 /// associated statement.
586 Stmt *AStmt, SourceLocation StartLoc,
587 SourceLocation EndLoc);
588 /// Called on well-formed '\#pragma omp target data' after parsing of
589 /// the associated statement.
591 Stmt *AStmt,
592 SourceLocation StartLoc,
593 SourceLocation EndLoc);
594 /// Called on well-formed '\#pragma omp target enter data' after
595 /// parsing of the associated statement.
597 SourceLocation StartLoc,
598 SourceLocation EndLoc,
599 Stmt *AStmt);
600 /// Called on well-formed '\#pragma omp target exit data' after
601 /// parsing of the associated statement.
603 SourceLocation StartLoc,
604 SourceLocation EndLoc,
605 Stmt *AStmt);
606 /// Called on well-formed '\#pragma omp target parallel' after
607 /// parsing of the associated statement.
609 Stmt *AStmt,
610 SourceLocation StartLoc,
611 SourceLocation EndLoc);
612 /// Called on well-formed '\#pragma omp target parallel for' after
613 /// parsing of the associated statement.
615 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
616 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
617 /// Called on well-formed '\#pragma omp teams' after parsing of the
618 /// associated statement.
620 Stmt *AStmt, SourceLocation StartLoc,
621 SourceLocation EndLoc);
622 /// Called on well-formed '\#pragma omp teams loop' after parsing of the
623 /// associated statement.
625 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
626 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
627 /// Called on well-formed '\#pragma omp target teams loop' after parsing of
628 /// the associated statement.
630 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
631 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
632 /// Called on well-formed '\#pragma omp parallel loop' after parsing of the
633 /// associated statement.
635 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
636 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
637 /// Called on well-formed '\#pragma omp target parallel loop' after parsing
638 /// of the associated statement.
640 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
641 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
642 /// Called on well-formed '\#pragma omp cancellation point'.
645 SourceLocation EndLoc,
646 OpenMPDirectiveKind CancelRegion);
647 /// Called on well-formed '\#pragma omp cancel'.
649 SourceLocation StartLoc,
650 SourceLocation EndLoc,
651 OpenMPDirectiveKind CancelRegion);
652 /// Called on well-formed '\#pragma omp taskloop' after parsing of the
653 /// associated statement.
656 SourceLocation StartLoc, SourceLocation EndLoc,
657 VarsWithInheritedDSAType &VarsWithImplicitDSA);
658 /// Called on well-formed '\#pragma omp taskloop simd' after parsing of
659 /// the associated statement.
661 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
662 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
663 /// Called on well-formed '\#pragma omp master taskloop' after parsing of the
664 /// associated statement.
666 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
667 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
668 /// Called on well-formed '\#pragma omp master taskloop simd' after parsing of
669 /// the associated statement.
671 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
672 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
673 /// Called on well-formed '\#pragma omp parallel master taskloop' after
674 /// parsing of the associated statement.
676 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
677 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
678 /// Called on well-formed '\#pragma omp parallel master taskloop simd' after
679 /// parsing of the associated statement.
681 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
682 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
683 /// Called on well-formed '\#pragma omp masked taskloop' after parsing of the
684 /// associated statement.
686 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
687 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
688 /// Called on well-formed '\#pragma omp masked taskloop simd' after parsing of
689 /// the associated statement.
691 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
692 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
693 /// Called on well-formed '\#pragma omp parallel masked taskloop' after
694 /// parsing of the associated statement.
696 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
697 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
698 /// Called on well-formed '\#pragma omp parallel masked taskloop simd' after
699 /// parsing of the associated statement.
701 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
702 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
703 /// Called on well-formed '\#pragma omp distribute' after parsing
704 /// of the associated statement.
707 SourceLocation StartLoc, SourceLocation EndLoc,
708 VarsWithInheritedDSAType &VarsWithImplicitDSA);
709 /// Called on well-formed '\#pragma omp target update'.
711 SourceLocation StartLoc,
712 SourceLocation EndLoc,
713 Stmt *AStmt);
714 /// Called on well-formed '\#pragma omp distribute parallel for' after
715 /// parsing of the associated statement.
717 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
718 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
719 /// Called on well-formed '\#pragma omp distribute parallel for simd'
720 /// after parsing of the associated statement.
722 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
723 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
724 /// Called on well-formed '\#pragma omp distribute simd' after
725 /// parsing of the associated statement.
727 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
728 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
729 /// Called on well-formed '\#pragma omp target parallel for simd' after
730 /// parsing of the associated statement.
732 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
733 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
734 /// Called on well-formed '\#pragma omp target simd' after parsing of
735 /// the associated statement.
738 SourceLocation StartLoc, SourceLocation EndLoc,
739 VarsWithInheritedDSAType &VarsWithImplicitDSA);
740 /// Called on well-formed '\#pragma omp teams distribute' after parsing of
741 /// the associated statement.
743 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
744 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
745 /// Called on well-formed '\#pragma omp teams distribute simd' after parsing
746 /// of the associated statement.
748 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
749 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
750 /// Called on well-formed '\#pragma omp teams distribute parallel for simd'
751 /// after parsing of the associated statement.
753 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
754 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
755 /// Called on well-formed '\#pragma omp teams distribute parallel for'
756 /// after parsing of the associated statement.
758 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
759 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
760 /// Called on well-formed '\#pragma omp target teams' after parsing of the
761 /// associated statement.
763 Stmt *AStmt,
764 SourceLocation StartLoc,
765 SourceLocation EndLoc);
766 /// Called on well-formed '\#pragma omp target teams distribute' after parsing
767 /// of the associated statement.
769 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
770 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
771 /// Called on well-formed '\#pragma omp target teams distribute parallel for'
772 /// after parsing of the associated statement.
774 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
775 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
776 /// Called on well-formed '\#pragma omp target teams distribute parallel for
777 /// simd' after parsing of the associated statement.
779 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
780 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
781 /// Called on well-formed '\#pragma omp target teams distribute simd' after
782 /// parsing of the associated statement.
784 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
785 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
786 /// Called on well-formed '\#pragma omp interop'.
788 SourceLocation StartLoc,
789 SourceLocation EndLoc);
790 /// Called on well-formed '\#pragma omp dispatch' after parsing of the
791 // /associated statement.
793 Stmt *AStmt, SourceLocation StartLoc,
794 SourceLocation EndLoc);
795 /// Called on well-formed '\#pragma omp masked' after parsing of the
796 // /associated statement.
798 Stmt *AStmt, SourceLocation StartLoc,
799 SourceLocation EndLoc);
800
801 /// Called on well-formed '\#pragma omp loop' after parsing of the
802 /// associated statement.
804 ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
805 SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
806
807 /// Checks correctness of linear modifiers.
809 SourceLocation LinLoc);
810 /// Checks that the specified declaration matches requirements for the linear
811 /// decls.
814 bool IsDeclareSimd = false);
815
816 /// Called on well-formed '\#pragma omp declare simd' after parsing of
817 /// the associated method/function.
819 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
820 Expr *Simdlen, ArrayRef<Expr *> Uniforms, ArrayRef<Expr *> Aligneds,
821 ArrayRef<Expr *> Alignments, ArrayRef<Expr *> Linears,
822 ArrayRef<unsigned> LinModifiers, ArrayRef<Expr *> Steps, SourceRange SR);
823
824 /// Checks '\#pragma omp declare variant' variant function and original
825 /// functions after parsing of the associated method/function.
826 /// \param DG Function declaration to which declare variant directive is
827 /// applied to.
828 /// \param VariantRef Expression that references the variant function, which
829 /// must be used instead of the original one, specified in \p DG.
830 /// \param TI The trait info object representing the match clause.
831 /// \param NumAppendArgs The number of omp_interop_t arguments to account for
832 /// in checking.
833 /// \returns std::nullopt, if the function/variant function are not compatible
834 /// with the pragma, pair of original function/variant ref expression
835 /// otherwise.
836 std::optional<std::pair<FunctionDecl *, Expr *>>
838 OMPTraitInfo &TI, unsigned NumAppendArgs,
839 SourceRange SR);
840
841 /// Called on well-formed '\#pragma omp declare variant' after parsing of
842 /// the associated method/function.
843 /// \param FD Function declaration to which declare variant directive is
844 /// applied to.
845 /// \param VariantRef Expression that references the variant function, which
846 /// must be used instead of the original one, specified in \p DG.
847 /// \param TI The context traits associated with the function variant.
848 /// \param AdjustArgsNothing The list of 'nothing' arguments.
849 /// \param AdjustArgsNeedDevicePtr The list of 'need_device_ptr' arguments.
850 /// \param AppendArgs The list of 'append_args' arguments.
851 /// \param AdjustArgsLoc The Location of an 'adjust_args' clause.
852 /// \param AppendArgsLoc The Location of an 'append_args' clause.
853 /// \param SR The SourceRange of the 'declare variant' directive.
855 FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI,
856 ArrayRef<Expr *> AdjustArgsNothing,
857 ArrayRef<Expr *> AdjustArgsNeedDevicePtr,
858 ArrayRef<Expr *> AdjustArgsNeedDeviceAddr,
859 ArrayRef<OMPInteropInfo> AppendArgs, SourceLocation AdjustArgsLoc,
860 SourceLocation AppendArgsLoc, SourceRange SR);
861
862 /// Called on device_num selector in context selectors.
863 void ActOnOpenMPDeviceNum(Expr *DeviceNumExpr);
864
866 SourceLocation StartLoc,
867 SourceLocation LParenLoc,
868 SourceLocation EndLoc);
869 /// Called on well-formed 'allocator' clause.
871 SourceLocation StartLoc,
872 SourceLocation LParenLoc,
873 SourceLocation EndLoc);
874 /// Called on well-formed 'if' clause.
876 Expr *Condition, SourceLocation StartLoc,
877 SourceLocation LParenLoc,
878 SourceLocation NameModifierLoc,
879 SourceLocation ColonLoc,
880 SourceLocation EndLoc);
881 /// Called on well-formed 'final' clause.
883 SourceLocation LParenLoc,
884 SourceLocation EndLoc);
885 /// Called on well-formed 'num_threads' clause.
887 OpenMPNumThreadsClauseModifier Modifier, Expr *NumThreads,
888 SourceLocation StartLoc, SourceLocation LParenLoc,
889 SourceLocation ModifierLoc, SourceLocation EndLoc);
890 /// Called on well-formed 'align' clause.
892 SourceLocation LParenLoc,
893 SourceLocation EndLoc);
894 /// Called on well-formed 'safelen' clause.
896 SourceLocation LParenLoc,
897 SourceLocation EndLoc);
898 /// Called on well-formed 'simdlen' clause.
900 SourceLocation LParenLoc,
901 SourceLocation EndLoc);
902 /// Called on well-form 'sizes' clause.
904 SourceLocation StartLoc,
905 SourceLocation LParenLoc,
906 SourceLocation EndLoc);
907 /// Called on well-form 'permutation' clause after parsing its arguments.
909 SourceLocation StartLoc,
910 SourceLocation LParenLoc,
911 SourceLocation EndLoc);
912 /// Called on well-form 'full' clauses.
914 SourceLocation EndLoc);
915 /// Called on well-form 'partial' clauses.
917 SourceLocation LParenLoc,
918 SourceLocation EndLoc);
919 /// Called on well-formed 'collapse' clause.
921 SourceLocation StartLoc,
922 SourceLocation LParenLoc,
923 SourceLocation EndLoc);
924 /// Called on well-formed 'ordered' clause.
925 OMPClause *
927 SourceLocation LParenLoc = SourceLocation(),
928 Expr *NumForLoops = nullptr);
929 /// Called on well-formed 'grainsize' clause.
931 Expr *Size, SourceLocation StartLoc,
932 SourceLocation LParenLoc,
933 SourceLocation ModifierLoc,
934 SourceLocation EndLoc);
935 /// Called on well-formed 'num_tasks' clause.
937 Expr *NumTasks, SourceLocation StartLoc,
938 SourceLocation LParenLoc,
939 SourceLocation ModifierLoc,
940 SourceLocation EndLoc);
941 /// Called on well-formed 'hint' clause.
943 SourceLocation LParenLoc,
944 SourceLocation EndLoc);
945 /// Called on well-formed 'detach' clause.
947 SourceLocation LParenLoc,
948 SourceLocation EndLoc);
949
950 OMPClause *ActOnOpenMPSimpleClause(OpenMPClauseKind Kind, unsigned Argument,
951 SourceLocation ArgumentLoc,
952 SourceLocation StartLoc,
953 SourceLocation LParenLoc,
954 SourceLocation EndLoc);
955 /// Called on well-formed 'when' clause.
957 SourceLocation LParenLoc,
958 SourceLocation EndLoc);
959 /// Called on well-formed 'default' clause.
960 OMPClause *
961 ActOnOpenMPDefaultClause(llvm::omp::DefaultKind M, SourceLocation MLoc,
963 SourceLocation VCKindLoc, SourceLocation StartLoc,
964 SourceLocation LParenLoc, SourceLocation EndLoc);
965 /// Called on well-formed 'proc_bind' clause.
966 OMPClause *ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind,
967 SourceLocation KindLoc,
968 SourceLocation StartLoc,
969 SourceLocation LParenLoc,
970 SourceLocation EndLoc);
971 /// Called on well-formed 'order' clause.
974 SourceLocation StartLoc,
975 SourceLocation LParenLoc,
976 SourceLocation MLoc, SourceLocation KindLoc,
977 SourceLocation EndLoc);
978 /// Called on well-formed 'update' clause.
980 SourceLocation KindLoc,
981 SourceLocation StartLoc,
982 SourceLocation LParenLoc,
983 SourceLocation EndLoc);
984 /// Called on well-formed 'holds' clause.
986 SourceLocation LParenLoc,
987 SourceLocation EndLoc);
988 /// Called on well-formed 'absent' or 'contains' clauses.
993 SourceLocation Loc,
994 SourceLocation RLoc);
995
998 SourceLocation StartLoc, SourceLocation LParenLoc,
999 ArrayRef<SourceLocation> ArgumentsLoc, SourceLocation DelimLoc,
1000 SourceLocation EndLoc);
1001 /// Called on well-formed 'schedule' clause.
1004 OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc,
1005 SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc,
1006 SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc);
1007
1009 SourceLocation EndLoc);
1010 /// Called on well-formed 'nowait' clause.
1012 SourceLocation EndLoc);
1013 /// Called on well-formed 'untied' clause.
1015 SourceLocation EndLoc);
1016 /// Called on well-formed 'mergeable' clause.
1018 SourceLocation EndLoc);
1019 /// Called on well-formed 'read' clause.
1021 SourceLocation EndLoc);
1022 /// Called on well-formed 'write' clause.
1024 SourceLocation EndLoc);
1025 /// Called on well-formed 'update' clause.
1027 SourceLocation EndLoc);
1028 /// Called on well-formed 'capture' clause.
1030 SourceLocation EndLoc);
1031 /// Called on well-formed 'compare' clause.
1033 SourceLocation EndLoc);
1034 /// Called on well-formed 'fail' clause.
1036 SourceLocation EndLoc);
1038 SourceLocation KindLoc,
1039 SourceLocation StartLoc,
1040 SourceLocation LParenLoc,
1041 SourceLocation EndLoc);
1042
1043 /// Called on well-formed 'seq_cst' clause.
1045 SourceLocation EndLoc);
1046 /// Called on well-formed 'acq_rel' clause.
1048 SourceLocation EndLoc);
1049 /// Called on well-formed 'acquire' clause.
1051 SourceLocation EndLoc);
1052 /// Called on well-formed 'release' clause.
1054 SourceLocation EndLoc);
1055 /// Called on well-formed 'relaxed' clause.
1057 SourceLocation EndLoc);
1058 /// Called on well-formed 'weak' clause.
1060 SourceLocation EndLoc);
1061
1062 /// Called on well-formed 'init' clause.
1063 OMPClause *
1064 ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo,
1065 SourceLocation StartLoc, SourceLocation LParenLoc,
1066 SourceLocation VarLoc, SourceLocation EndLoc);
1067
1068 /// Called on well-formed 'use' clause.
1069 OMPClause *ActOnOpenMPUseClause(Expr *InteropVar, SourceLocation StartLoc,
1070 SourceLocation LParenLoc,
1071 SourceLocation VarLoc, SourceLocation EndLoc);
1072
1073 /// Called on well-formed 'destroy' clause.
1075 SourceLocation LParenLoc,
1076 SourceLocation VarLoc,
1077 SourceLocation EndLoc);
1078 /// Called on well-formed 'novariants' clause.
1080 SourceLocation StartLoc,
1081 SourceLocation LParenLoc,
1082 SourceLocation EndLoc);
1083 /// Called on well-formed 'nocontext' clause.
1085 SourceLocation StartLoc,
1086 SourceLocation LParenLoc,
1087 SourceLocation EndLoc);
1088 /// Called on well-formed 'filter' clause.
1090 SourceLocation LParenLoc,
1091 SourceLocation EndLoc);
1092 /// Called on well-formed 'threads' clause.
1094 SourceLocation EndLoc);
1095 /// Called on well-formed 'simd' clause.
1097 SourceLocation EndLoc);
1098 /// Called on well-formed 'nogroup' clause.
1100 SourceLocation EndLoc);
1101 /// Called on well-formed 'unified_address' clause.
1103 SourceLocation EndLoc);
1104
1105 /// Called on well-formed 'unified_address' clause.
1107 SourceLocation EndLoc);
1108
1109 /// Called on well-formed 'reverse_offload' clause.
1111 SourceLocation EndLoc);
1112
1113 /// Called on well-formed 'dynamic_allocators' clause.
1115 SourceLocation EndLoc);
1116
1117 /// Called on well-formed 'atomic_default_mem_order' clause.
1120 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1121
1122 /// Called on well-formed 'self_maps' clause.
1124 SourceLocation EndLoc);
1125
1126 /// Called on well-formed 'at' clause.
1128 SourceLocation KindLoc,
1129 SourceLocation StartLoc,
1130 SourceLocation LParenLoc,
1131 SourceLocation EndLoc);
1132
1133 /// Called on well-formed 'severity' clause.
1135 SourceLocation KindLoc,
1136 SourceLocation StartLoc,
1137 SourceLocation LParenLoc,
1138 SourceLocation EndLoc);
1139
1140 /// Called on well-formed 'message' clause.
1141 /// passing string for message.
1143 SourceLocation LParenLoc,
1144 SourceLocation EndLoc);
1145
1146 /// Data used for processing a list of variables in OpenMP clauses.
1147 struct OpenMPVarListDataTy final {
1149 Expr *IteratorExpr = nullptr;
1154 int ExtraModifier = -1; ///< Additional modifier for linear, map, depend or
1155 ///< lastprivate clause.
1156 int OriginalSharingModifier = 0; // Default is shared
1164 bool IsMapTypeImplicit = false;
1169 StepModifierLoc; /// 'step' modifier location for linear clause
1182 };
1183
1185 ArrayRef<Expr *> Vars,
1186 const OMPVarListLocTy &Locs,
1187 OpenMPVarListDataTy &Data);
1188 /// Called on well-formed 'inclusive' clause.
1190 SourceLocation StartLoc,
1191 SourceLocation LParenLoc,
1192 SourceLocation EndLoc);
1193 /// Called on well-formed 'exclusive' clause.
1195 SourceLocation StartLoc,
1196 SourceLocation LParenLoc,
1197 SourceLocation EndLoc);
1198 /// Called on well-formed 'allocate' clause.
1199 OMPClause *
1200 ActOnOpenMPAllocateClause(Expr *Allocator, Expr *Alignment,
1201 OpenMPAllocateClauseModifier FirstModifier,
1202 SourceLocation FirstModifierLoc,
1203 OpenMPAllocateClauseModifier SecondModifier,
1204 SourceLocation SecondModifierLoc,
1205 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1206 SourceLocation ColonLoc, SourceLocation LParenLoc,
1207 SourceLocation EndLoc);
1208 /// Called on well-formed 'private' clause.
1210 SourceLocation StartLoc,
1211 SourceLocation LParenLoc,
1212 SourceLocation EndLoc);
1213 /// Called on well-formed 'firstprivate' clause.
1215 SourceLocation StartLoc,
1216 SourceLocation LParenLoc,
1217 SourceLocation EndLoc);
1218 /// Called on well-formed 'lastprivate' clause.
1221 SourceLocation LPKindLoc, SourceLocation ColonLoc,
1222 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1223 /// Called on well-formed 'shared' clause.
1225 SourceLocation StartLoc,
1226 SourceLocation LParenLoc,
1227 SourceLocation EndLoc);
1228 /// Called on well-formed 'reduction' clause.
1230 ArrayRef<Expr *> VarList,
1231 OpenMPVarListDataTy::OpenMPReductionClauseModifiers Modifiers,
1232 SourceLocation StartLoc, SourceLocation LParenLoc,
1233 SourceLocation ModifierLoc, SourceLocation ColonLoc,
1234 SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec,
1235 const DeclarationNameInfo &ReductionId,
1236 ArrayRef<Expr *> UnresolvedReductions = {});
1237 /// Called on well-formed 'task_reduction' clause.
1239 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1240 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1241 CXXScopeSpec &ReductionIdScopeSpec,
1242 const DeclarationNameInfo &ReductionId,
1243 ArrayRef<Expr *> UnresolvedReductions = {});
1244 /// Called on well-formed 'in_reduction' clause.
1246 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1247 SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1248 CXXScopeSpec &ReductionIdScopeSpec,
1249 const DeclarationNameInfo &ReductionId,
1250 ArrayRef<Expr *> UnresolvedReductions = {});
1251 /// Called on well-formed 'linear' clause.
1252 OMPClause *ActOnOpenMPLinearClause(
1253 ArrayRef<Expr *> VarList, Expr *Step, SourceLocation StartLoc,
1254 SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind,
1255 SourceLocation LinLoc, SourceLocation ColonLoc,
1256 SourceLocation StepModifierLoc, SourceLocation EndLoc);
1257 /// Called on well-formed 'aligned' clause.
1258 OMPClause *ActOnOpenMPAlignedClause(ArrayRef<Expr *> VarList, Expr *Alignment,
1259 SourceLocation StartLoc,
1260 SourceLocation LParenLoc,
1261 SourceLocation ColonLoc,
1262 SourceLocation EndLoc);
1263 /// Called on well-formed 'copyin' clause.
1264 OMPClause *ActOnOpenMPCopyinClause(ArrayRef<Expr *> VarList,
1265 SourceLocation StartLoc,
1266 SourceLocation LParenLoc,
1267 SourceLocation EndLoc);
1268 /// Called on well-formed 'copyprivate' clause.
1269 OMPClause *ActOnOpenMPCopyprivateClause(ArrayRef<Expr *> VarList,
1270 SourceLocation StartLoc,
1271 SourceLocation LParenLoc,
1272 SourceLocation EndLoc);
1273 /// Called on well-formed 'flush' pseudo clause.
1274 OMPClause *ActOnOpenMPFlushClause(ArrayRef<Expr *> VarList,
1275 SourceLocation StartLoc,
1276 SourceLocation LParenLoc,
1277 SourceLocation EndLoc);
1278 /// Called on well-formed 'depobj' pseudo clause.
1279 OMPClause *ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc,
1280 SourceLocation LParenLoc,
1281 SourceLocation EndLoc);
1282 /// Called on well-formed 'depend' clause.
1283 OMPClause *ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data,
1284 Expr *DepModifier,
1285 ArrayRef<Expr *> VarList,
1286 SourceLocation StartLoc,
1287 SourceLocation LParenLoc,
1288 SourceLocation EndLoc);
1289 /// Called on well-formed 'device' clause.
1291 Expr *Device, SourceLocation StartLoc,
1292 SourceLocation LParenLoc,
1293 SourceLocation ModifierLoc,
1294 SourceLocation EndLoc);
1295 /// Called on well-formed 'map' clause.
1296 OMPClause *ActOnOpenMPMapClause(
1297 Expr *IteratorModifier, ArrayRef<OpenMPMapModifierKind> MapTypeModifiers,
1298 ArrayRef<SourceLocation> MapTypeModifiersLoc,
1299 CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
1300 OpenMPMapClauseKind MapType, bool IsMapTypeImplicit,
1301 SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
1302 const OMPVarListLocTy &Locs, bool NoDiagnose = false,
1303 ArrayRef<Expr *> UnresolvedMappers = {});
1304 /// Called on well-formed 'num_teams' clause.
1305 OMPClause *ActOnOpenMPNumTeamsClause(ArrayRef<Expr *> VarList,
1306 SourceLocation StartLoc,
1307 SourceLocation LParenLoc,
1308 SourceLocation EndLoc);
1309 /// Called on well-formed 'thread_limit' clause.
1310 OMPClause *ActOnOpenMPThreadLimitClause(ArrayRef<Expr *> VarList,
1311 SourceLocation StartLoc,
1312 SourceLocation LParenLoc,
1313 SourceLocation EndLoc);
1314 /// Called on well-formed 'priority' clause.
1315 OMPClause *ActOnOpenMPPriorityClause(Expr *Priority, SourceLocation StartLoc,
1316 SourceLocation LParenLoc,
1317 SourceLocation EndLoc);
1318 /// Called on well-formed 'dist_schedule' clause.
1320 OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize,
1321 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc,
1322 SourceLocation CommaLoc, SourceLocation EndLoc);
1323 /// Called on well-formed 'defaultmap' clause.
1324 OMPClause *ActOnOpenMPDefaultmapClause(
1326 SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc,
1327 SourceLocation KindLoc, SourceLocation EndLoc);
1328 /// Called on well-formed 'to' clause.
1329 OMPClause *
1330 ActOnOpenMPToClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1331 ArrayRef<SourceLocation> MotionModifiersLoc,
1332 CXXScopeSpec &MapperIdScopeSpec,
1333 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1334 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1335 ArrayRef<Expr *> UnresolvedMappers = {});
1336 /// Called on well-formed 'from' clause.
1337 OMPClause *
1338 ActOnOpenMPFromClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
1339 ArrayRef<SourceLocation> MotionModifiersLoc,
1340 CXXScopeSpec &MapperIdScopeSpec,
1341 DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1342 ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1343 ArrayRef<Expr *> UnresolvedMappers = {});
1344 /// Called on well-formed 'use_device_ptr' clause.
1345 OMPClause *ActOnOpenMPUseDevicePtrClause(ArrayRef<Expr *> VarList,
1346 const OMPVarListLocTy &Locs);
1347 /// Called on well-formed 'use_device_addr' clause.
1348 OMPClause *ActOnOpenMPUseDeviceAddrClause(ArrayRef<Expr *> VarList,
1349 const OMPVarListLocTy &Locs);
1350 /// Called on well-formed 'is_device_ptr' clause.
1351 OMPClause *ActOnOpenMPIsDevicePtrClause(ArrayRef<Expr *> VarList,
1352 const OMPVarListLocTy &Locs);
1353 /// Called on well-formed 'has_device_addr' clause.
1354 OMPClause *ActOnOpenMPHasDeviceAddrClause(ArrayRef<Expr *> VarList,
1355 const OMPVarListLocTy &Locs);
1356 /// Called on well-formed 'nontemporal' clause.
1357 OMPClause *ActOnOpenMPNontemporalClause(ArrayRef<Expr *> VarList,
1358 SourceLocation StartLoc,
1359 SourceLocation LParenLoc,
1360 SourceLocation EndLoc);
1361
1362 /// Data for list of allocators.
1364 /// Allocator.
1365 Expr *Allocator = nullptr;
1366 /// Allocator traits.
1368 /// Locations of '(' and ')' symbols.
1370 };
1371 /// Called on well-formed 'uses_allocators' clause.
1373 SourceLocation LParenLoc,
1374 SourceLocation EndLoc,
1376 /// Called on well-formed 'affinity' clause.
1378 SourceLocation LParenLoc,
1379 SourceLocation ColonLoc,
1380 SourceLocation EndLoc, Expr *Modifier,
1381 ArrayRef<Expr *> Locators);
1382 /// Called on a well-formed 'bind' clause.
1384 SourceLocation KindLoc,
1385 SourceLocation StartLoc,
1386 SourceLocation LParenLoc,
1387 SourceLocation EndLoc);
1388
1389 /// Called on a well-formed 'ompx_dyn_cgroup_mem' clause.
1391 SourceLocation LParenLoc,
1392 SourceLocation EndLoc);
1393
1394 /// Called on well-formed 'doacross' clause.
1395 OMPClause *
1397 SourceLocation DepLoc, SourceLocation ColonLoc,
1398 ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1399 SourceLocation LParenLoc, SourceLocation EndLoc);
1400
1401 /// Called on a well-formed 'ompx_attribute' clause.
1403 SourceLocation StartLoc,
1404 SourceLocation LParenLoc,
1405 SourceLocation EndLoc);
1406
1407 /// Called on a well-formed 'ompx_bare' clause.
1409 SourceLocation EndLoc);
1410
1412 Expr *LowerBound,
1413 SourceLocation ColonLocFirst,
1414 SourceLocation ColonLocSecond,
1415 Expr *Length, Expr *Stride,
1416 SourceLocation RBLoc);
1418 SourceLocation RParenLoc,
1419 ArrayRef<Expr *> Dims,
1420 ArrayRef<SourceRange> Brackets);
1421
1422 /// Data structure for iterator expression.
1432
1434 SourceLocation LLoc, SourceLocation RLoc,
1436
1437 void handleOMPAssumeAttr(Decl *D, const ParsedAttr &AL);
1438
1439 /// Setter and getter functions for device_num.
1440 void setOpenMPDeviceNum(int Num);
1441
1442 int getOpenMPDeviceNum() const;
1443
1444 void setOpenMPDeviceNumID(StringRef ID);
1445
1446private:
1447 void *VarDataSharingAttributesStack;
1448
1449 /// Number of nested '#pragma omp declare target' directives.
1450 SmallVector<DeclareTargetContextInfo, 4> DeclareTargetNesting;
1451
1452 /// Initialization of data-sharing attributes stack.
1453 void InitDataSharingAttributesStack();
1454 void DestroyDataSharingAttributesStack();
1455
1456 /// Returns OpenMP nesting level for current directive.
1457 unsigned getOpenMPNestingLevel() const;
1458
1459 /// Adjusts the function scopes index for the target-based regions.
1460 void adjustOpenMPTargetScopeIndex(unsigned &FunctionScopesIndex,
1461 unsigned Level) const;
1462
1463 /// Returns the number of scopes associated with the construct on the given
1464 /// OpenMP level.
1465 int getNumberOfConstructScopes(unsigned Level) const;
1466
1467 /// Push new OpenMP function region for non-capturing function.
1468 void pushOpenMPFunctionRegion();
1469
1470 /// Pop OpenMP function region for non-capturing function.
1471 void popOpenMPFunctionRegion(const sema::FunctionScopeInfo *OldFSI);
1472
1473 /// Analyzes and checks a loop nest for use by a loop transformation.
1474 ///
1475 /// \param Kind The loop transformation directive kind.
1476 /// \param NumLoops How many nested loops the directive is expecting.
1477 /// \param AStmt Associated statement of the transformation directive.
1478 /// \param LoopHelpers [out] The loop analysis result.
1479 /// \param Body [out] The body code nested in \p NumLoops loop.
1480 /// \param OriginalInits [out] Collection of statements and declarations that
1481 /// must have been executed/declared before entering the
1482 /// loop.
1483 ///
1484 /// \return Whether there was any error.
1485 bool checkTransformableLoopNest(
1486 OpenMPDirectiveKind Kind, Stmt *AStmt, int NumLoops,
1488 Stmt *&Body, SmallVectorImpl<SmallVector<Stmt *, 0>> &OriginalInits);
1489
1490 /// Helper to keep information about the current `omp begin/end declare
1491 /// variant` nesting.
1492 struct OMPDeclareVariantScope {
1493 /// The associated OpenMP context selector.
1494 OMPTraitInfo *TI;
1495
1496 /// The associated OpenMP context selector mangling.
1497 std::string NameSuffix;
1498
1499 OMPDeclareVariantScope(OMPTraitInfo &TI);
1500 };
1501
1502 /// Return the OMPTraitInfo for the surrounding scope, if any.
1503 OMPTraitInfo *getOMPTraitInfoForSurroundingScope() {
1504 return OMPDeclareVariantScopes.empty() ? nullptr
1505 : OMPDeclareVariantScopes.back().TI;
1506 }
1507
1508 /// The current `omp begin/end declare variant` scopes.
1509 SmallVector<OMPDeclareVariantScope, 4> OMPDeclareVariantScopes;
1510
1511 /// The current `omp begin/end assumes` scopes.
1512 SmallVector<OMPAssumeAttr *, 4> OMPAssumeScoped;
1513
1514 /// All `omp assumes` we encountered so far.
1515 SmallVector<OMPAssumeAttr *, 4> OMPAssumeGlobal;
1516
1517 /// Device number specified by the context selector.
1518 int DeviceNum = -1;
1519
1520 /// Device number identifier specified by the context selector.
1521 StringRef DeviceNumID;
1522};
1523
1524} // namespace clang
1525
1526#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.
StmtResult ActOnOpenMPMetaDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp metadirective' after parsing of the associated statement.
OMPClause * ActOnOpenMPPermutationClause(ArrayRef< Expr * > PermExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'permutation' clause after parsing its arguments.
OMPClause * ActOnOpenMPNontemporalClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'nontemporal' clause.
OMPClause * ActOnOpenMPFromClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'from' clause.
OMPClause * ActOnOpenMPBindClause(OpenMPBindClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'bind' clause.
OMPClause * ActOnOpenMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'threads' clause.
OMPClause * ActOnOpenMPThreadLimitClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'thread_limit' clause.
OMPClause * ActOnOpenMPSharedClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'shared' clause.
StmtResult ActOnOpenMPTargetExitDataDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AStmt)
Called on well-formed '#pragma omp target exit data' after parsing of the associated statement.
StmtResult ActOnOpenMPTeamsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp teams' after parsing of the associated statement.
OMPClause * ActOnOpenMPCopyinClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyin' clause.
OMPClause * ActOnOpenMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'mergeable' clause.
void startOpenMPCXXRangeFor()
If the current region is a range loop-based region, mark the start of the loop construct.
OMPClause * ActOnOpenMPDestroyClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'destroy' clause.
StmtResult ActOnOpenMPParallelMaskedTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel masked taskloop' after parsing of the associated statemen...
OMPClause * ActOnOpenMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, Expr *Modifier, ArrayRef< Expr * > Locators)
Called on well-formed 'affinity' clause.
OMPClause * ActOnOpenMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'compare' clause.
OMPClause * ActOnOpenMPNumTeamsClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'num_teams' clause.
StmtResult ActOnOpenMPParallelSectionsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel sections' after parsing of the associated statement.
OMPClause * ActOnOpenMPUpdateClause(OpenMPDependClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'update' clause.
OMPClause * ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data, Expr *DepModifier, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depend' clause.
OMPClause * ActOnOpenMPDoacrossClause(OpenMPDoacrossClauseModifier DepType, SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'doacross' clause.
VarDecl * ActOnOpenMPDeclareReductionInitializerStart(Scope *S, Decl *D)
Initialize declare reduction construct initializer.
StmtResult ActOnOpenMPTeamsDistributeParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute parallel for' after parsing of the associated sta...
StmtResult ActOnOpenMPMasterDirective(Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp master' after parsing of the associated statement.
StmtResult ActOnOpenMPTaskgroupDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp taskgroup'.
VarDecl * isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo=false, unsigned StopAt=0)
Check if the specified variable is used in one of the private clauses (private, firstprivate,...
StmtResult ActOnOpenMPMasterTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp master taskloop simd' after parsing of the associated statement.
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.
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.
@ DeviceNum
'device_num' clause, allowed on 'init', 'shutdown', and 'set' constructs.
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.