clang  19.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/Attr.h"
18 #include "clang/AST/Decl.h"
19 #include "clang/AST/DeclBase.h"
20 #include "clang/AST/DeclOpenMP.h"
22 #include "clang/AST/Expr.h"
23 #include "clang/AST/ExprOpenMP.h"
24 #include "clang/AST/OpenMPClause.h"
25 #include "clang/AST/Stmt.h"
26 #include "clang/AST/StmtOpenMP.h"
27 #include "clang/AST/Type.h"
29 #include "clang/Basic/LLVM.h"
32 #include "clang/Basic/Specifiers.h"
33 #include "clang/Sema/DeclSpec.h"
34 #include "clang/Sema/Ownership.h"
35 #include "clang/Sema/Scope.h"
36 #include "clang/Sema/ScopeInfo.h"
37 #include "clang/Sema/SemaBase.h"
38 #include "llvm/ADT/DenseMap.h"
39 #include "llvm/ADT/PointerUnion.h"
40 #include <optional>
41 #include <string>
42 #include <utility>
43 
44 namespace clang {
45 
46 class SemaOpenMP : public SemaBase {
47 public:
48  SemaOpenMP(Sema &S);
49 
50  friend class Parser;
51  friend class Sema;
52 
54  using CapturedParamNameType = std::pair<StringRef, QualType>;
55 
56  /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
57  /// context is "used as device code".
58  ///
59  /// - If CurContext is a `declare target` function or it is known that the
60  /// function is emitted for the device, emits the diagnostics immediately.
61  /// - If CurContext is a non-`declare target` function and we are compiling
62  /// for the device, creates a diagnostic which is emitted if and when we
63  /// realize that the function will be codegen'ed.
64  ///
65  /// Example usage:
66  ///
67  /// // Variable-length arrays are not allowed in NVPTX device code.
68  /// if (diagIfOpenMPDeviceCode(Loc, diag::err_vla_unsupported))
69  /// return ExprError();
70  /// // Otherwise, continue parsing as normal.
72  unsigned DiagID,
73  const FunctionDecl *FD);
74 
75  /// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
76  /// context is "used as host code".
77  ///
78  /// - If CurContext is a `declare target` function or it is known that the
79  /// function is emitted for the host, emits the diagnostics immediately.
80  /// - If CurContext is a non-host function, just ignore it.
81  ///
82  /// Example usage:
83  ///
84  /// // Variable-length arrays are not allowed in NVPTX device code.
85  /// if (diagIfOpenMPHostode(Loc, diag::err_vla_unsupported))
86  /// return ExprError();
87  /// // Otherwise, continue parsing as normal.
89  unsigned DiagID,
90  const FunctionDecl *FD);
91 
92  /// The declarator \p D defines a function in the scope \p S which is nested
93  /// in an `omp begin/end declare variant` scope. In this method we create a
94  /// declaration for \p D and rename \p D according to the OpenMP context
95  /// selector of the surrounding scope. Return all base functions in \p Bases.
97  Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists,
99 
100  /// Register \p D as specialization of all base functions in \p Bases in the
101  /// current `omp begin/end declare variant` scope.
104 
105  /// Act on \p D, a function definition inside of an `omp [begin/end] assumes`.
107 
108  /// Can we exit an OpenMP declare variant scope at the moment.
110  return !OMPDeclareVariantScopes.empty();
111  }
112 
113  ExprResult
115  bool StrictlyPositive = true,
116  bool SuppressExprDiags = false);
117 
118  /// Given the potential call expression \p Call, determine if there is a
119  /// specialization via the OpenMP declare variant mechanism available. If
120  /// there is, return the specialized call expression, otherwise return the
121  /// original \p Call.
123  SourceLocation LParenLoc, MultiExprArg ArgExprs,
124  SourceLocation RParenLoc, Expr *ExecConfig);
125 
126  /// Handle a `omp begin declare variant`.
128 
129  /// Handle a `omp end declare variant`.
131 
132  /// Function tries to capture lambda's captured variables in the OpenMP region
133  /// before the original lambda is captured.
135 
136  /// Return true if the provided declaration \a VD should be captured by
137  /// reference.
138  /// \param Level Relative level of nested OpenMP construct for that the check
139  /// is performed.
140  /// \param OpenMPCaptureLevel Capture level within an OpenMP construct.
141  bool isOpenMPCapturedByRef(const ValueDecl *D, unsigned Level,
142  unsigned OpenMPCaptureLevel) const;
143 
144  /// Check if the specified variable is used in one of the private
145  /// clauses (private, firstprivate, lastprivate, reduction etc.) in OpenMP
146  /// constructs.
147  VarDecl *isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo = false,
148  unsigned StopAt = 0);
149 
150  /// The member expression(this->fd) needs to be rebuilt in the template
151  /// instantiation to generate private copy for OpenMP when default
152  /// clause is used. The function will return true if default
153  /// cluse is used.
155 
158 
159  /// If the current region is a loop-based region, mark the start of the loop
160  /// construct.
161  void startOpenMPLoop();
162 
163  /// If the current region is a range loop-based region, mark the start of the
164  /// loop construct.
165  void startOpenMPCXXRangeFor();
166 
167  /// Check if the specified variable is used in 'private' clause.
168  /// \param Level Relative level of nested OpenMP construct for that the check
169  /// is performed.
171  unsigned CapLevel) const;
172 
173  /// Sets OpenMP capture kind (OMPC_private, OMPC_firstprivate, OMPC_map etc.)
174  /// for \p FD based on DSA for the provided corresponding captured declaration
175  /// \p D.
176  void setOpenMPCaptureKind(FieldDecl *FD, const ValueDecl *D, unsigned Level);
177 
178  /// Check if the specified variable is captured by 'target' directive.
179  /// \param Level Relative level of nested OpenMP construct for that the check
180  /// is performed.
181  bool isOpenMPTargetCapturedDecl(const ValueDecl *D, unsigned Level,
182  unsigned CaptureLevel) const;
183 
184  /// Check if the specified global variable must be captured by outer capture
185  /// regions.
186  /// \param Level Relative level of nested OpenMP construct for that
187  /// the check is performed.
188  bool isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level,
189  unsigned CaptureLevel) const;
190 
192  Expr *Op);
193  /// Called on start of new data sharing attribute block.
195  const DeclarationNameInfo &DirName, Scope *CurScope,
197  /// Start analysis of clauses.
199  /// End analysis of clauses.
200  void EndOpenMPClause();
201  /// Called on end of data sharing attribute block.
202  void EndOpenMPDSABlock(Stmt *CurDirective);
203 
204  /// Check if the current region is an OpenMP loop region and if it is,
205  /// mark loop control variable, used in \p Init for loop initialization, as
206  /// private by default.
207  /// \param Init First part of the for loop.
209 
210  /// Called on well-formed '\#pragma omp metadirective' after parsing
211  /// of the associated statement.
213  Stmt *AStmt, SourceLocation StartLoc,
214  SourceLocation EndLoc);
215 
216  // OpenMP directives and clauses.
217  /// Called on correct id-expression from the '#pragma omp
218  /// threadprivate'.
220  const DeclarationNameInfo &Id,
222  /// Called on well-formed '#pragma omp threadprivate'.
224  ArrayRef<Expr *> VarList);
225  /// Builds a new OpenMPThreadPrivateDecl and checks its correctness.
227  ArrayRef<Expr *> VarList);
228  /// Called on well-formed '#pragma omp allocate'.
230  ArrayRef<Expr *> VarList,
231  ArrayRef<OMPClause *> Clauses,
232  DeclContext *Owner = nullptr);
233 
234  /// Called on well-formed '#pragma omp [begin] assume[s]'.
236  OpenMPDirectiveKind DKind,
237  ArrayRef<std::string> Assumptions,
238  bool SkippedClauses);
239 
240  /// Check if there is an active global `omp begin assumes` directive.
241  bool isInOpenMPAssumeScope() const { return !OMPAssumeScoped.empty(); }
242 
243  /// Check if there is an active global `omp assumes` directive.
244  bool hasGlobalOpenMPAssumes() const { return !OMPAssumeGlobal.empty(); }
245 
246  /// Called on well-formed '#pragma omp end assumes'.
248 
249  /// Called on well-formed '#pragma omp requires'.
251  ArrayRef<OMPClause *> ClauseList);
252  /// Check restrictions on Requires directive
254  ArrayRef<OMPClause *> Clauses);
255  /// Check if the specified type is allowed to be used in 'omp declare
256  /// reduction' construct.
259  /// Called on start of '#pragma omp declare reduction'.
261  Scope *S, DeclContext *DC, DeclarationName Name,
262  ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
263  AccessSpecifier AS, Decl *PrevDeclInScope = nullptr);
264  /// Initialize declare reduction construct initializer.
266  /// Finish current declare reduction construct initializer.
268  /// Initialize declare reduction construct initializer.
269  /// \return omp_priv variable.
271  /// Finish current declare reduction construct initializer.
273  VarDecl *OmpPrivParm);
274  /// Called at the end of '#pragma omp declare reduction'.
276  Scope *S, DeclGroupPtrTy DeclReductions, bool IsValid);
277 
278  /// Check variable declaration in 'omp declare mapper' construct.
280  /// Check if the specified type is allowed to be used in 'omp declare
281  /// mapper' construct.
284  /// Called on start of '#pragma omp declare mapper'.
286  Scope *S, DeclContext *DC, DeclarationName Name, QualType MapperType,
288  Expr *MapperVarRef, ArrayRef<OMPClause *> Clauses,
289  Decl *PrevDeclInScope = nullptr);
290  /// Build the mapper variable of '#pragma omp declare mapper'.
292  QualType MapperType,
293  SourceLocation StartLoc,
294  DeclarationName VN);
296  bool isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const;
298 
300  struct MapInfo {
301  OMPDeclareTargetDeclAttr::MapTypeTy MT;
303  };
304  /// Explicitly listed variables and functions in a 'to' or 'link' clause.
305  llvm::DenseMap<NamedDecl *, MapInfo> ExplicitlyMapped;
306 
307  /// The 'device_type' as parsed from the clause.
308  OMPDeclareTargetDeclAttr::DevTypeTy DT = OMPDeclareTargetDeclAttr::DT_Any;
309 
310  /// The directive kind, `begin declare target` or `declare target`.
312 
313  /// The directive with indirect clause.
314  std::optional<Expr *> Indirect;
315 
316  /// The directive location.
318 
320  : Kind(Kind), Loc(Loc) {}
321  };
322 
323  /// Called on the start of target region i.e. '#pragma omp declare target'.
324  bool ActOnStartOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
325 
326  /// Called at the end of target region i.e. '#pragma omp end declare target'.
327  const DeclareTargetContextInfo ActOnOpenMPEndDeclareTargetDirective();
328 
329  /// Called once a target context is completed, that can be when a
330  /// '#pragma omp end declare target' was encountered or when a
331  /// '#pragma omp declare target' without declaration-definition-seq was
332  /// encountered.
333  void ActOnFinishedOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI);
334 
335  /// Report unterminated 'omp declare target' or 'omp begin declare target' at
336  /// the end of a compilation unit.
338 
339  /// Searches for the provided declaration name for OpenMP declare target
340  /// directive.
342  CXXScopeSpec &ScopeSpec,
343  const DeclarationNameInfo &Id);
344 
345  /// Called on correct id-expression from the '#pragma omp declare target'.
347  OMPDeclareTargetDeclAttr::MapTypeTy MT,
348  DeclareTargetContextInfo &DTCI);
349 
350  /// Check declaration inside target region.
351  void
353  SourceLocation IdLoc = SourceLocation());
354 
355  /// Adds OMPDeclareTargetDeclAttr to referenced variables in declare target
356  /// directive.
358 
359  /// Finishes analysis of the deferred functions calls that may be declared as
360  /// host/nohost during device/host compilation.
361  void finalizeOpenMPDelayedAnalysis(const FunctionDecl *Caller,
362  const FunctionDecl *Callee,
364 
365  /// Return true if currently in OpenMP task with untied clause context.
366  bool isInOpenMPTaskUntiedContext() const;
367 
368  /// Return true inside OpenMP declare target region.
370  return !DeclareTargetNesting.empty();
371  }
372  /// Return true inside OpenMP target region.
374 
375  /// Return the number of captured regions created for an OpenMP directive.
377 
378  /// Initialization of captured region for OpenMP region.
379  void ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope);
380 
381  /// Called for syntactical loops (ForStmt or CXXForRangeStmt) associated to
382  /// an OpenMP loop directive.
384 
385  /// Process a canonical OpenMP loop nest that can either be a canonical
386  /// literal loop (ForStmt or CXXForRangeStmt), or the generated loop of an
387  /// OpenMP loop transformation construct.
389 
390  /// End of OpenMP region.
391  ///
392  /// \param S Statement associated with the current OpenMP region.
393  /// \param Clauses List of clauses for the current OpenMP region.
394  ///
395  /// \returns Statement for finished OpenMP region.
399  OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
400  Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc,
401  OpenMPDirectiveKind PrevMappedDirective = llvm::omp::OMPD_unknown);
402  /// Called on well-formed '\#pragma omp parallel' after parsing
403  /// of the associated statement.
405  Stmt *AStmt, SourceLocation StartLoc,
406  SourceLocation EndLoc);
408  llvm::SmallDenseMap<const ValueDecl *, const Expr *, 4>;
409  /// Called on well-formed '\#pragma omp simd' after parsing
410  /// of the associated statement.
411  StmtResult
413  SourceLocation StartLoc, SourceLocation EndLoc,
414  VarsWithInheritedDSAType &VarsWithImplicitDSA);
415  /// Called on well-formed '#pragma omp tile' after parsing of its clauses and
416  /// the associated statement.
418  Stmt *AStmt, SourceLocation StartLoc,
419  SourceLocation EndLoc);
420  /// Called on well-formed '#pragma omp unroll' after parsing of its clauses
421  /// and the associated statement.
423  Stmt *AStmt, SourceLocation StartLoc,
424  SourceLocation EndLoc);
425  /// Called on well-formed '\#pragma omp for' after parsing
426  /// of the associated statement.
427  StmtResult
429  SourceLocation StartLoc, SourceLocation EndLoc,
430  VarsWithInheritedDSAType &VarsWithImplicitDSA);
431  /// Called on well-formed '\#pragma omp for simd' after parsing
432  /// of the associated statement.
433  StmtResult
435  SourceLocation StartLoc, SourceLocation EndLoc,
436  VarsWithInheritedDSAType &VarsWithImplicitDSA);
437  /// Called on well-formed '\#pragma omp sections' after parsing
438  /// of the associated statement.
440  Stmt *AStmt, SourceLocation StartLoc,
441  SourceLocation EndLoc);
442  /// Called on well-formed '\#pragma omp section' after parsing of the
443  /// associated statement.
445  SourceLocation EndLoc);
446  /// Called on well-formed '\#pragma omp scope' after parsing of the
447  /// associated statement.
449  Stmt *AStmt, SourceLocation StartLoc,
450  SourceLocation EndLoc);
451  /// Called on well-formed '\#pragma omp single' after parsing of the
452  /// associated statement.
454  Stmt *AStmt, SourceLocation StartLoc,
455  SourceLocation EndLoc);
456  /// Called on well-formed '\#pragma omp master' after parsing of the
457  /// associated statement.
459  SourceLocation EndLoc);
460  /// Called on well-formed '\#pragma omp critical' after parsing of the
461  /// associated statement.
463  ArrayRef<OMPClause *> Clauses,
464  Stmt *AStmt, SourceLocation StartLoc,
465  SourceLocation EndLoc);
466  /// Called on well-formed '\#pragma omp parallel for' after parsing
467  /// of the associated statement.
469  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
470  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
471  /// Called on well-formed '\#pragma omp parallel for simd' after
472  /// parsing of the associated statement.
474  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
475  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
476  /// Called on well-formed '\#pragma omp parallel master' after
477  /// parsing of the associated statement.
479  Stmt *AStmt,
480  SourceLocation StartLoc,
481  SourceLocation EndLoc);
482  /// Called on well-formed '\#pragma omp parallel masked' after
483  /// parsing of the associated statement.
485  Stmt *AStmt,
486  SourceLocation StartLoc,
487  SourceLocation EndLoc);
488  /// Called on well-formed '\#pragma omp parallel sections' after
489  /// parsing of the associated statement.
491  Stmt *AStmt,
492  SourceLocation StartLoc,
493  SourceLocation EndLoc);
494  /// Called on well-formed '\#pragma omp task' after parsing of the
495  /// associated statement.
497  Stmt *AStmt, SourceLocation StartLoc,
498  SourceLocation EndLoc);
499  /// Called on well-formed '\#pragma omp taskyield'.
501  SourceLocation EndLoc);
502  /// Called on well-formed '\#pragma omp error'.
503  /// Error direcitive is allowed in both declared and excutable contexts.
504  /// Adding InExContext to identify which context is called from.
506  SourceLocation StartLoc,
507  SourceLocation EndLoc,
508  bool InExContext = true);
509  /// Called on well-formed '\#pragma omp barrier'.
511  SourceLocation EndLoc);
512  /// Called on well-formed '\#pragma omp taskwait'.
514  SourceLocation StartLoc,
515  SourceLocation EndLoc);
516  /// Called on well-formed '\#pragma omp taskgroup'.
518  Stmt *AStmt, SourceLocation StartLoc,
519  SourceLocation EndLoc);
520  /// Called on well-formed '\#pragma omp flush'.
522  SourceLocation StartLoc,
523  SourceLocation EndLoc);
524  /// Called on well-formed '\#pragma omp depobj'.
526  SourceLocation StartLoc,
527  SourceLocation EndLoc);
528  /// Called on well-formed '\#pragma omp scan'.
530  SourceLocation StartLoc,
531  SourceLocation EndLoc);
532  /// Called on well-formed '\#pragma omp ordered' after parsing of the
533  /// associated statement.
535  Stmt *AStmt, SourceLocation StartLoc,
536  SourceLocation EndLoc);
537  /// Called on well-formed '\#pragma omp atomic' after parsing of the
538  /// associated statement.
540  Stmt *AStmt, SourceLocation StartLoc,
541  SourceLocation EndLoc);
542  /// Called on well-formed '\#pragma omp target' after parsing of the
543  /// associated statement.
545  Stmt *AStmt, SourceLocation StartLoc,
546  SourceLocation EndLoc);
547  /// Called on well-formed '\#pragma omp target data' after parsing of
548  /// the associated statement.
550  Stmt *AStmt,
551  SourceLocation StartLoc,
552  SourceLocation EndLoc);
553  /// Called on well-formed '\#pragma omp target enter data' after
554  /// parsing of the associated statement.
556  SourceLocation StartLoc,
557  SourceLocation EndLoc,
558  Stmt *AStmt);
559  /// Called on well-formed '\#pragma omp target exit data' after
560  /// parsing of the associated statement.
562  SourceLocation StartLoc,
563  SourceLocation EndLoc,
564  Stmt *AStmt);
565  /// Called on well-formed '\#pragma omp target parallel' after
566  /// parsing of the associated statement.
568  Stmt *AStmt,
569  SourceLocation StartLoc,
570  SourceLocation EndLoc);
571  /// Called on well-formed '\#pragma omp target parallel for' after
572  /// parsing of the associated statement.
574  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
575  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
576  /// Called on well-formed '\#pragma omp teams' after parsing of the
577  /// associated statement.
579  Stmt *AStmt, SourceLocation StartLoc,
580  SourceLocation EndLoc);
581  /// Called on well-formed '\#pragma omp teams loop' after parsing of the
582  /// associated statement.
584  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
585  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
586  /// Called on well-formed '\#pragma omp target teams loop' after parsing of
587  /// the associated statement.
589  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
590  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
591  /// Called on well-formed '\#pragma omp parallel loop' after parsing of the
592  /// associated statement.
594  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
595  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
596  /// Called on well-formed '\#pragma omp target parallel loop' after parsing
597  /// of the associated statement.
599  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
600  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
601  /// Called on well-formed '\#pragma omp cancellation point'.
602  StmtResult
604  SourceLocation EndLoc,
605  OpenMPDirectiveKind CancelRegion);
606  /// Called on well-formed '\#pragma omp cancel'.
608  SourceLocation StartLoc,
609  SourceLocation EndLoc,
610  OpenMPDirectiveKind CancelRegion);
611  /// Called on well-formed '\#pragma omp taskloop' after parsing of the
612  /// associated statement.
613  StmtResult
615  SourceLocation StartLoc, SourceLocation EndLoc,
616  VarsWithInheritedDSAType &VarsWithImplicitDSA);
617  /// Called on well-formed '\#pragma omp taskloop simd' after parsing of
618  /// the associated statement.
620  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
621  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
622  /// Called on well-formed '\#pragma omp master taskloop' 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 master taskloop simd' 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 master taskloop' after
633  /// parsing of the associated statement.
635  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
636  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
637  /// Called on well-formed '\#pragma omp parallel master taskloop simd' after
638  /// parsing of the associated statement.
640  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
641  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
642  /// Called on well-formed '\#pragma omp masked taskloop' after parsing of the
643  /// associated statement.
645  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
646  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
647  /// Called on well-formed '\#pragma omp masked taskloop simd' after parsing of
648  /// the associated statement.
650  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
651  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
652  /// Called on well-formed '\#pragma omp parallel masked taskloop' after
653  /// parsing of the associated statement.
655  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
656  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
657  /// Called on well-formed '\#pragma omp parallel masked taskloop simd' after
658  /// parsing of the associated statement.
660  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
661  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
662  /// Called on well-formed '\#pragma omp distribute' after parsing
663  /// of the associated statement.
664  StmtResult
666  SourceLocation StartLoc, SourceLocation EndLoc,
667  VarsWithInheritedDSAType &VarsWithImplicitDSA);
668  /// Called on well-formed '\#pragma omp target update'.
670  SourceLocation StartLoc,
671  SourceLocation EndLoc,
672  Stmt *AStmt);
673  /// Called on well-formed '\#pragma omp distribute parallel for' 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 distribute parallel for simd'
679  /// after 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 distribute simd' after
684  /// parsing of the associated statement.
686  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
687  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
688  /// Called on well-formed '\#pragma omp target parallel for simd' after
689  /// parsing of the associated statement.
691  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
692  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
693  /// Called on well-formed '\#pragma omp target simd' after parsing of
694  /// the associated statement.
695  StmtResult
697  SourceLocation StartLoc, SourceLocation EndLoc,
698  VarsWithInheritedDSAType &VarsWithImplicitDSA);
699  /// Called on well-formed '\#pragma omp teams distribute' after parsing of
700  /// the associated statement.
702  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
703  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
704  /// Called on well-formed '\#pragma omp teams distribute simd' after parsing
705  /// of the associated statement.
707  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
708  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
709  /// Called on well-formed '\#pragma omp teams distribute parallel for simd'
710  /// after parsing of the associated statement.
712  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
713  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
714  /// Called on well-formed '\#pragma omp teams distribute parallel for'
715  /// after 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 target teams' after parsing of the
720  /// associated statement.
722  Stmt *AStmt,
723  SourceLocation StartLoc,
724  SourceLocation EndLoc);
725  /// Called on well-formed '\#pragma omp target teams distribute' after parsing
726  /// of the associated statement.
728  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
729  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
730  /// Called on well-formed '\#pragma omp target teams distribute parallel for'
731  /// after parsing of the associated statement.
733  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
734  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
735  /// Called on well-formed '\#pragma omp target teams distribute parallel for
736  /// simd' after parsing of the associated statement.
738  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
739  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
740  /// Called on well-formed '\#pragma omp target teams distribute simd' after
741  /// parsing of the associated statement.
743  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
744  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
745  /// Called on well-formed '\#pragma omp interop'.
747  SourceLocation StartLoc,
748  SourceLocation EndLoc);
749  /// Called on well-formed '\#pragma omp dispatch' after parsing of the
750  // /associated statement.
752  Stmt *AStmt, SourceLocation StartLoc,
753  SourceLocation EndLoc);
754  /// Called on well-formed '\#pragma omp masked' after parsing of the
755  // /associated statement.
757  Stmt *AStmt, SourceLocation StartLoc,
758  SourceLocation EndLoc);
759 
760  /// Called on well-formed '\#pragma omp loop' after parsing of the
761  /// associated statement.
763  ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
764  SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA);
765 
766  /// Checks correctness of linear modifiers.
768  SourceLocation LinLoc);
769  /// Checks that the specified declaration matches requirements for the linear
770  /// decls.
771  bool CheckOpenMPLinearDecl(const ValueDecl *D, SourceLocation ELoc,
773  bool IsDeclareSimd = false);
774 
775  /// Called on well-formed '\#pragma omp declare simd' after parsing of
776  /// the associated method/function.
778  DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
779  Expr *Simdlen, ArrayRef<Expr *> Uniforms, ArrayRef<Expr *> Aligneds,
780  ArrayRef<Expr *> Alignments, ArrayRef<Expr *> Linears,
781  ArrayRef<unsigned> LinModifiers, ArrayRef<Expr *> Steps, SourceRange SR);
782 
783  /// Checks '\#pragma omp declare variant' variant function and original
784  /// functions after parsing of the associated method/function.
785  /// \param DG Function declaration to which declare variant directive is
786  /// applied to.
787  /// \param VariantRef Expression that references the variant function, which
788  /// must be used instead of the original one, specified in \p DG.
789  /// \param TI The trait info object representing the match clause.
790  /// \param NumAppendArgs The number of omp_interop_t arguments to account for
791  /// in checking.
792  /// \returns std::nullopt, if the function/variant function are not compatible
793  /// with the pragma, pair of original function/variant ref expression
794  /// otherwise.
795  std::optional<std::pair<FunctionDecl *, Expr *>>
797  OMPTraitInfo &TI, unsigned NumAppendArgs,
798  SourceRange SR);
799 
800  /// Called on well-formed '\#pragma omp declare variant' after parsing of
801  /// the associated method/function.
802  /// \param FD Function declaration to which declare variant directive is
803  /// applied to.
804  /// \param VariantRef Expression that references the variant function, which
805  /// must be used instead of the original one, specified in \p DG.
806  /// \param TI The context traits associated with the function variant.
807  /// \param AdjustArgsNothing The list of 'nothing' arguments.
808  /// \param AdjustArgsNeedDevicePtr The list of 'need_device_ptr' arguments.
809  /// \param AppendArgs The list of 'append_args' arguments.
810  /// \param AdjustArgsLoc The Location of an 'adjust_args' clause.
811  /// \param AppendArgsLoc The Location of an 'append_args' clause.
812  /// \param SR The SourceRange of the 'declare variant' directive.
814  FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI,
815  ArrayRef<Expr *> AdjustArgsNothing,
816  ArrayRef<Expr *> AdjustArgsNeedDevicePtr,
817  ArrayRef<OMPInteropInfo> AppendArgs, SourceLocation AdjustArgsLoc,
818  SourceLocation AppendArgsLoc, SourceRange SR);
819 
821  SourceLocation StartLoc,
822  SourceLocation LParenLoc,
823  SourceLocation EndLoc);
824  /// Called on well-formed 'allocator' clause.
826  SourceLocation StartLoc,
827  SourceLocation LParenLoc,
828  SourceLocation EndLoc);
829  /// Called on well-formed 'if' clause.
831  Expr *Condition, SourceLocation StartLoc,
832  SourceLocation LParenLoc,
833  SourceLocation NameModifierLoc,
834  SourceLocation ColonLoc,
835  SourceLocation EndLoc);
836  /// Called on well-formed 'final' clause.
837  OMPClause *ActOnOpenMPFinalClause(Expr *Condition, SourceLocation StartLoc,
838  SourceLocation LParenLoc,
839  SourceLocation EndLoc);
840  /// Called on well-formed 'num_threads' clause.
842  SourceLocation StartLoc,
843  SourceLocation LParenLoc,
844  SourceLocation EndLoc);
845  /// Called on well-formed 'align' clause.
846  OMPClause *ActOnOpenMPAlignClause(Expr *Alignment, SourceLocation StartLoc,
847  SourceLocation LParenLoc,
848  SourceLocation EndLoc);
849  /// Called on well-formed 'safelen' clause.
851  SourceLocation LParenLoc,
852  SourceLocation EndLoc);
853  /// Called on well-formed 'simdlen' clause.
855  SourceLocation LParenLoc,
856  SourceLocation EndLoc);
857  /// Called on well-form 'sizes' clause.
859  SourceLocation StartLoc,
860  SourceLocation LParenLoc,
861  SourceLocation EndLoc);
862  /// Called on well-form 'full' clauses.
864  SourceLocation EndLoc);
865  /// Called on well-form 'partial' clauses.
866  OMPClause *ActOnOpenMPPartialClause(Expr *FactorExpr, SourceLocation StartLoc,
867  SourceLocation LParenLoc,
868  SourceLocation EndLoc);
869  /// Called on well-formed 'collapse' clause.
871  SourceLocation StartLoc,
872  SourceLocation LParenLoc,
873  SourceLocation EndLoc);
874  /// Called on well-formed 'ordered' clause.
875  OMPClause *
877  SourceLocation LParenLoc = SourceLocation(),
878  Expr *NumForLoops = nullptr);
879  /// Called on well-formed 'grainsize' clause.
881  Expr *Size, SourceLocation StartLoc,
882  SourceLocation LParenLoc,
883  SourceLocation ModifierLoc,
884  SourceLocation EndLoc);
885  /// Called on well-formed 'num_tasks' clause.
887  Expr *NumTasks, SourceLocation StartLoc,
888  SourceLocation LParenLoc,
889  SourceLocation ModifierLoc,
890  SourceLocation EndLoc);
891  /// Called on well-formed 'hint' clause.
893  SourceLocation LParenLoc,
894  SourceLocation EndLoc);
895  /// Called on well-formed 'detach' clause.
897  SourceLocation LParenLoc,
898  SourceLocation EndLoc);
899 
901  SourceLocation ArgumentLoc,
902  SourceLocation StartLoc,
903  SourceLocation LParenLoc,
904  SourceLocation EndLoc);
905  /// Called on well-formed 'when' clause.
907  SourceLocation LParenLoc,
908  SourceLocation EndLoc);
909  /// Called on well-formed 'default' clause.
910  OMPClause *ActOnOpenMPDefaultClause(llvm::omp::DefaultKind Kind,
911  SourceLocation KindLoc,
912  SourceLocation StartLoc,
913  SourceLocation LParenLoc,
914  SourceLocation EndLoc);
915  /// Called on well-formed 'proc_bind' clause.
916  OMPClause *ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind,
917  SourceLocation KindLoc,
918  SourceLocation StartLoc,
919  SourceLocation LParenLoc,
920  SourceLocation EndLoc);
921  /// Called on well-formed 'order' clause.
924  SourceLocation StartLoc,
925  SourceLocation LParenLoc,
926  SourceLocation MLoc, SourceLocation KindLoc,
927  SourceLocation EndLoc);
928  /// Called on well-formed 'update' clause.
930  SourceLocation KindLoc,
931  SourceLocation StartLoc,
932  SourceLocation LParenLoc,
933  SourceLocation EndLoc);
934 
937  SourceLocation StartLoc, SourceLocation LParenLoc,
938  ArrayRef<SourceLocation> ArgumentsLoc, SourceLocation DelimLoc,
939  SourceLocation EndLoc);
940  /// Called on well-formed 'schedule' clause.
943  OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc,
944  SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc,
945  SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc);
946 
948  SourceLocation EndLoc);
949  /// Called on well-formed 'nowait' clause.
951  SourceLocation EndLoc);
952  /// Called on well-formed 'untied' clause.
954  SourceLocation EndLoc);
955  /// Called on well-formed 'mergeable' clause.
957  SourceLocation EndLoc);
958  /// Called on well-formed 'read' clause.
960  SourceLocation EndLoc);
961  /// Called on well-formed 'write' clause.
963  SourceLocation EndLoc);
964  /// Called on well-formed 'update' clause.
966  SourceLocation EndLoc);
967  /// Called on well-formed 'capture' clause.
969  SourceLocation EndLoc);
970  /// Called on well-formed 'compare' clause.
972  SourceLocation EndLoc);
973  /// Called on well-formed 'fail' clause.
975  SourceLocation EndLoc);
977  SourceLocation KindLoc,
978  SourceLocation StartLoc,
979  SourceLocation LParenLoc,
980  SourceLocation EndLoc);
981 
982  /// Called on well-formed 'seq_cst' clause.
984  SourceLocation EndLoc);
985  /// Called on well-formed 'acq_rel' clause.
987  SourceLocation EndLoc);
988  /// Called on well-formed 'acquire' clause.
990  SourceLocation EndLoc);
991  /// Called on well-formed 'release' clause.
993  SourceLocation EndLoc);
994  /// Called on well-formed 'relaxed' clause.
996  SourceLocation EndLoc);
997  /// Called on well-formed 'weak' clause.
999  SourceLocation EndLoc);
1000 
1001  /// Called on well-formed 'init' clause.
1002  OMPClause *
1003  ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo,
1004  SourceLocation StartLoc, SourceLocation LParenLoc,
1005  SourceLocation VarLoc, SourceLocation EndLoc);
1006 
1007  /// Called on well-formed 'use' clause.
1008  OMPClause *ActOnOpenMPUseClause(Expr *InteropVar, SourceLocation StartLoc,
1009  SourceLocation LParenLoc,
1010  SourceLocation VarLoc, SourceLocation EndLoc);
1011 
1012  /// Called on well-formed 'destroy' clause.
1013  OMPClause *ActOnOpenMPDestroyClause(Expr *InteropVar, SourceLocation StartLoc,
1014  SourceLocation LParenLoc,
1015  SourceLocation VarLoc,
1016  SourceLocation EndLoc);
1017  /// Called on well-formed 'novariants' clause.
1019  SourceLocation StartLoc,
1020  SourceLocation LParenLoc,
1021  SourceLocation EndLoc);
1022  /// Called on well-formed 'nocontext' clause.
1024  SourceLocation StartLoc,
1025  SourceLocation LParenLoc,
1026  SourceLocation EndLoc);
1027  /// Called on well-formed 'filter' clause.
1029  SourceLocation LParenLoc,
1030  SourceLocation EndLoc);
1031  /// Called on well-formed 'threads' clause.
1033  SourceLocation EndLoc);
1034  /// Called on well-formed 'simd' clause.
1036  SourceLocation EndLoc);
1037  /// Called on well-formed 'nogroup' clause.
1039  SourceLocation EndLoc);
1040  /// Called on well-formed 'unified_address' clause.
1042  SourceLocation EndLoc);
1043 
1044  /// Called on well-formed 'unified_address' clause.
1046  SourceLocation EndLoc);
1047 
1048  /// Called on well-formed 'reverse_offload' clause.
1050  SourceLocation EndLoc);
1051 
1052  /// Called on well-formed 'dynamic_allocators' clause.
1054  SourceLocation EndLoc);
1055 
1056  /// Called on well-formed 'atomic_default_mem_order' clause.
1059  SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1060 
1061  /// Called on well-formed 'at' clause.
1063  SourceLocation KindLoc,
1064  SourceLocation StartLoc,
1065  SourceLocation LParenLoc,
1066  SourceLocation EndLoc);
1067 
1068  /// Called on well-formed 'severity' clause.
1070  SourceLocation KindLoc,
1071  SourceLocation StartLoc,
1072  SourceLocation LParenLoc,
1073  SourceLocation EndLoc);
1074 
1075  /// Called on well-formed 'message' clause.
1076  /// passing string for message.
1078  SourceLocation LParenLoc,
1079  SourceLocation EndLoc);
1080 
1081  /// Data used for processing a list of variables in OpenMP clauses.
1082  struct OpenMPVarListDataTy final {
1084  Expr *IteratorExpr = nullptr;
1089  int ExtraModifier = -1; ///< Additional modifier for linear, map, depend or
1090  ///< lastprivate clause.
1098  bool IsMapTypeImplicit = false;
1102  StepModifierLoc; /// 'step' modifier location for linear clause
1103  };
1104 
1106  ArrayRef<Expr *> Vars,
1107  const OMPVarListLocTy &Locs,
1108  OpenMPVarListDataTy &Data);
1109  /// Called on well-formed 'inclusive' clause.
1111  SourceLocation StartLoc,
1112  SourceLocation LParenLoc,
1113  SourceLocation EndLoc);
1114  /// Called on well-formed 'exclusive' clause.
1116  SourceLocation StartLoc,
1117  SourceLocation LParenLoc,
1118  SourceLocation EndLoc);
1119  /// Called on well-formed 'allocate' clause.
1120  OMPClause *
1121  ActOnOpenMPAllocateClause(Expr *Allocator, ArrayRef<Expr *> VarList,
1122  SourceLocation StartLoc, SourceLocation ColonLoc,
1123  SourceLocation LParenLoc, SourceLocation EndLoc);
1124  /// Called on well-formed 'private' clause.
1126  SourceLocation StartLoc,
1127  SourceLocation LParenLoc,
1128  SourceLocation EndLoc);
1129  /// Called on well-formed 'firstprivate' clause.
1131  SourceLocation StartLoc,
1132  SourceLocation LParenLoc,
1133  SourceLocation EndLoc);
1134  /// Called on well-formed 'lastprivate' clause.
1137  SourceLocation LPKindLoc, SourceLocation ColonLoc,
1138  SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc);
1139  /// Called on well-formed 'shared' clause.
1141  SourceLocation StartLoc,
1142  SourceLocation LParenLoc,
1143  SourceLocation EndLoc);
1144  /// Called on well-formed 'reduction' clause.
1147  SourceLocation StartLoc, SourceLocation LParenLoc,
1148  SourceLocation ModifierLoc, SourceLocation ColonLoc,
1149  SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec,
1150  const DeclarationNameInfo &ReductionId,
1151  ArrayRef<Expr *> UnresolvedReductions = std::nullopt);
1152  /// Called on well-formed 'task_reduction' clause.
1154  ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1155  SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1156  CXXScopeSpec &ReductionIdScopeSpec,
1157  const DeclarationNameInfo &ReductionId,
1158  ArrayRef<Expr *> UnresolvedReductions = std::nullopt);
1159  /// Called on well-formed 'in_reduction' clause.
1161  ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1162  SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc,
1163  CXXScopeSpec &ReductionIdScopeSpec,
1164  const DeclarationNameInfo &ReductionId,
1165  ArrayRef<Expr *> UnresolvedReductions = std::nullopt);
1166  /// Called on well-formed 'linear' clause.
1168  ArrayRef<Expr *> VarList, Expr *Step, SourceLocation StartLoc,
1169  SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind,
1170  SourceLocation LinLoc, SourceLocation ColonLoc,
1171  SourceLocation StepModifierLoc, SourceLocation EndLoc);
1172  /// Called on well-formed 'aligned' clause.
1174  SourceLocation StartLoc,
1175  SourceLocation LParenLoc,
1176  SourceLocation ColonLoc,
1177  SourceLocation EndLoc);
1178  /// Called on well-formed 'copyin' clause.
1180  SourceLocation StartLoc,
1181  SourceLocation LParenLoc,
1182  SourceLocation EndLoc);
1183  /// Called on well-formed 'copyprivate' clause.
1185  SourceLocation StartLoc,
1186  SourceLocation LParenLoc,
1187  SourceLocation EndLoc);
1188  /// Called on well-formed 'flush' pseudo clause.
1190  SourceLocation StartLoc,
1191  SourceLocation LParenLoc,
1192  SourceLocation EndLoc);
1193  /// Called on well-formed 'depobj' pseudo clause.
1195  SourceLocation LParenLoc,
1196  SourceLocation EndLoc);
1197  /// Called on well-formed 'depend' clause.
1199  Expr *DepModifier,
1200  ArrayRef<Expr *> VarList,
1201  SourceLocation StartLoc,
1202  SourceLocation LParenLoc,
1203  SourceLocation EndLoc);
1204  /// Called on well-formed 'device' clause.
1206  Expr *Device, SourceLocation StartLoc,
1207  SourceLocation LParenLoc,
1208  SourceLocation ModifierLoc,
1209  SourceLocation EndLoc);
1210  /// Called on well-formed 'map' clause.
1212  Expr *IteratorModifier, ArrayRef<OpenMPMapModifierKind> MapTypeModifiers,
1213  ArrayRef<SourceLocation> MapTypeModifiersLoc,
1214  CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
1215  OpenMPMapClauseKind MapType, bool IsMapTypeImplicit,
1216  SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
1217  const OMPVarListLocTy &Locs, bool NoDiagnose = false,
1218  ArrayRef<Expr *> UnresolvedMappers = std::nullopt);
1219  /// Called on well-formed 'num_teams' clause.
1221  SourceLocation LParenLoc,
1222  SourceLocation EndLoc);
1223  /// Called on well-formed 'thread_limit' clause.
1225  SourceLocation StartLoc,
1226  SourceLocation LParenLoc,
1227  SourceLocation EndLoc);
1228  /// Called on well-formed 'priority' clause.
1230  SourceLocation LParenLoc,
1231  SourceLocation EndLoc);
1232  /// Called on well-formed 'dist_schedule' clause.
1235  SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc,
1236  SourceLocation CommaLoc, SourceLocation EndLoc);
1237  /// Called on well-formed 'defaultmap' clause.
1240  SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc,
1241  SourceLocation KindLoc, SourceLocation EndLoc);
1242  /// Called on well-formed 'to' clause.
1243  OMPClause *
1245  ArrayRef<SourceLocation> MotionModifiersLoc,
1246  CXXScopeSpec &MapperIdScopeSpec,
1247  DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1248  ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1249  ArrayRef<Expr *> UnresolvedMappers = std::nullopt);
1250  /// Called on well-formed 'from' clause.
1251  OMPClause *
1253  ArrayRef<SourceLocation> MotionModifiersLoc,
1254  CXXScopeSpec &MapperIdScopeSpec,
1255  DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
1256  ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
1257  ArrayRef<Expr *> UnresolvedMappers = std::nullopt);
1258  /// Called on well-formed 'use_device_ptr' clause.
1260  const OMPVarListLocTy &Locs);
1261  /// Called on well-formed 'use_device_addr' clause.
1263  const OMPVarListLocTy &Locs);
1264  /// Called on well-formed 'is_device_ptr' clause.
1266  const OMPVarListLocTy &Locs);
1267  /// Called on well-formed 'has_device_addr' clause.
1269  const OMPVarListLocTy &Locs);
1270  /// Called on well-formed 'nontemporal' clause.
1272  SourceLocation StartLoc,
1273  SourceLocation LParenLoc,
1274  SourceLocation EndLoc);
1275 
1276  /// Data for list of allocators.
1278  /// Allocator.
1279  Expr *Allocator = nullptr;
1280  /// Allocator traits.
1281  Expr *AllocatorTraits = nullptr;
1282  /// Locations of '(' and ')' symbols.
1284  };
1285  /// Called on well-formed 'uses_allocators' clause.
1287  SourceLocation LParenLoc,
1288  SourceLocation EndLoc,
1290  /// Called on well-formed 'affinity' clause.
1292  SourceLocation LParenLoc,
1293  SourceLocation ColonLoc,
1294  SourceLocation EndLoc, Expr *Modifier,
1295  ArrayRef<Expr *> Locators);
1296  /// Called on a well-formed 'bind' clause.
1298  SourceLocation KindLoc,
1299  SourceLocation StartLoc,
1300  SourceLocation LParenLoc,
1301  SourceLocation EndLoc);
1302 
1303  /// Called on a well-formed 'ompx_dyn_cgroup_mem' clause.
1305  SourceLocation LParenLoc,
1306  SourceLocation EndLoc);
1307 
1308  /// Called on well-formed 'doacross' clause.
1309  OMPClause *
1311  SourceLocation DepLoc, SourceLocation ColonLoc,
1312  ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1313  SourceLocation LParenLoc, SourceLocation EndLoc);
1314 
1315  /// Called on a well-formed 'ompx_attribute' clause.
1317  SourceLocation StartLoc,
1318  SourceLocation LParenLoc,
1319  SourceLocation EndLoc);
1320 
1321  /// Called on a well-formed 'ompx_bare' clause.
1323  SourceLocation EndLoc);
1324 
1326  Expr *LowerBound,
1327  SourceLocation ColonLocFirst,
1328  SourceLocation ColonLocSecond,
1329  Expr *Length, Expr *Stride,
1330  SourceLocation RBLoc);
1332  SourceLocation RParenLoc,
1333  ArrayRef<Expr *> Dims,
1334  ArrayRef<SourceRange> Brackets);
1335 
1336  /// Data structure for iterator expression.
1345  };
1346 
1348  SourceLocation LLoc, SourceLocation RLoc,
1350 
1351 private:
1352  void *VarDataSharingAttributesStack;
1353 
1354  /// Number of nested '#pragma omp declare target' directives.
1355  SmallVector<DeclareTargetContextInfo, 4> DeclareTargetNesting;
1356 
1357  /// Initialization of data-sharing attributes stack.
1358  void InitDataSharingAttributesStack();
1359  void DestroyDataSharingAttributesStack();
1360 
1361  /// Returns OpenMP nesting level for current directive.
1362  unsigned getOpenMPNestingLevel() const;
1363 
1364  /// Adjusts the function scopes index for the target-based regions.
1365  void adjustOpenMPTargetScopeIndex(unsigned &FunctionScopesIndex,
1366  unsigned Level) const;
1367 
1368  /// Returns the number of scopes associated with the construct on the given
1369  /// OpenMP level.
1370  int getNumberOfConstructScopes(unsigned Level) const;
1371 
1372  /// Push new OpenMP function region for non-capturing function.
1373  void pushOpenMPFunctionRegion();
1374 
1375  /// Pop OpenMP function region for non-capturing function.
1376  void popOpenMPFunctionRegion(const sema::FunctionScopeInfo *OldFSI);
1377 
1378  /// Analyzes and checks a loop nest for use by a loop transformation.
1379  ///
1380  /// \param Kind The loop transformation directive kind.
1381  /// \param NumLoops How many nested loops the directive is expecting.
1382  /// \param AStmt Associated statement of the transformation directive.
1383  /// \param LoopHelpers [out] The loop analysis result.
1384  /// \param Body [out] The body code nested in \p NumLoops loop.
1385  /// \param OriginalInits [out] Collection of statements and declarations that
1386  /// must have been executed/declared before entering the
1387  /// loop.
1388  ///
1389  /// \return Whether there was any error.
1390  bool checkTransformableLoopNest(
1391  OpenMPDirectiveKind Kind, Stmt *AStmt, int NumLoops,
1393  Stmt *&Body, SmallVectorImpl<SmallVector<Stmt *, 0>> &OriginalInits);
1394 
1395  /// Helper to keep information about the current `omp begin/end declare
1396  /// variant` nesting.
1397  struct OMPDeclareVariantScope {
1398  /// The associated OpenMP context selector.
1399  OMPTraitInfo *TI;
1400 
1401  /// The associated OpenMP context selector mangling.
1402  std::string NameSuffix;
1403 
1404  OMPDeclareVariantScope(OMPTraitInfo &TI);
1405  };
1406 
1407  /// Return the OMPTraitInfo for the surrounding scope, if any.
1408  OMPTraitInfo *getOMPTraitInfoForSurroundingScope() {
1409  return OMPDeclareVariantScopes.empty() ? nullptr
1410  : OMPDeclareVariantScopes.back().TI;
1411  }
1412 
1413  /// The current `omp begin/end declare variant` scopes.
1414  SmallVector<OMPDeclareVariantScope, 4> OMPDeclareVariantScopes;
1415 
1416  /// The current `omp begin/end assumes` scopes.
1417  SmallVector<OMPAssumeAttr *, 4> OMPAssumeScoped;
1418 
1419  /// All `omp assumes` we encountered so far.
1420  SmallVector<OMPAssumeAttr *, 4> OMPAssumeGlobal;
1421 
1422  /// OMPD_loop is mapped to OMPD_for, OMPD_distribute or OMPD_simd depending
1423  /// on the parameter of the bind clause. In the methods for the
1424  /// mapped directives, check the parameters of the lastprivate clause.
1425  bool checkLastPrivateForMappedDirectives(ArrayRef<OMPClause *> Clauses);
1426  /// Depending on the bind clause of OMPD_loop map the directive to new
1427  /// directives.
1428  /// 1) loop bind(parallel) --> OMPD_for
1429  /// 2) loop bind(teams) --> OMPD_distribute
1430  /// 3) loop bind(thread) --> OMPD_simd
1431  /// This is being handled in Sema instead of Codegen because of the need for
1432  /// rigorous semantic checking in the new mapped directives.
1433  bool mapLoopConstruct(llvm::SmallVector<OMPClause *> &ClausesWithoutBind,
1434  ArrayRef<OMPClause *> Clauses,
1435  OpenMPBindClauseKind &BindKind,
1437  OpenMPDirectiveKind &PrevMappedDirective,
1438  SourceLocation StartLoc, SourceLocation EndLoc,
1439  const DeclarationNameInfo &DirName,
1440  OpenMPDirectiveKind CancelRegion);
1441 };
1442 
1443 } // namespace clang
1444 
1445 #endif // LLVM_CLANG_SEMA_SEMAOPENMP_H
#define V(N, I)
Definition: ASTContext.h:3299
int Id
Definition: ASTDiff.cpp:190
This file defines OpenMP nodes for declarative directives.
int Priority
Definition: Format.cpp:2980
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.
SourceLocation Loc
Definition: SemaObjC.cpp:755
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.
C Language Family Type Representation.
Represents a C++ nested-name-specifier or a global scope specifier.
Definition: DeclSpec.h:74
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1436
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:1900
This represents one expression.
Definition: Expr.h:110
Represents a member of a struct/union/class.
Definition: Decl.h:3060
Represents a function declaration or definition.
Definition: Decl.h:1972
One of these records is kept for each identifier that is lexed.
This represents a decl that may have a name.
Definition: Decl.h:249
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:55
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:417
This represents '#pragma omp threadprivate ...' directive.
Definition: DeclOpenMP.h:110
Helper data structure representing the traits in a match clause of an declare variant or metadirectiv...
Wrapper for void* pointer.
Definition: Ownership.h:50
Parser - This implements a parser for the C family of languages.
Definition: Parser.h:58
A (possibly-)qualified type.
Definition: Type.h:940
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:175
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.
StmtResult ActOnOpenMPParallelMasterTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel master taskloop simd' after parsing of the associated sta...
OMPClause * ActOnOpenMPDefaultClause(llvm::omp::DefaultKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'default' clause.
StmtResult ActOnOpenMPParallelMasterDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel master' after parsing of the associated statement.
StmtResult ActOnOpenMPDispatchDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp dispatch' after parsing of the.
OMPClause * ActOnOpenMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'read' clause.
OMPClause * ActOnOpenMPFilterClause(Expr *ThreadID, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'filter' clause.
void ActOnOpenMPDeclareReductionCombinerEnd(Decl *D, Expr *Combiner)
Finish current declare reduction construct initializer.
ExprResult ActOnOpenMPCall(ExprResult Call, Scope *Scope, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig)
Given the potential call expression Call, determine if there is a specialization via the OpenMP decla...
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...
void ActOnFinishedOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI)
Called once a target context is completed, that can be when a '#pragma omp end declare target' was en...
void tryCaptureOpenMPLambdas(ValueDecl *V)
Function tries to capture lambda's captured variables in the OpenMP region before the original lambda...
StmtResult ActOnOpenMPParallelMaskedDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel masked' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetTeamsDistributeParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target teams distribute parallel for' after parsing of the associa...
OMPClause * ActOnOpenMPPrivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'private' clause.
void StartOpenMPClause(OpenMPClauseKind K)
Start analysis of clauses.
bool CheckOpenMPLinearModifier(OpenMPLinearClauseKind LinKind, SourceLocation LinLoc)
Checks correctness of linear modifiers.
ExprResult ActOnOpenMPDeclareMapperDirectiveVarDecl(Scope *S, QualType MapperType, SourceLocation StartLoc, DeclarationName VN)
Build the mapper variable of '#pragma omp declare mapper'.
OMPClause * ActOnOpenMPOrderedClause(SourceLocation StartLoc, SourceLocation EndLoc, SourceLocation LParenLoc=SourceLocation(), Expr *NumForLoops=nullptr)
Called on well-formed 'ordered' clause.
OMPClause * ActOnOpenMPReductionClause(ArrayRef< Expr * > VarList, OpenMPReductionClauseModifier Modifier, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions=std::nullopt)
Called on well-formed 'reduction' clause.
bool CheckOpenMPLinearDecl(const ValueDecl *D, SourceLocation ELoc, OpenMPLinearClauseKind LinKind, QualType Type, bool IsDeclareSimd=false)
Checks that the specified declaration matches requirements for the linear decls.
OMPClause * ActOnOpenMPIsDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'is_device_ptr' clause.
OMPClause * ActOnOpenMPHasDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'has_device_addr' clause.
StmtResult ActOnOpenMPErrorDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, bool InExContext=true)
Called on well-formed '#pragma omp error'.
OMPClause * ActOnOpenMPPartialClause(Expr *FactorExpr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'partial' clauses.
StmtResult ActOnOpenMPSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPLastprivateClause(ArrayRef< Expr * > VarList, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'lastprivate' clause.
void ActOnOpenMPDeclareTargetName(NamedDecl *ND, SourceLocation Loc, OMPDeclareTargetDeclAttr::MapTypeTy MT, DeclareTargetContextInfo &DTCI)
Called on correct id-expression from the '#pragma omp declare target'.
DeclGroupPtrTy ActOnOpenMPRequiresDirective(SourceLocation Loc, ArrayRef< OMPClause * > ClauseList)
Called on well-formed '#pragma omp requires'.
StmtResult ActOnOpenMPDistributeSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPFirstprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'firstprivate' clause.
StmtResult ActOnOpenMPDepobjDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp depobj'.
ExprResult getOpenMPCapturedExpr(VarDecl *Capture, ExprValueKind VK, ExprObjectKind OK, SourceLocation Loc)
OMPClause * ActOnOpenMPPriorityClause(Expr *Priority, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'priority' clause.
OMPClause * ActOnOpenMPSingleExprWithArgClause(OpenMPClauseKind Kind, ArrayRef< unsigned > Arguments, Expr *Expr, SourceLocation StartLoc, SourceLocation LParenLoc, ArrayRef< SourceLocation > ArgumentsLoc, SourceLocation DelimLoc, SourceLocation EndLoc)
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 * ActOnOpenMPAllocateClause(Expr *Allocator, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation ColonLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'allocate' 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 * ActOnOpenMPNontemporalClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'nontemporal' clause.
OMPClause * ActOnOpenMPBindClause(OpenMPBindClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'bind' clause.
OMPClause * ActOnOpenMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'threads' clause.
OMPClause * ActOnOpenMPSharedClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'shared' clause.
StmtResult ActOnOpenMPTargetExitDataDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AStmt)
Called on well-formed '#pragma omp target exit data' after parsing of the associated statement.
StmtResult ActOnOpenMPTeamsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp teams' after parsing of the associated statement.
OMPClause * ActOnOpenMPCopyinClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyin' clause.
OMPClause * ActOnOpenMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'mergeable' clause.
void startOpenMPCXXRangeFor()
If the current region is a range loop-based region, mark the start of the loop construct.
OMPClause * ActOnOpenMPDestroyClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'destroy' clause.
StmtResult ActOnOpenMPParallelMaskedTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp parallel masked taskloop' after parsing of the associated statemen...
OMPClause * ActOnOpenMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, Expr *Modifier, ArrayRef< Expr * > Locators)
Called on well-formed 'affinity' clause.
OMPClause * ActOnOpenMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'compare' clause.
StmtResult ActOnOpenMPParallelSectionsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp parallel sections' after parsing of the associated statement.
OMPClause * ActOnOpenMPUpdateClause(OpenMPDependClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'update' clause.
OMPClause * ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data, Expr *DepModifier, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depend' clause.
OMPClause * ActOnOpenMPDoacrossClause(OpenMPDoacrossClauseModifier DepType, SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'doacross' clause.
VarDecl * ActOnOpenMPDeclareReductionInitializerStart(Scope *S, Decl *D)
Initialize declare reduction construct initializer.
StmtResult ActOnOpenMPTeamsDistributeParallelForDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute parallel for' after parsing of the associated sta...
StmtResult ActOnOpenMPMasterDirective(Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp master' after parsing of the associated statement.
StmtResult ActOnOpenMPTaskgroupDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp taskgroup'.
VarDecl * isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo=false, unsigned StopAt=0)
Check if the specified variable is used in one of the private clauses (private, firstprivate,...
StmtResult ActOnOpenMPMasterTaskLoopSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp master taskloop simd' after parsing of the associated statement.
ExprResult ActOnOpenMPIdExpression(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id, OpenMPDirectiveKind Kind)
Called on correct id-expression from the '#pragma omp threadprivate'.
void ActOnOpenMPEndAssumesDirective()
Called on well-formed '#pragma omp end assumes'.
OMPClause * ActOnOpenMPNogroupClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'nogroup' clause.
OMPClause * ActOnOpenMPGrainsizeClause(OpenMPGrainsizeClauseModifier Modifier, Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'grainsize' clause.
ExprResult ActOnOMPArraySectionExpr(Expr *Base, SourceLocation LBLoc, Expr *LowerBound, SourceLocation ColonLocFirst, SourceLocation ColonLocSecond, Expr *Length, Expr *Stride, SourceLocation RBLoc)
OMPClause * ActOnOpenMPFromClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers=std::nullopt)
Called on well-formed 'from' clause.
bool isOpenMPRebuildMemberExpr(ValueDecl *D)
The member expression(this->fd) needs to be rebuilt in the template instantiation to generate private...
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.
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)
OMPClause * ActOnOpenMPToClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers=std::nullopt)
Called on well-formed 'to' clause.
bool isInOpenMPDeclareVariantScope() const
Can we exit an OpenMP declare variant scope at the moment.
Definition: SemaOpenMP.h:109
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.
OMPClause * ActOnOpenMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'acq_rel' clause.
OMPClause * ActOnOpenMPAllocatorClause(Expr *Allocator, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'allocator' clause.
ExprResult VerifyPositiveIntegerConstantInClause(Expr *Op, OpenMPClauseKind CKind, bool StrictlyPositive=true, bool SuppressExprDiags=false)
bool isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const
OMPClause * ActOnOpenMPInclusiveClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'inclusive' clause.
SemaDiagnosticBuilder diagIfOpenMPHostCode(SourceLocation Loc, unsigned DiagID, const FunctionDecl *FD)
Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as host cod...
SemaDiagnosticBuilder diagIfOpenMPDeviceCode(SourceLocation Loc, unsigned DiagID, const FunctionDecl *FD)
Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as device c...
StmtResult ActOnOpenMPSectionsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp sections' after parsing of the associated statement.
void ActOnOpenMPEndDeclareVariant()
Handle a omp end declare variant.
bool hasGlobalOpenMPAssumes() const
Check if there is an active global omp assumes directive.
Definition: SemaOpenMP.h:244
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.
void ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(Decl *D)
Act on D, a function definition inside of an omp [begin/end] assumes.
void EndOpenMPDSABlock(Stmt *CurDirective)
Called on end of data sharing attribute block.
OMPClause * ActOnOpenMPOrderClause(OpenMPOrderClauseModifier Modifier, OpenMPOrderClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc)
Called on well-formed 'order' clause.
OMPClause * ActOnOpenMPSizesClause(ArrayRef< Expr * > SizeExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'sizes' clause.
bool ActOnStartOpenMPDeclareTargetContext(DeclareTargetContextInfo &DTCI)
Called on the start of target region i.e. '#pragma omp declare target'.
StmtResult ActOnOpenMPTeamsDistributeParallelForSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute parallel for simd' after parsing of the associate...
OMPClause * ActOnOpenMPDeviceClause(OpenMPDeviceClauseModifier Modifier, Expr *Device, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'device' clause.
OMPClause * ActOnOpenMPNumThreadsClause(Expr *NumThreads, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'num_threads' clause.
StmtResult ActOnOpenMPDistributeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp distribute' after parsing of the associated statement.
StmtResult ActOnOpenMPSectionDirective(Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp section' after parsing of the associated statement.
bool isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level, unsigned CaptureLevel) const
Check if the specified global variable must be captured by outer capture regions.
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.
StmtResult ActOnOpenMPExecutableDirective(OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName, OpenMPDirectiveKind CancelRegion, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind PrevMappedDirective=llvm::omp::OMPD_unknown)
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...
void EndOpenMPClause()
End analysis of clauses.
bool isInOpenMPAssumeScope() const
Check if there is an active global omp begin assumes directive.
Definition: SemaOpenMP.h:241
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...
OMPClause * ActOnOpenMPNumTeamsClause(Expr *NumTeams, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'num_teams' clause.
QualType ActOnOpenMPDeclareMapperType(SourceLocation TyLoc, TypeResult ParsedType)
Check if the specified type is allowed to be used in 'omp declare mapper' construct.
StmtResult ActOnOpenMPTeamsDistributeDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams distribute' after parsing of the associated statement.
StmtResult ActOnOpenMPTargetTeamsDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target teams' after parsing of the associated statement.
OMPClause * ActOnOpenMPMessageClause(Expr *MS, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'message' clause.
OMPClause * 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=std::nullopt)
Called on well-formed 'map' clause.
OMPClause * ActOnOpenMPTaskReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions=std::nullopt)
Called on well-formed 'task_reduction' clause.
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...
OMPClause * ActOnOpenMPWhenClause(OMPTraitInfo &TI, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'when' clause.
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:53
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 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)
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.
ExprResult ActOnOMPArrayShapingExpr(Expr *Base, SourceLocation LParenLoc, SourceLocation RParenLoc, ArrayRef< Expr * > Dims, ArrayRef< SourceRange > Brackets)
OMPClause * ActOnOpenMPAtClause(OpenMPAtClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'at' clause.
StmtResult ActOnOpenMPTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp taskloop' after parsing of the associated statement.
OMPClause * ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'init' clause.
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 * 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.
std::pair< StringRef, QualType > CapturedParamNameType
Definition: SemaOpenMP.h:54
OMPClause * ActOnOpenMPFinalClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'final' clause.
bool isInOpenMPTargetExecutionDirective() const
Return true inside OpenMP target region.
StmtResult ActOnOpenMPTargetDataDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp target data' after parsing of the associated statement.
StmtResult ActOnOpenMPMasterTaskLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp master taskloop' after parsing of the associated statement.
void ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, SmallVectorImpl< FunctionDecl * > &Bases)
The declarator D defines a function in the scope S which is nested in an omp begin/end declare varian...
StmtResult ActOnOpenMPFlushDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp flush'.
StmtResult ActOnOpenMPUnrollDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp unroll' after parsing of its clauses and the associated statement.
OMPClause * 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:369
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.
OMPClause * ActOnOpenMPSeverityClause(OpenMPSeverityClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'severity' clause.
void ActOnOpenMPDeclareVariantDirective(FunctionDecl *FD, Expr *VariantRef, OMPTraitInfo &TI, ArrayRef< Expr * > AdjustArgsNothing, ArrayRef< Expr * > AdjustArgsNeedDevicePtr, ArrayRef< OMPInteropInfo > AppendArgs, SourceLocation AdjustArgsLoc, SourceLocation AppendArgsLoc, SourceRange SR)
Called on well-formed '#pragma omp declare variant' after parsing of the associated method/function.
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 * ActOnOpenMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'relaxed' clause.
OMPClause * ActOnOpenMPAlignedClause(ArrayRef< Expr * > VarList, Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Called on well-formed 'aligned' clause.
StmtResult ActOnOpenMPInteropDirective(ArrayRef< OMPClause * > Clauses, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp interop'.
OMPClause * ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depobj' pseudo clause.
OMPClause * ActOnOpenMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'seq_cst' clause.
void checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D, SourceLocation IdLoc=SourceLocation())
Check declaration inside target region.
OMPClause * ActOnOpenMPNovariantsClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'novariants' clause.
OMPClause * ActOnOpenMPCopyprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyprivate' clause.
OMPClause * ActOnOpenMPCollapseClause(Expr *NumForLoops, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'collapse' clause.
DeclGroupPtrTy ActOnOpenMPDeclareSimdDirective(DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS, Expr *Simdlen, ArrayRef< Expr * > Uniforms, ArrayRef< Expr * > Aligneds, ArrayRef< Expr * > Alignments, ArrayRef< Expr * > Linears, ArrayRef< unsigned > LinModifiers, ArrayRef< Expr * > Steps, SourceRange SR)
Called on well-formed '#pragma omp declare simd' after parsing of the associated method/function.
ExprResult PerformOpenMPImplicitIntegerConversion(SourceLocation OpLoc, Expr *Op)
StmtResult ActOnOpenMPTargetSimdDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp target simd' after parsing of the associated statement.
OMPClause * ActOnOpenMPAlignClause(Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'align' clause.
OMPClause * ActOnOpenMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'atomic_default_mem_order' clause.
StmtResult ActOnOpenMPTeamsGenericLoopDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, VarsWithInheritedDSAType &VarsWithImplicitDSA)
Called on well-formed '#pragma omp teams loop' after parsing of the associated statement.
OMPClause * ActOnOpenMPWeakClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed 'weak' clause.
OMPClause * ActOnOpenMPXAttributeClause(ArrayRef< const Attr * > Attrs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_attribute' clause.
StmtResult ActOnOpenMPTileDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp tile' after parsing of its clauses and the associated statement.
OMPClause * ActOnOpenMPInReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions=std::nullopt)
Called on well-formed 'in_reduction' clause.
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.
OMPClause * ActOnOpenMPThreadLimitClause(Expr *ThreadLimit, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'thread_limit' clause.
StmtResult ActOnOpenMPTaskDirective(ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-formed '#pragma omp task' after parsing of the associated statement.
OMPClause * ActOnOpenMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation NameModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Called on well-formed 'if' clause.
llvm::SmallDenseMap< const ValueDecl *, const Expr *, 4 > VarsWithInheritedDSAType
Definition: SemaOpenMP.h:408
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 on start of '#pragma omp declare mapper'.
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:462
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
Definition: Stmt.h:84
The base class of the type hierarchy.
Definition: Type.h:1813
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:707
Represents a variable declaration or definition.
Definition: Decl.h:919
Retains information about a function, method, or block that is currently being parsed.
Definition: ScopeInfo.h:104
bool Call(InterpState &S, CodePtr OpPC, const Function *Func, uint32_t VarArgSize)
Definition: Interp.h:2179
bool Init(InterpState &S, CodePtr OpPC)
Definition: Interp.h:1472
The JSON file list parser is used to communicate input to InstallAPI.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:24
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
Definition: OpenMPKinds.h:118
OpenMPOrderClauseModifier
OpenMP modifiers for 'order' clause.
Definition: OpenMPKinds.h:171
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
Definition: Specifiers.h:146
OpenMPAtClauseKind
OpenMP attributes for 'at' clause.
Definition: OpenMPKinds.h:135
OpenMPReductionClauseModifier
OpenMP modifiers for 'reduction' clause.
Definition: OpenMPKinds.h:186
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
Definition: OpenMPKinds.h:38
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
Definition: OpenMPKinds.h:27
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
Definition: OpenMPKinds.h:103
OpenMPDoacrossClauseModifier
OpenMP dependence types for 'doacross' clause.
Definition: OpenMPKinds.h:219
OpenMPBindClauseKind
OpenMP bindings for the 'bind' clause.
Definition: OpenMPKinds.h:200
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
Definition: OpenMPKinds.h:157
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition: OpenMPKinds.h:54
OpenMPGrainsizeClauseModifier
Definition: OpenMPKinds.h:206
OpenMPNumTasksClauseModifier
Definition: OpenMPKinds.h:212
OpenMPSeverityClauseKind
OpenMP attributes for 'severity' clause.
Definition: OpenMPKinds.h:142
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
Definition: OpenMPKinds.h:110
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Definition: OpenMPKinds.h:62
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition: Specifiers.h:129
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
Definition: OpenMPKinds.h:127
OpenMPDeviceClauseModifier
OpenMP modifiers for 'device' clause.
Definition: OpenMPKinds.h:47
OpenMPOrderClauseKind
OpenMP attributes for 'order' clause.
Definition: OpenMPKinds.h:164
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
Definition: OpenMPKinds.h:30
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:120
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Definition: OpenMPKinds.h:70
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:154
This structure contains most locations needed for by an OMPVarListClause.
Definition: OpenMPClause.h:259
OMPDeclareTargetDeclAttr::MapTypeTy MT
Definition: SemaOpenMP.h:301
DeclareTargetContextInfo(OpenMPDirectiveKind Kind, SourceLocation Loc)
Definition: SemaOpenMP.h:319
std::optional< Expr * > Indirect
The directive with indirect clause.
Definition: SemaOpenMP.h:314
OpenMPDirectiveKind Kind
The directive kind, begin declare target or declare target.
Definition: SemaOpenMP.h:311
OMPDeclareTargetDeclAttr::DevTypeTy DT
The 'device_type' as parsed from the clause.
Definition: SemaOpenMP.h:308
SourceLocation Loc
The directive location.
Definition: SemaOpenMP.h:317
llvm::DenseMap< NamedDecl *, MapInfo > ExplicitlyMapped
Explicitly listed variables and functions in a 'to' or 'link' clause.
Definition: SemaOpenMP.h:305
Data structure for iterator expression.
Definition: SemaOpenMP.h:1337
OMPIteratorExpr::IteratorRange Range
Definition: SemaOpenMP.h:1341
Data used for processing a list of variables in OpenMP clauses.
Definition: SemaOpenMP.h:1082
SmallVector< SourceLocation, NumberOfOMPMotionModifiers > MotionModifiersLoc
Definition: SemaOpenMP.h:1097
SmallVector< OpenMPMotionModifierKind, NumberOfOMPMotionModifiers > MotionModifiers
Definition: SemaOpenMP.h:1096
SmallVector< OpenMPMapModifierKind, NumberOfOMPMapClauseModifiers > MapTypeModifiers
Definition: SemaOpenMP.h:1092
SmallVector< SourceLocation, NumberOfOMPMapClauseModifiers > MapTypeModifiersLoc
Definition: SemaOpenMP.h:1094
DeclarationNameInfo ReductionOrMapperId
Definition: SemaOpenMP.h:1088
int ExtraModifier
Additional modifier for linear, map, depend or lastprivate clause.
Definition: SemaOpenMP.h:1089
Data for list of allocators.
Definition: SemaOpenMP.h:1277
Expr * AllocatorTraits
Allocator traits.
Definition: SemaOpenMP.h:1281
SourceLocation LParenLoc
Locations of '(' and ')' symbols.
Definition: SemaOpenMP.h:1283