Coverage Report

Created: 2021-09-21 08:58

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/include/clang/AST/OpenMPClause.h
Line
Count
Source (jump to first uncovered line)
1
//===- OpenMPClause.h - Classes for OpenMP clauses --------------*- C++ -*-===//
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
//
9
/// \file
10
/// This file defines OpenMP AST classes for clauses.
11
/// There are clauses for executable directives, clauses for declarative
12
/// directives and clauses which can be used in both kinds of directives.
13
//
14
//===----------------------------------------------------------------------===//
15
16
#ifndef LLVM_CLANG_AST_OPENMPCLAUSE_H
17
#define LLVM_CLANG_AST_OPENMPCLAUSE_H
18
19
#include "clang/AST/ASTFwd.h"
20
#include "clang/AST/Decl.h"
21
#include "clang/AST/DeclarationName.h"
22
#include "clang/AST/Expr.h"
23
#include "clang/AST/NestedNameSpecifier.h"
24
#include "clang/AST/Stmt.h"
25
#include "clang/AST/StmtIterator.h"
26
#include "clang/Basic/LLVM.h"
27
#include "clang/Basic/OpenMPKinds.h"
28
#include "clang/Basic/SourceLocation.h"
29
#include "llvm/ADT/ArrayRef.h"
30
#include "llvm/ADT/MapVector.h"
31
#include "llvm/ADT/PointerIntPair.h"
32
#include "llvm/ADT/SmallVector.h"
33
#include "llvm/ADT/iterator.h"
34
#include "llvm/ADT/iterator_range.h"
35
#include "llvm/Frontend/OpenMP/OMPConstants.h"
36
#include "llvm/Frontend/OpenMP/OMPContext.h"
37
#include "llvm/Support/Casting.h"
38
#include "llvm/Support/Compiler.h"
39
#include "llvm/Support/TrailingObjects.h"
40
#include <cassert>
41
#include <cstddef>
42
#include <iterator>
43
#include <utility>
44
45
namespace clang {
46
47
class ASTContext;
48
49
//===----------------------------------------------------------------------===//
50
// AST classes for clauses.
51
//===----------------------------------------------------------------------===//
52
53
/// This is a basic class for representing single OpenMP clause.
54
class OMPClause {
55
  /// Starting location of the clause (the clause keyword).
56
  SourceLocation StartLoc;
57
58
  /// Ending location of the clause.
59
  SourceLocation EndLoc;
60
61
  /// Kind of the clause.
62
  OpenMPClauseKind Kind;
63
64
protected:
65
  OMPClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
66
236k
      : StartLoc(StartLoc), EndLoc(EndLoc), Kind(K) {}
67
68
public:
69
  /// Returns the starting location of the clause.
70
90.2k
  SourceLocation getBeginLoc() const { return StartLoc; }
71
72
  /// Returns the ending location of the clause.
73
84.8k
  SourceLocation getEndLoc() const { return EndLoc; }
74
75
  /// Sets the starting location of the clause.
76
23.4k
  void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
77
78
  /// Sets the ending location of the clause.
79
23.4k
  void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
80
81
  /// Returns kind of OpenMP clause (private, shared, reduction, etc.).
82
5.78M
  OpenMPClauseKind getClauseKind() const { return Kind; }
83
84
52.9k
  bool isImplicit() const { return StartLoc.isInvalid(); }
85
86
  using child_iterator = StmtIterator;
87
  using const_child_iterator = ConstStmtIterator;
88
  using child_range = llvm::iterator_range<child_iterator>;
89
  using const_child_range = llvm::iterator_range<const_child_iterator>;
90
91
  child_range children();
92
292
  const_child_range children() const {
93
292
    auto Children = const_cast<OMPClause *>(this)->children();
94
292
    return const_child_range(Children.begin(), Children.end());
95
292
  }
96
97
  /// Get the iterator range for the expressions used in the clauses. Used
98
  /// expressions include only the children that must be evaluated at the
99
  /// runtime before entering the construct.
100
  child_range used_children();
101
0
  const_child_range used_children() const {
102
0
    auto Children = const_cast<OMPClause *>(this)->children();
103
0
    return const_child_range(Children.begin(), Children.end());
104
0
  }
105
106
0
  static bool classof(const OMPClause *) { return true; }
107
};
108
109
/// Class that handles pre-initialization statement for some clauses, like
110
/// 'shedule', 'firstprivate' etc.
111
class OMPClauseWithPreInit {
112
  friend class OMPClauseReader;
113
114
  /// Pre-initialization statement for the clause.
115
  Stmt *PreInit = nullptr;
116
117
  /// Region that captures the associated stmt.
118
  OpenMPDirectiveKind CaptureRegion = llvm::omp::OMPD_unknown;
119
120
protected:
121
125k
  OMPClauseWithPreInit(const OMPClause *This) {
122
125k
    assert(get(This) && "get is not tuned for pre-init.");
123
125k
  }
124
125
  /// Set pre-initialization statement for the clause.
126
  void
127
  setPreInitStmt(Stmt *S,
128
125k
                 OpenMPDirectiveKind ThisRegion = llvm::omp::OMPD_unknown) {
129
125k
    PreInit = S;
130
125k
    CaptureRegion = ThisRegion;
131
125k
  }
132
133
public:
134
  /// Get pre-initialization statement for the clause.
135
70.5k
  const Stmt *getPreInitStmt() const { return PreInit; }
136
137
  /// Get pre-initialization statement for the clause.
138
24.6k
  Stmt *getPreInitStmt() { return PreInit; }
139
140
  /// Get capture region for the stmt in the clause.
141
63.7k
  OpenMPDirectiveKind getCaptureRegion() const { return CaptureRegion; }
142
143
  static OMPClauseWithPreInit *get(OMPClause *C);
144
  static const OMPClauseWithPreInit *get(const OMPClause *C);
145
};
146
147
/// Class that handles post-update expression for some clauses, like
148
/// 'lastprivate', 'reduction' etc.
149
class OMPClauseWithPostUpdate : public OMPClauseWithPreInit {
150
  friend class OMPClauseReader;
151
152
  /// Post-update expression for the clause.
153
  Expr *PostUpdate = nullptr;
154
155
protected:
156
38.8k
  OMPClauseWithPostUpdate(const OMPClause *This) : OMPClauseWithPreInit(This) {
157
38.8k
    assert(get(This) && "get is not tuned for post-update.");
158
38.8k
  }
159
160
  /// Set pre-initialization statement for the clause.
161
38.8k
  void setPostUpdateExpr(Expr *S) { PostUpdate = S; }
162
163
public:
164
  /// Get post-update expression for the clause.
165
2.88k
  const Expr *getPostUpdateExpr() const { return PostUpdate; }
166
167
  /// Get post-update expression for the clause.
168
1.94k
  Expr *getPostUpdateExpr() { return PostUpdate; }
169
170
  static OMPClauseWithPostUpdate *get(OMPClause *C);
171
  static const OMPClauseWithPostUpdate *get(const OMPClause *C);
172
};
173
174
/// This structure contains most locations needed for by an OMPVarListClause.
175
struct OMPVarListLocTy {
176
  /// Starting location of the clause (the clause keyword).
177
  SourceLocation StartLoc;
178
  /// Location of '('.
179
  SourceLocation LParenLoc;
180
  /// Ending location of the clause.
181
  SourceLocation EndLoc;
182
15.7k
  OMPVarListLocTy() = default;
183
  OMPVarListLocTy(SourceLocation StartLoc, SourceLocation LParenLoc,
184
                  SourceLocation EndLoc)
185
105k
      : StartLoc(StartLoc), LParenLoc(LParenLoc), EndLoc(EndLoc) {}
186
};
187
188
/// This represents clauses with the list of variables like 'private',
189
/// 'firstprivate', 'copyin', 'shared', or 'reduction' clauses in the
190
/// '#pragma omp ...' directives.
191
template <class T> class OMPVarListClause : public OMPClause {
192
  friend class OMPClauseReader;
193
194
  /// Location of '('.
195
  SourceLocation LParenLoc;
196
197
  /// Number of variables in the list.
198
  unsigned NumVars;
199
200
protected:
201
  /// Build a clause with \a N variables
202
  ///
203
  /// \param K Kind of the clause.
204
  /// \param StartLoc Starting location of the clause (the clause keyword).
205
  /// \param LParenLoc Location of '('.
206
  /// \param EndLoc Ending location of the clause.
207
  /// \param N Number of the variables in the clause.
208
  OMPVarListClause(OpenMPClauseKind K, SourceLocation StartLoc,
209
                   SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
210
177k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPPrivateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
14.3k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPFirstprivateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
54.4k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPLastprivateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
6.23k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPSharedClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
4.33k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPLinearClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
2.98k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPAlignedClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
1.94k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPCopyinClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
502
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPCopyprivateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
181
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPReductionClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
25.6k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPTaskReductionClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
2.35k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPInReductionClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
1.63k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPAllocateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
1.99k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPFlushClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
96
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPDependClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
3.83k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPMapClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
47.5k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPToClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
2.82k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPFromClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
1.51k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
502
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
130
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
3.42k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPNontemporalClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
528
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPInclusiveClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
116
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPExclusiveClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
82
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPAffinityClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
68
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPInitClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
210
110
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
211
212
  /// Fetches list of variables associated with this clause.
213
1.22M
  MutableArrayRef<Expr *> getVarRefs() {
214
1.22M
    return MutableArrayRef<Expr *>(
215
1.22M
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
1.22M
  }
clang::OMPVarListClause<clang::OMPAffinityClause>::getVarRefs()
Line
Count
Source
213
204
  MutableArrayRef<Expr *> getVarRefs() {
214
204
    return MutableArrayRef<Expr *>(
215
204
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
204
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::getVarRefs()
Line
Count
Source
213
8.11k
  MutableArrayRef<Expr *> getVarRefs() {
214
8.11k
    return MutableArrayRef<Expr *>(
215
8.11k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
8.11k
  }
clang::OMPVarListClause<clang::OMPAllocateClause>::getVarRefs()
Line
Count
Source
213
7.95k
  MutableArrayRef<Expr *> getVarRefs() {
214
7.95k
    return MutableArrayRef<Expr *>(
215
7.95k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
7.95k
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::getVarRefs()
Line
Count
Source
213
1.41k
  MutableArrayRef<Expr *> getVarRefs() {
214
1.41k
    return MutableArrayRef<Expr *>(
215
1.41k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
1.41k
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::getVarRefs()
Line
Count
Source
213
3.68k
  MutableArrayRef<Expr *> getVarRefs() {
214
3.68k
    return MutableArrayRef<Expr *>(
215
3.68k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
3.68k
  }
clang::OMPVarListClause<clang::OMPDependClause>::getVarRefs()
Line
Count
Source
213
15.0k
  MutableArrayRef<Expr *> getVarRefs() {
214
15.0k
    return MutableArrayRef<Expr *>(
215
15.0k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
15.0k
  }
clang::OMPVarListClause<clang::OMPExclusiveClause>::getVarRefs()
Line
Count
Source
213
132
  MutableArrayRef<Expr *> getVarRefs() {
214
132
    return MutableArrayRef<Expr *>(
215
132
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
132
  }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::getVarRefs()
Line
Count
Source
213
398k
  MutableArrayRef<Expr *> getVarRefs() {
214
398k
    return MutableArrayRef<Expr *>(
215
398k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
398k
  }
clang::OMPVarListClause<clang::OMPFlushClause>::getVarRefs()
Line
Count
Source
213
128
  MutableArrayRef<Expr *> getVarRefs() {
214
128
    return MutableArrayRef<Expr *>(
215
128
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
128
  }
clang::OMPVarListClause<clang::OMPFromClause>::getVarRefs()
Line
Count
Source
213
2.49k
  MutableArrayRef<Expr *> getVarRefs() {
214
2.49k
    return MutableArrayRef<Expr *>(
215
2.49k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
2.49k
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::getVarRefs()
Line
Count
Source
213
25.8k
  MutableArrayRef<Expr *> getVarRefs() {
214
25.8k
    return MutableArrayRef<Expr *>(
215
25.8k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
25.8k
  }
clang::OMPVarListClause<clang::OMPInclusiveClause>::getVarRefs()
Line
Count
Source
213
172
  MutableArrayRef<Expr *> getVarRefs() {
214
172
    return MutableArrayRef<Expr *>(
215
172
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
172
  }
clang::OMPVarListClause<clang::OMPInitClause>::getVarRefs()
Line
Count
Source
213
290
  MutableArrayRef<Expr *> getVarRefs() {
214
290
    return MutableArrayRef<Expr *>(
215
290
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
290
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::getVarRefs()
Line
Count
Source
213
6.58k
  MutableArrayRef<Expr *> getVarRefs() {
214
6.58k
    return MutableArrayRef<Expr *>(
215
6.58k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
6.58k
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::getVarRefs()
Line
Count
Source
213
79.8k
  MutableArrayRef<Expr *> getVarRefs() {
214
79.8k
    return MutableArrayRef<Expr *>(
215
79.8k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
79.8k
  }
clang::OMPVarListClause<clang::OMPLinearClause>::getVarRefs()
Line
Count
Source
213
78.5k
  MutableArrayRef<Expr *> getVarRefs() {
214
78.5k
    return MutableArrayRef<Expr *>(
215
78.5k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
78.5k
  }
clang::OMPVarListClause<clang::OMPMapClause>::getVarRefs()
Line
Count
Source
213
128k
  MutableArrayRef<Expr *> getVarRefs() {
214
128k
    return MutableArrayRef<Expr *>(
215
128k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
128k
  }
clang::OMPVarListClause<clang::OMPNontemporalClause>::getVarRefs()
Line
Count
Source
213
2.75k
  MutableArrayRef<Expr *> getVarRefs() {
214
2.75k
    return MutableArrayRef<Expr *>(
215
2.75k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
2.75k
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::getVarRefs()
Line
Count
Source
213
101k
  MutableArrayRef<Expr *> getVarRefs() {
214
101k
    return MutableArrayRef<Expr *>(
215
101k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
101k
  }
clang::OMPVarListClause<clang::OMPReductionClause>::getVarRefs()
Line
Count
Source
213
321k
  MutableArrayRef<Expr *> getVarRefs() {
214
321k
    return MutableArrayRef<Expr *>(
215
321k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
321k
  }
clang::OMPVarListClause<clang::OMPSharedClause>::getVarRefs()
Line
Count
Source
213
7.52k
  MutableArrayRef<Expr *> getVarRefs() {
214
7.52k
    return MutableArrayRef<Expr *>(
215
7.52k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
7.52k
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::getVarRefs()
Line
Count
Source
213
26.2k
  MutableArrayRef<Expr *> getVarRefs() {
214
26.2k
    return MutableArrayRef<Expr *>(
215
26.2k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
26.2k
  }
clang::OMPVarListClause<clang::OMPToClause>::getVarRefs()
Line
Count
Source
213
3.46k
  MutableArrayRef<Expr *> getVarRefs() {
214
3.46k
    return MutableArrayRef<Expr *>(
215
3.46k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
3.46k
  }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::getVarRefs()
Line
Count
Source
213
140
  MutableArrayRef<Expr *> getVarRefs() {
214
140
    return MutableArrayRef<Expr *>(
215
140
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
140
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::getVarRefs()
Line
Count
Source
213
2.05k
  MutableArrayRef<Expr *> getVarRefs() {
214
2.05k
    return MutableArrayRef<Expr *>(
215
2.05k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
216
2.05k
  }
217
218
  /// Sets the list of variables for this clause.
219
177k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
177k
    assert(VL.size() == NumVars &&
221
177k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
177k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
177k
  }
clang::OMPVarListClause<clang::OMPInitClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
26
  void setVarRefs(ArrayRef<Expr *> VL) {
220
26
    assert(VL.size() == NumVars &&
221
26
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
26
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
26
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
14.3k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
14.3k
    assert(VL.size() == NumVars &&
221
14.3k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
14.3k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
14.3k
  }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
54.4k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
54.4k
    assert(VL.size() == NumVars &&
221
54.4k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
54.4k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
54.4k
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
6.23k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
6.23k
    assert(VL.size() == NumVars &&
221
6.23k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
6.23k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
6.23k
  }
clang::OMPVarListClause<clang::OMPSharedClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
4.33k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
4.33k
    assert(VL.size() == NumVars &&
221
4.33k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
4.33k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
4.33k
  }
clang::OMPVarListClause<clang::OMPReductionClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
25.6k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
25.6k
    assert(VL.size() == NumVars &&
221
25.6k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
25.6k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
25.6k
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
2.35k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
2.35k
    assert(VL.size() == NumVars &&
221
2.35k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
2.35k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
2.35k
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
1.63k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
1.63k
    assert(VL.size() == NumVars &&
221
1.63k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
1.63k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
1.63k
  }
clang::OMPVarListClause<clang::OMPLinearClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
2.98k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
2.98k
    assert(VL.size() == NumVars &&
221
2.98k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
2.98k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
2.98k
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
1.94k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
1.94k
    assert(VL.size() == NumVars &&
221
1.94k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
1.94k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
1.94k
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
502
  void setVarRefs(ArrayRef<Expr *> VL) {
220
502
    assert(VL.size() == NumVars &&
221
502
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
502
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
502
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
181
  void setVarRefs(ArrayRef<Expr *> VL) {
220
181
    assert(VL.size() == NumVars &&
221
181
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
181
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
181
  }
clang::OMPVarListClause<clang::OMPFlushClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
96
  void setVarRefs(ArrayRef<Expr *> VL) {
220
96
    assert(VL.size() == NumVars &&
221
96
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
96
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
96
  }
clang::OMPVarListClause<clang::OMPDependClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
3.83k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
3.83k
    assert(VL.size() == NumVars &&
221
3.83k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
3.83k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
3.83k
  }
clang::OMPVarListClause<clang::OMPMapClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
47.5k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
47.5k
    assert(VL.size() == NumVars &&
221
47.5k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
47.5k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
47.5k
  }
clang::OMPVarListClause<clang::OMPAllocateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
1.99k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
1.99k
    assert(VL.size() == NumVars &&
221
1.99k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
1.99k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
1.99k
  }
clang::OMPVarListClause<clang::OMPToClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
2.82k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
2.82k
    assert(VL.size() == NumVars &&
221
2.82k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
2.82k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
2.82k
  }
clang::OMPVarListClause<clang::OMPFromClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
1.51k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
1.51k
    assert(VL.size() == NumVars &&
221
1.51k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
1.51k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
1.51k
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
502
  void setVarRefs(ArrayRef<Expr *> VL) {
220
502
    assert(VL.size() == NumVars &&
221
502
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
502
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
502
  }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
130
  void setVarRefs(ArrayRef<Expr *> VL) {
220
130
    assert(VL.size() == NumVars &&
221
130
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
130
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
130
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
3.42k
  void setVarRefs(ArrayRef<Expr *> VL) {
220
3.42k
    assert(VL.size() == NumVars &&
221
3.42k
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
3.42k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
3.42k
  }
clang::OMPVarListClause<clang::OMPNontemporalClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
528
  void setVarRefs(ArrayRef<Expr *> VL) {
220
528
    assert(VL.size() == NumVars &&
221
528
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
528
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
528
  }
clang::OMPVarListClause<clang::OMPInclusiveClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
116
  void setVarRefs(ArrayRef<Expr *> VL) {
220
116
    assert(VL.size() == NumVars &&
221
116
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
116
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
116
  }
clang::OMPVarListClause<clang::OMPExclusiveClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
82
  void setVarRefs(ArrayRef<Expr *> VL) {
220
82
    assert(VL.size() == NumVars &&
221
82
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
82
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
82
  }
clang::OMPVarListClause<clang::OMPAffinityClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
219
68
  void setVarRefs(ArrayRef<Expr *> VL) {
220
68
    assert(VL.size() == NumVars &&
221
68
           "Number of variables is not the same as the preallocated buffer");
222
0
    std::copy(VL.begin(), VL.end(),
223
68
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
224
68
  }
225
226
public:
227
  using varlist_iterator = MutableArrayRef<Expr *>::iterator;
228
  using varlist_const_iterator = ArrayRef<const Expr *>::iterator;
229
  using varlist_range = llvm::iterator_range<varlist_iterator>;
230
  using varlist_const_range = llvm::iterator_range<varlist_const_iterator>;
231
232
2.07M
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_size() const
Line
Count
Source
232
200
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_size() const
Line
Count
Source
232
2.17k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_size() const
Line
Count
Source
232
5.10k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_size() const
Line
Count
Source
232
405k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_size() const
Line
Count
Source
232
57.2k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_size() const
Line
Count
Source
232
99.9k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_size() const
Line
Count
Source
232
215k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_size() const
Line
Count
Source
232
1.26k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_size() const
Line
Count
Source
232
44.4k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_size() const
Line
Count
Source
232
543k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_size() const
Line
Count
Source
232
42.0k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_size() const
Line
Count
Source
232
584k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPToClause>::varlist_size() const
Line
Count
Source
232
27.0k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_size() const
Line
Count
Source
232
15.8k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_size() const
Line
Count
Source
232
5.65k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_size() const
Line
Count
Source
232
650
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_size() const
Line
Count
Source
232
18.0k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPInitClause>::varlist_size() const
Line
Count
Source
232
49
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_size() const
Line
Count
Source
232
2.21k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_size() const
Line
Count
Source
232
968
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_size() const
Line
Count
Source
232
50
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_size() const
Line
Count
Source
232
2.06k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_size() const
Line
Count
Source
232
1.35k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_size() const
Line
Count
Source
232
34
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_size() const
Line
Count
Source
232
26
  unsigned varlist_size() const { return NumVars; }
233
15.4k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_empty() const
Line
Count
Source
233
840
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_empty() const
Line
Count
Source
233
2.76k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_empty() const
Line
Count
Source
233
1.17k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_empty() const
Line
Count
Source
233
500
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_empty() const
Line
Count
Source
233
838
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_empty() const
Line
Count
Source
233
1.69k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_empty() const
Line
Count
Source
233
216
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_empty() const
Line
Count
Source
233
128
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_empty() const
Line
Count
Source
233
417
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_empty() const
Line
Count
Source
233
408
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_empty() const
Line
Count
Source
233
180
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_empty() const
Line
Count
Source
233
32
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_empty() const
Line
Count
Source
233
16
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_empty() const
Line
Count
Source
233
797
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_empty() const
Line
Count
Source
233
3.44k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPToClause>::varlist_empty() const
Line
Count
Source
233
353
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_empty() const
Line
Count
Source
233
352
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_empty() const
Line
Count
Source
233
40
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_empty() const
Line
Count
Source
233
16
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_empty() const
Line
Count
Source
233
1.16k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_empty() const
Line
Count
Source
233
68
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_empty() const
Line
Count
Source
233
12
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_empty() const
Line
Count
Source
233
4
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_empty() const
Line
Count
Source
233
20
  bool varlist_empty() const { return NumVars == 0; }
234
235
73.0k
  varlist_range varlists() {
236
73.0k
    return varlist_range(varlist_begin(), varlist_end());
237
73.0k
  }
clang::OMPVarListClause<clang::OMPAffinityClause>::varlists()
Line
Count
Source
235
22
  varlist_range varlists() {
236
22
    return varlist_range(varlist_begin(), varlist_end());
237
22
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlists()
Line
Count
Source
235
1.31k
  varlist_range varlists() {
236
1.31k
    return varlist_range(varlist_begin(), varlist_end());
237
1.31k
  }
clang::OMPVarListClause<clang::OMPAllocateClause>::varlists()
Line
Count
Source
235
2.23k
  varlist_range varlists() {
236
2.23k
    return varlist_range(varlist_begin(), varlist_end());
237
2.23k
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlists()
Line
Count
Source
235
85
  varlist_range varlists() {
236
85
    return varlist_range(varlist_begin(), varlist_end());
237
85
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlists()
Line
Count
Source
235
210
  varlist_range varlists() {
236
210
    return varlist_range(varlist_begin(), varlist_end());
237
210
  }
clang::OMPVarListClause<clang::OMPDependClause>::varlists()
Line
Count
Source
235
1.38k
  varlist_range varlists() {
236
1.38k
    return varlist_range(varlist_begin(), varlist_end());
237
1.38k
  }
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlists()
Line
Count
Source
235
14
  varlist_range varlists() {
236
14
    return varlist_range(varlist_begin(), varlist_end());
237
14
  }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlists()
Line
Count
Source
235
6.21k
  varlist_range varlists() {
236
6.21k
    return varlist_range(varlist_begin(), varlist_end());
237
6.21k
  }
clang::OMPVarListClause<clang::OMPFlushClause>::varlists()
Line
Count
Source
235
40
  varlist_range varlists() {
236
40
    return varlist_range(varlist_begin(), varlist_end());
237
40
  }
clang::OMPVarListClause<clang::OMPFromClause>::varlists()
Line
Count
Source
235
682
  varlist_range varlists() {
236
682
    return varlist_range(varlist_begin(), varlist_end());
237
682
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlists()
Line
Count
Source
235
1.20k
  varlist_range varlists() {
236
1.20k
    return varlist_range(varlist_begin(), varlist_end());
237
1.20k
  }
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlists()
Line
Count
Source
235
22
  varlist_range varlists() {
236
22
    return varlist_range(varlist_begin(), varlist_end());
237
22
  }
clang::OMPVarListClause<clang::OMPInitClause>::varlists()
Line
Count
Source
235
23
  varlist_range varlists() {
236
23
    return varlist_range(varlist_begin(), varlist_end());
237
23
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlists()
Line
Count
Source
235
1.53k
  varlist_range varlists() {
236
1.53k
    return varlist_range(varlist_begin(), varlist_end());
237
1.53k
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlists()
Line
Count
Source
235
7.61k
  varlist_range varlists() {
236
7.61k
    return varlist_range(varlist_begin(), varlist_end());
237
7.61k
  }
clang::OMPVarListClause<clang::OMPLinearClause>::varlists()
Line
Count
Source
235
2.90k
  varlist_range varlists() {
236
2.90k
    return varlist_range(varlist_begin(), varlist_end());
237
2.90k
  }
clang::OMPVarListClause<clang::OMPMapClause>::varlists()
Line
Count
Source
235
16.1k
  varlist_range varlists() {
236
16.1k
    return varlist_range(varlist_begin(), varlist_end());
237
16.1k
  }
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlists()
Line
Count
Source
235
540
  varlist_range varlists() {
236
540
    return varlist_range(varlist_begin(), varlist_end());
237
540
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlists()
Line
Count
Source
235
5.94k
  varlist_range varlists() {
236
5.94k
    return varlist_range(varlist_begin(), varlist_end());
237
5.94k
  }
clang::OMPVarListClause<clang::OMPReductionClause>::varlists()
Line
Count
Source
235
20.3k
  varlist_range varlists() {
236
20.3k
    return varlist_range(varlist_begin(), varlist_end());
237
20.3k
  }
clang::OMPVarListClause<clang::OMPSharedClause>::varlists()
Line
Count
Source
235
1.81k
  varlist_range varlists() {
236
1.81k
    return varlist_range(varlist_begin(), varlist_end());
237
1.81k
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlists()
Line
Count
Source
235
1.33k
  varlist_range varlists() {
236
1.33k
    return varlist_range(varlist_begin(), varlist_end());
237
1.33k
  }
clang::OMPVarListClause<clang::OMPToClause>::varlists()
Line
Count
Source
235
1.04k
  varlist_range varlists() {
236
1.04k
    return varlist_range(varlist_begin(), varlist_end());
237
1.04k
  }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlists()
Line
Count
Source
235
36
  varlist_range varlists() {
236
36
    return varlist_range(varlist_begin(), varlist_end());
237
36
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlists()
Line
Count
Source
235
286
  varlist_range varlists() {
236
286
    return varlist_range(varlist_begin(), varlist_end());
237
286
  }
238
32.9k
  varlist_const_range varlists() const {
239
32.9k
    return varlist_const_range(varlist_begin(), varlist_end());
240
32.9k
  }
clang::OMPVarListClause<clang::OMPAffinityClause>::varlists() const
Line
Count
Source
238
14
  varlist_const_range varlists() const {
239
14
    return varlist_const_range(varlist_begin(), varlist_end());
240
14
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlists() const
Line
Count
Source
238
452
  varlist_const_range varlists() const {
239
452
    return varlist_const_range(varlist_begin(), varlist_end());
240
452
  }
clang::OMPVarListClause<clang::OMPAllocateClause>::varlists() const
Line
Count
Source
238
151
  varlist_const_range varlists() const {
239
151
    return varlist_const_range(varlist_begin(), varlist_end());
240
151
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlists() const
Line
Count
Source
238
59
  varlist_const_range varlists() const {
239
59
    return varlist_const_range(varlist_begin(), varlist_end());
240
59
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlists() const
Line
Count
Source
238
42
  varlist_const_range varlists() const {
239
42
    return varlist_const_range(varlist_begin(), varlist_end());
240
42
  }
clang::OMPVarListClause<clang::OMPDependClause>::varlists() const
Line
Count
Source
238
636
  varlist_const_range varlists() const {
239
636
    return varlist_const_range(varlist_begin(), varlist_end());
240
636
  }
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPExclusiveClause>::varlists() const
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlists() const
Line
Count
Source
238
18.9k
  varlist_const_range varlists() const {
239
18.9k
    return varlist_const_range(varlist_begin(), varlist_end());
240
18.9k
  }
clang::OMPVarListClause<clang::OMPFlushClause>::varlists() const
Line
Count
Source
238
10
  varlist_const_range varlists() const {
239
10
    return varlist_const_range(varlist_begin(), varlist_end());
240
10
  }
clang::OMPVarListClause<clang::OMPFromClause>::varlists() const
Line
Count
Source
238
196
  varlist_const_range varlists() const {
239
196
    return varlist_const_range(varlist_begin(), varlist_end());
240
196
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlists() const
Line
Count
Source
238
48
  varlist_const_range varlists() const {
239
48
    return varlist_const_range(varlist_begin(), varlist_end());
240
48
  }
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPInclusiveClause>::varlists() const
clang::OMPVarListClause<clang::OMPInitClause>::varlists() const
Line
Count
Source
238
13
  varlist_const_range varlists() const {
239
13
    return varlist_const_range(varlist_begin(), varlist_end());
240
13
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlists() const
Line
Count
Source
238
437
  varlist_const_range varlists() const {
239
437
    return varlist_const_range(varlist_begin(), varlist_end());
240
437
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlists() const
Line
Count
Source
238
1.28k
  varlist_const_range varlists() const {
239
1.28k
    return varlist_const_range(varlist_begin(), varlist_end());
240
1.28k
  }
clang::OMPVarListClause<clang::OMPLinearClause>::varlists() const
Line
Count
Source
238
1.38k
  varlist_const_range varlists() const {
239
1.38k
    return varlist_const_range(varlist_begin(), varlist_end());
240
1.38k
  }
clang::OMPVarListClause<clang::OMPMapClause>::varlists() const
Line
Count
Source
238
4.09k
  varlist_const_range varlists() const {
239
4.09k
    return varlist_const_range(varlist_begin(), varlist_end());
240
4.09k
  }
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlists() const
Line
Count
Source
238
46
  varlist_const_range varlists() const {
239
46
    return varlist_const_range(varlist_begin(), varlist_end());
240
46
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlists() const
Line
Count
Source
238
2.18k
  varlist_const_range varlists() const {
239
2.18k
    return varlist_const_range(varlist_begin(), varlist_end());
240
2.18k
  }
clang::OMPVarListClause<clang::OMPReductionClause>::varlists() const
Line
Count
Source
238
2.16k
  varlist_const_range varlists() const {
239
2.16k
    return varlist_const_range(varlist_begin(), varlist_end());
240
2.16k
  }
clang::OMPVarListClause<clang::OMPSharedClause>::varlists() const
Line
Count
Source
238
227
  varlist_const_range varlists() const {
239
227
    return varlist_const_range(varlist_begin(), varlist_end());
240
227
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlists() const
Line
Count
Source
238
74
  varlist_const_range varlists() const {
239
74
    return varlist_const_range(varlist_begin(), varlist_end());
240
74
  }
clang::OMPVarListClause<clang::OMPToClause>::varlists() const
Line
Count
Source
238
216
  varlist_const_range varlists() const {
239
216
    return varlist_const_range(varlist_begin(), varlist_end());
240
216
  }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlists() const
Line
Count
Source
238
24
  varlist_const_range varlists() const {
239
24
    return varlist_const_range(varlist_begin(), varlist_end());
240
24
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlists() const
Line
Count
Source
238
168
  varlist_const_range varlists() const {
239
168
    return varlist_const_range(varlist_begin(), varlist_end());
240
168
  }
241
242
333k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_begin()
Line
Count
Source
242
134
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_begin()
Line
Count
Source
242
2.57k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_begin()
Line
Count
Source
242
4.39k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_begin()
Line
Count
Source
242
385
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_begin()
Line
Count
Source
242
959
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_begin()
Line
Count
Source
242
4.61k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_begin()
Line
Count
Source
242
70
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_begin()
Line
Count
Source
242
89.2k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_begin()
Line
Count
Source
242
72
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_begin()
Line
Count
Source
242
1.44k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_begin()
Line
Count
Source
242
4.74k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_begin()
Line
Count
Source
242
92
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPInitClause>::varlist_begin()
Line
Count
Source
242
207
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_begin()
Line
Count
Source
242
3.87k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_begin()
Line
Count
Source
242
21.7k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_begin()
Line
Count
Source
242
8.51k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_begin()
Line
Count
Source
242
66.2k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_begin()
Line
Count
Source
242
938
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_begin()
Line
Count
Source
242
35.9k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_begin()
Line
Count
Source
242
75.2k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_begin()
Line
Count
Source
242
4.19k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_begin()
Line
Count
Source
242
5.49k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPToClause>::varlist_begin()
Line
Count
Source
242
1.92k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_begin()
Line
Count
Source
242
88
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_begin()
Line
Count
Source
242
366
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
243
881k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_end()
Line
Count
Source
243
70
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_end()
Line
Count
Source
243
5.53k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_end()
Line
Count
Source
243
3.55k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_end()
Line
Count
Source
243
1.02k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_end()
Line
Count
Source
243
2.72k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_end()
Line
Count
Source
243
2.49k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_end()
Line
Count
Source
243
62
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_end()
Line
Count
Source
243
309k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_end()
Line
Count
Source
243
56
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_end()
Line
Count
Source
243
1.04k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_end()
Line
Count
Source
243
21.1k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_end()
Line
Count
Source
243
80
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPInitClause>::varlist_end()
Line
Count
Source
243
83
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_end()
Line
Count
Source
243
2.70k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_end()
Line
Count
Source
243
58.0k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_end()
Line
Count
Source
243
70.0k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_end()
Line
Count
Source
243
62.4k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_end()
Line
Count
Source
243
1.81k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_end()
Line
Count
Source
243
65.8k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_end()
Line
Count
Source
243
246k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_end()
Line
Count
Source
243
3.32k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_end()
Line
Count
Source
243
20.7k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPToClause>::varlist_end()
Line
Count
Source
243
1.54k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_end()
Line
Count
Source
243
52
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_end()
Line
Count
Source
243
1.69k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
244
44.0k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_begin() const
Line
Count
Source
244
14
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_begin() const
Line
Count
Source
244
452
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_begin() const
Line
Count
Source
244
151
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_begin() const
Line
Count
Source
244
59
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_begin() const
Line
Count
Source
244
68
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_begin() const
Line
Count
Source
244
1.05k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_begin() const
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_begin() const
Line
Count
Source
244
26.0k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_begin() const
Line
Count
Source
244
18
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_begin() const
Line
Count
Source
244
196
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_begin() const
Line
Count
Source
244
48
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_begin() const
clang::OMPVarListClause<clang::OMPInitClause>::varlist_begin() const
Line
Count
Source
244
96
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_begin() const
Line
Count
Source
244
437
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_begin() const
Line
Count
Source
244
2.36k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_begin() const
Line
Count
Source
244
1.87k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_begin() const
Line
Count
Source
244
4.09k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_begin() const
Line
Count
Source
244
46
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_begin() const
Line
Count
Source
244
3.21k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_begin() const
Line
Count
Source
244
2.98k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_begin() const
Line
Count
Source
244
227
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_begin() const
Line
Count
Source
244
126
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPToClause>::varlist_begin() const
Line
Count
Source
244
216
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_begin() const
Line
Count
Source
244
24
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_begin() const
Line
Count
Source
244
240
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
245
128k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_end() const
Line
Count
Source
245
14
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_end() const
Line
Count
Source
245
1.00k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_end() const
Line
Count
Source
245
151
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_end() const
Line
Count
Source
245
413
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_end() const
Line
Count
Source
245
450
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_end() const
Line
Count
Source
245
1.05k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_end() const
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_end() const
Line
Count
Source
245
63.4k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_end() const
Line
Count
Source
245
18
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_end() const
Line
Count
Source
245
196
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_end() const
Line
Count
Source
245
352
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_end() const
clang::OMPVarListClause<clang::OMPInitClause>::varlist_end() const
Line
Count
Source
245
13
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_end() const
Line
Count
Source
245
437
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_end() const
Line
Count
Source
245
7.96k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_end() const
Line
Count
Source
245
8.76k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_end() const
Line
Count
Source
245
4.09k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_end() const
Line
Count
Source
245
46
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_end() const
Line
Count
Source
245
5.90k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_end() const
Line
Count
Source
245
32.2k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_end() const
Line
Count
Source
245
227
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_end() const
Line
Count
Source
245
1.13k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPToClause>::varlist_end() const
Line
Count
Source
245
216
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_end() const
Line
Count
Source
245
24
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_end() const
Line
Count
Source
245
456
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
246
247
  /// Sets the location of '('.
248
14.4k
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPInitClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
26
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPPrivateClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
1.38k
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
4.23k
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPLastprivateClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
394
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPSharedClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
400
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPReductionClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
916
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
86
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPInReductionClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
78
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPLinearClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
374
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPAlignedClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
250
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPCopyinClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
78
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
23
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPFlushClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
10
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPDependClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
685
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPMapClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
4.14k
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPAllocateClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
237
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPToClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
216
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPFromClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
196
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
90
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
14
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
442
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPNontemporalClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
90
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPInclusiveClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
12
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPExclusiveClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
12
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPAffinityClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
248
10
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
249
250
  /// Returns the location of '('.
251
60.3k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPAffinityClause>::getLParenLoc() const
Line
Count
Source
251
22
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPAlignedClause>::getLParenLoc() const
Line
Count
Source
251
718
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPAllocateClause>::getLParenLoc() const
Line
Count
Source
251
1.11k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::getLParenLoc() const
Line
Count
Source
251
85
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPCopyinClause>::getLParenLoc() const
Line
Count
Source
251
210
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPDependClause>::getLParenLoc() const
Line
Count
Source
251
1.30k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPExclusiveClause>::getLParenLoc() const
Line
Count
Source
251
14
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::getLParenLoc() const
Line
Count
Source
251
5.50k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPFlushClause>::getLParenLoc() const
Line
Count
Source
251
42
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPFromClause>::getLParenLoc() const
Line
Count
Source
251
682
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPInReductionClause>::getLParenLoc() const
Line
Count
Source
251
1.20k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPInclusiveClause>::getLParenLoc() const
Line
Count
Source
251
22
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPInitClause>::getLParenLoc() const
Line
Count
Source
251
23
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::getLParenLoc() const
Line
Count
Source
251
1.53k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPLastprivateClause>::getLParenLoc() const
Line
Count
Source
251
1.78k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPLinearClause>::getLParenLoc() const
Line
Count
Source
251
908
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPMapClause>::getLParenLoc() const
Line
Count
Source
251
16.1k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPNontemporalClause>::getLParenLoc() const
Line
Count
Source
251
102
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPPrivateClause>::getLParenLoc() const
Line
Count
Source
251
5.94k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPReductionClause>::getLParenLoc() const
Line
Count
Source
251
18.4k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPSharedClause>::getLParenLoc() const
Line
Count
Source
251
1.81k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::getLParenLoc() const
Line
Count
Source
251
1.33k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPToClause>::getLParenLoc() const
Line
Count
Source
251
1.04k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::getLParenLoc() const
Line
Count
Source
251
36
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::getLParenLoc() const
Line
Count
Source
251
286
  SourceLocation getLParenLoc() const { return LParenLoc; }
252
253
  /// Fetches list of all variables in the clause.
254
184k
  ArrayRef<const Expr *> getVarRefs() const {
255
184k
    return llvm::makeArrayRef(
256
184k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
184k
        NumVars);
258
184k
  }
clang::OMPVarListClause<clang::OMPAffinityClause>::getVarRefs() const
Line
Count
Source
254
28
  ArrayRef<const Expr *> getVarRefs() const {
255
28
    return llvm::makeArrayRef(
256
28
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
28
        NumVars);
258
28
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::getVarRefs() const
Line
Count
Source
254
1.45k
  ArrayRef<const Expr *> getVarRefs() const {
255
1.45k
    return llvm::makeArrayRef(
256
1.45k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
1.45k
        NumVars);
258
1.45k
  }
clang::OMPVarListClause<clang::OMPAllocateClause>::getVarRefs() const
Line
Count
Source
254
302
  ArrayRef<const Expr *> getVarRefs() const {
255
302
    return llvm::makeArrayRef(
256
302
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
302
        NumVars);
258
302
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::getVarRefs() const
Line
Count
Source
254
472
  ArrayRef<const Expr *> getVarRefs() const {
255
472
    return llvm::makeArrayRef(
256
472
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
472
        NumVars);
258
472
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::getVarRefs() const
Line
Count
Source
254
518
  ArrayRef<const Expr *> getVarRefs() const {
255
518
    return llvm::makeArrayRef(
256
518
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
518
        NumVars);
258
518
  }
clang::OMPVarListClause<clang::OMPDependClause>::getVarRefs() const
Line
Count
Source
254
2.16k
  ArrayRef<const Expr *> getVarRefs() const {
255
2.16k
    return llvm::makeArrayRef(
256
2.16k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
2.16k
        NumVars);
258
2.16k
  }
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPExclusiveClause>::getVarRefs() const
clang::OMPVarListClause<clang::OMPFirstprivateClause>::getVarRefs() const
Line
Count
Source
254
89.4k
  ArrayRef<const Expr *> getVarRefs() const {
255
89.4k
    return llvm::makeArrayRef(
256
89.4k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
89.4k
        NumVars);
258
89.4k
  }
clang::OMPVarListClause<clang::OMPFlushClause>::getVarRefs() const
Line
Count
Source
254
36
  ArrayRef<const Expr *> getVarRefs() const {
255
36
    return llvm::makeArrayRef(
256
36
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
36
        NumVars);
258
36
  }
clang::OMPVarListClause<clang::OMPFromClause>::getVarRefs() const
Line
Count
Source
254
498
  ArrayRef<const Expr *> getVarRefs() const {
255
498
    return llvm::makeArrayRef(
256
498
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
498
        NumVars);
258
498
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::getVarRefs() const
Line
Count
Source
254
400
  ArrayRef<const Expr *> getVarRefs() const {
255
400
    return llvm::makeArrayRef(
256
400
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
400
        NumVars);
258
400
  }
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPInclusiveClause>::getVarRefs() const
clang::OMPVarListClause<clang::OMPInitClause>::getVarRefs() const
Line
Count
Source
254
109
  ArrayRef<const Expr *> getVarRefs() const {
255
109
    return llvm::makeArrayRef(
256
109
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
109
        NumVars);
258
109
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::getVarRefs() const
Line
Count
Source
254
874
  ArrayRef<const Expr *> getVarRefs() const {
255
874
    return llvm::makeArrayRef(
256
874
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
874
        NumVars);
258
874
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::getVarRefs() const
Line
Count
Source
254
10.3k
  ArrayRef<const Expr *> getVarRefs() const {
255
10.3k
    return llvm::makeArrayRef(
256
10.3k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
10.3k
        NumVars);
258
10.3k
  }
clang::OMPVarListClause<clang::OMPLinearClause>::getVarRefs() const
Line
Count
Source
254
10.6k
  ArrayRef<const Expr *> getVarRefs() const {
255
10.6k
    return llvm::makeArrayRef(
256
10.6k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
10.6k
        NumVars);
258
10.6k
  }
clang::OMPVarListClause<clang::OMPMapClause>::getVarRefs() const
Line
Count
Source
254
20.0k
  ArrayRef<const Expr *> getVarRefs() const {
255
20.0k
    return llvm::makeArrayRef(
256
20.0k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
20.0k
        NumVars);
258
20.0k
  }
clang::OMPVarListClause<clang::OMPNontemporalClause>::getVarRefs() const
Line
Count
Source
254
92
  ArrayRef<const Expr *> getVarRefs() const {
255
92
    return llvm::makeArrayRef(
256
92
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
92
        NumVars);
258
92
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::getVarRefs() const
Line
Count
Source
254
9.12k
  ArrayRef<const Expr *> getVarRefs() const {
255
9.12k
    return llvm::makeArrayRef(
256
9.12k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
9.12k
        NumVars);
258
9.12k
  }
clang::OMPVarListClause<clang::OMPReductionClause>::getVarRefs() const
Line
Count
Source
254
35.2k
  ArrayRef<const Expr *> getVarRefs() const {
255
35.2k
    return llvm::makeArrayRef(
256
35.2k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
35.2k
        NumVars);
258
35.2k
  }
clang::OMPVarListClause<clang::OMPSharedClause>::getVarRefs() const
Line
Count
Source
254
454
  ArrayRef<const Expr *> getVarRefs() const {
255
454
    return llvm::makeArrayRef(
256
454
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
454
        NumVars);
258
454
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::getVarRefs() const
Line
Count
Source
254
1.26k
  ArrayRef<const Expr *> getVarRefs() const {
255
1.26k
    return llvm::makeArrayRef(
256
1.26k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
1.26k
        NumVars);
258
1.26k
  }
clang::OMPVarListClause<clang::OMPToClause>::getVarRefs() const
Line
Count
Source
254
548
  ArrayRef<const Expr *> getVarRefs() const {
255
548
    return llvm::makeArrayRef(
256
548
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
548
        NumVars);
258
548
  }
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::getVarRefs() const
Line
Count
Source
254
48
  ArrayRef<const Expr *> getVarRefs() const {
255
48
    return llvm::makeArrayRef(
256
48
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
48
        NumVars);
258
48
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::getVarRefs() const
Line
Count
Source
254
696
  ArrayRef<const Expr *> getVarRefs() const {
255
696
    return llvm::makeArrayRef(
256
696
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
257
696
        NumVars);
258
696
  }
259
};
260
261
/// This represents 'allocator' clause in the '#pragma omp ...'
262
/// directive.
263
///
264
/// \code
265
/// #pragma omp allocate(a) allocator(omp_default_mem_alloc)
266
/// \endcode
267
/// In this example directive '#pragma omp allocate' has simple 'allocator'
268
/// clause with the allocator 'omp_default_mem_alloc'.
269
class OMPAllocatorClause : public OMPClause {
270
  friend class OMPClauseReader;
271
272
  /// Location of '('.
273
  SourceLocation LParenLoc;
274
275
  /// Expression with the allocator.
276
  Stmt *Allocator = nullptr;
277
278
  /// Set allocator.
279
104
  void setAllocator(Expr *A) { Allocator = A; }
280
281
public:
282
  /// Build 'allocator' clause with the given allocator.
283
  ///
284
  /// \param A Allocator.
285
  /// \param StartLoc Starting location of the clause.
286
  /// \param LParenLoc Location of '('.
287
  /// \param EndLoc Ending location of the clause.
288
  OMPAllocatorClause(Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc,
289
                     SourceLocation EndLoc)
290
      : OMPClause(llvm::omp::OMPC_allocator, StartLoc, EndLoc),
291
396
        LParenLoc(LParenLoc), Allocator(A) {}
292
293
  /// Build an empty clause.
294
  OMPAllocatorClause()
295
      : OMPClause(llvm::omp::OMPC_allocator, SourceLocation(),
296
104
                  SourceLocation()) {}
297
298
  /// Sets the location of '('.
299
104
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
300
301
  /// Returns the location of '('.
302
170
  SourceLocation getLParenLoc() const { return LParenLoc; }
303
304
  /// Returns allocator.
305
652
  Expr *getAllocator() const { return cast_or_null<Expr>(Allocator); }
306
307
0
  child_range children() { return child_range(&Allocator, &Allocator + 1); }
308
309
0
  const_child_range children() const {
310
0
    return const_child_range(&Allocator, &Allocator + 1);
311
0
  }
312
313
0
  child_range used_children() {
314
0
    return child_range(child_iterator(), child_iterator());
315
0
  }
316
0
  const_child_range used_children() const {
317
0
    return const_child_range(const_child_iterator(), const_child_iterator());
318
0
  }
319
320
454
  static bool classof(const OMPClause *T) {
321
454
    return T->getClauseKind() == llvm::omp::OMPC_allocator;
322
454
  }
323
};
324
325
/// This represents clause 'allocate' in the '#pragma omp ...' directives.
326
///
327
/// \code
328
/// #pragma omp parallel private(a) allocate(omp_default_mem_alloc :a)
329
/// \endcode
330
/// In this example directive '#pragma omp parallel' has clause 'private'
331
/// and clause 'allocate' for the variable 'a'.
332
class OMPAllocateClause final
333
    : public OMPVarListClause<OMPAllocateClause>,
334
      private llvm::TrailingObjects<OMPAllocateClause, Expr *> {
335
  friend class OMPClauseReader;
336
  friend OMPVarListClause;
337
  friend TrailingObjects;
338
339
  /// Allocator specified in the clause, or 'nullptr' if the default one is
340
  /// used.
341
  Expr *Allocator = nullptr;
342
  /// Position of the ':' delimiter in the clause;
343
  SourceLocation ColonLoc;
344
345
  /// Build clause with number of variables \a N.
346
  ///
347
  /// \param StartLoc Starting location of the clause.
348
  /// \param LParenLoc Location of '('.
349
  /// \param Allocator Allocator expression.
350
  /// \param ColonLoc Location of ':' delimiter.
351
  /// \param EndLoc Ending location of the clause.
352
  /// \param N Number of the variables in the clause.
353
  OMPAllocateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
354
                    Expr *Allocator, SourceLocation ColonLoc,
355
                    SourceLocation EndLoc, unsigned N)
356
      : OMPVarListClause<OMPAllocateClause>(llvm::omp::OMPC_allocate, StartLoc,
357
                                            LParenLoc, EndLoc, N),
358
1.75k
        Allocator(Allocator), ColonLoc(ColonLoc) {}
359
360
  /// Build an empty clause.
361
  ///
362
  /// \param N Number of variables.
363
  explicit OMPAllocateClause(unsigned N)
364
      : OMPVarListClause<OMPAllocateClause>(llvm::omp::OMPC_allocate,
365
                                            SourceLocation(), SourceLocation(),
366
237
                                            SourceLocation(), N) {}
367
368
  /// Sets location of ':' symbol in clause.
369
237
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
370
371
237
  void setAllocator(Expr *A) { Allocator = A; }
372
373
public:
374
  /// Creates clause with a list of variables \a VL.
375
  ///
376
  /// \param C AST context.
377
  /// \param StartLoc Starting location of the clause.
378
  /// \param LParenLoc Location of '('.
379
  /// \param Allocator Allocator expression.
380
  /// \param ColonLoc Location of ':' delimiter.
381
  /// \param EndLoc Ending location of the clause.
382
  /// \param VL List of references to the variables.
383
  static OMPAllocateClause *Create(const ASTContext &C, SourceLocation StartLoc,
384
                                   SourceLocation LParenLoc, Expr *Allocator,
385
                                   SourceLocation ColonLoc,
386
                                   SourceLocation EndLoc, ArrayRef<Expr *> VL);
387
388
  /// Returns the allocator expression or nullptr, if no allocator is specified.
389
6.39k
  Expr *getAllocator() const { return Allocator; }
390
391
  /// Returns the location of the ':' delimiter.
392
1.11k
  SourceLocation getColonLoc() const { return ColonLoc; }
393
394
  /// Creates an empty clause with the place for \a N variables.
395
  ///
396
  /// \param C AST context.
397
  /// \param N The number of variables.
398
  static OMPAllocateClause *CreateEmpty(const ASTContext &C, unsigned N);
399
400
478
  child_range children() {
401
478
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
402
478
                       reinterpret_cast<Stmt **>(varlist_end()));
403
478
  }
404
405
0
  const_child_range children() const {
406
0
    auto Children = const_cast<OMPAllocateClause *>(this)->children();
407
0
    return const_child_range(Children.begin(), Children.end());
408
0
  }
409
410
1.19k
  child_range used_children() {
411
1.19k
    return child_range(child_iterator(), child_iterator());
412
1.19k
  }
413
0
  const_child_range used_children() const {
414
0
    return const_child_range(const_child_iterator(), const_child_iterator());
415
0
  }
416
417
158k
  static bool classof(const OMPClause *T) {
418
158k
    return T->getClauseKind() == llvm::omp::OMPC_allocate;
419
158k
  }
420
};
421
422
/// This represents 'if' clause in the '#pragma omp ...' directive.
423
///
424
/// \code
425
/// #pragma omp parallel if(parallel:a > 5)
426
/// \endcode
427
/// In this example directive '#pragma omp parallel' has simple 'if' clause with
428
/// condition 'a > 5' and directive name modifier 'parallel'.
429
class OMPIfClause : public OMPClause, public OMPClauseWithPreInit {
430
  friend class OMPClauseReader;
431
432
  /// Location of '('.
433
  SourceLocation LParenLoc;
434
435
  /// Condition of the 'if' clause.
436
  Stmt *Condition = nullptr;
437
438
  /// Location of ':' (if any).
439
  SourceLocation ColonLoc;
440
441
  /// Directive name modifier for the clause.
442
  OpenMPDirectiveKind NameModifier = llvm::omp::OMPD_unknown;
443
444
  /// Name modifier location.
445
  SourceLocation NameModifierLoc;
446
447
  /// Set condition.
448
2.48k
  void setCondition(Expr *Cond) { Condition = Cond; }
449
450
  /// Set directive name modifier for the clause.
451
2.48k
  void setNameModifier(OpenMPDirectiveKind NM) { NameModifier = NM; }
452
453
  /// Set location of directive name modifier for the clause.
454
2.48k
  void setNameModifierLoc(SourceLocation Loc) { NameModifierLoc = Loc; }
455
456
  /// Set location of ':'.
457
2.48k
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
458
459
public:
460
  /// Build 'if' clause with condition \a Cond.
461
  ///
462
  /// \param NameModifier [OpenMP 4.1] Directive name modifier of clause.
463
  /// \param Cond Condition of the clause.
464
  /// \param HelperCond Helper condition for the clause.
465
  /// \param CaptureRegion Innermost OpenMP region where expressions in this
466
  /// clause must be captured.
467
  /// \param StartLoc Starting location of the clause.
468
  /// \param LParenLoc Location of '('.
469
  /// \param NameModifierLoc Location of directive name modifier.
470
  /// \param ColonLoc [OpenMP 4.1] Location of ':'.
471
  /// \param EndLoc Ending location of the clause.
472
  OMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Cond, Stmt *HelperCond,
473
              OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
474
              SourceLocation LParenLoc, SourceLocation NameModifierLoc,
475
              SourceLocation ColonLoc, SourceLocation EndLoc)
476
      : OMPClause(llvm::omp::OMPC_if, StartLoc, EndLoc),
477
        OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Condition(Cond),
478
        ColonLoc(ColonLoc), NameModifier(NameModifier),
479
12.1k
        NameModifierLoc(NameModifierLoc) {
480
12.1k
    setPreInitStmt(HelperCond, CaptureRegion);
481
12.1k
  }
482
483
  /// Build an empty clause.
484
  OMPIfClause()
485
      : OMPClause(llvm::omp::OMPC_if, SourceLocation(), SourceLocation()),
486
2.48k
        OMPClauseWithPreInit(this) {}
487
488
  /// Sets the location of '('.
489
2.48k
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
490
491
  /// Returns the location of '('.
492
5.09k
  SourceLocation getLParenLoc() const { return LParenLoc; }
493
494
  /// Return the location of ':'.
495
5.09k
  SourceLocation getColonLoc() const { return ColonLoc; }
496
497
  /// Returns condition.
498
13.9k
  Expr *getCondition() const { return cast_or_null<Expr>(Condition); }
499
500
  /// Return directive name modifier associated with the clause.
501
26.6k
  OpenMPDirectiveKind getNameModifier() const { return NameModifier; }
502
503
  /// Return the location of directive name modifier.
504
11.4k
  SourceLocation getNameModifierLoc() const { return NameModifierLoc; }
505
506
1.35k
  child_range children() { return child_range(&Condition, &Condition + 1); }
507
508
0
  const_child_range children() const {
509
0
    return const_child_range(&Condition, &Condition + 1);
510
0
  }
511
512
  child_range used_children();
513
0
  const_child_range used_children() const {
514
0
    auto Children = const_cast<OMPIfClause *>(this)->used_children();
515
0
    return const_child_range(Children.begin(), Children.end());
516
0
  }
517
518
189k
  static bool classof(const OMPClause *T) {
519
189k
    return T->getClauseKind() == llvm::omp::OMPC_if;
520
189k
  }
521
};
522
523
/// This represents 'final' clause in the '#pragma omp ...' directive.
524
///
525
/// \code
526
/// #pragma omp task final(a > 5)
527
/// \endcode
528
/// In this example directive '#pragma omp task' has simple 'final'
529
/// clause with condition 'a > 5'.
530
class OMPFinalClause : public OMPClause, public OMPClauseWithPreInit {
531
  friend class OMPClauseReader;
532
533
  /// Location of '('.
534
  SourceLocation LParenLoc;
535
536
  /// Condition of the 'if' clause.
537
  Stmt *Condition = nullptr;
538
539
  /// Set condition.
540
58
  void setCondition(Expr *Cond) { Condition = Cond; }
541
542
public:
543
  /// Build 'final' clause with condition \a Cond.
544
  ///
545
  /// \param Cond Condition of the clause.
546
  /// \param HelperCond Helper condition for the construct.
547
  /// \param CaptureRegion Innermost OpenMP region where expressions in this
548
  /// clause must be captured.
549
  /// \param StartLoc Starting location of the clause.
550
  /// \param LParenLoc Location of '('.
551
  /// \param EndLoc Ending location of the clause.
552
  OMPFinalClause(Expr *Cond, Stmt *HelperCond,
553
                 OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
554
                 SourceLocation LParenLoc, SourceLocation EndLoc)
555
      : OMPClause(llvm::omp::OMPC_final, StartLoc, EndLoc),
556
518
        OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Condition(Cond) {
557
518
    setPreInitStmt(HelperCond, CaptureRegion);
558
518
  }
559
560
  /// Build an empty clause.
561
  OMPFinalClause()
562
      : OMPClause(llvm::omp::OMPC_final, SourceLocation(), SourceLocation()),
563
58
        OMPClauseWithPreInit(this) {}
564
565
  /// Sets the location of '('.
566
58
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
567
568
  /// Returns the location of '('.
569
236
  SourceLocation getLParenLoc() const { return LParenLoc; }
570
571
  /// Returns condition.
572
458
  Expr *getCondition() const { return cast_or_null<Expr>(Condition); }
573
574
152
  child_range children() { return child_range(&Condition, &Condition + 1); }
575
576
0
  const_child_range children() const {
577
0
    return const_child_range(&Condition, &Condition + 1);
578
0
  }
579
580
  child_range used_children();
581
0
  const_child_range used_children() const {
582
0
    auto Children = const_cast<OMPFinalClause *>(this)->used_children();
583
0
    return const_child_range(Children.begin(), Children.end());
584
0
  }
585
586
825
  static bool classof(const OMPClause *T) {
587
825
    return T->getClauseKind() == llvm::omp::OMPC_final;
588
825
  }
589
};
590
591
/// This represents 'num_threads' clause in the '#pragma omp ...'
592
/// directive.
593
///
594
/// \code
595
/// #pragma omp parallel num_threads(6)
596
/// \endcode
597
/// In this example directive '#pragma omp parallel' has simple 'num_threads'
598
/// clause with number of threads '6'.
599
class OMPNumThreadsClause : public OMPClause, public OMPClauseWithPreInit {
600
  friend class OMPClauseReader;
601
602
  /// Location of '('.
603
  SourceLocation LParenLoc;
604
605
  /// Condition of the 'num_threads' clause.
606
  Stmt *NumThreads = nullptr;
607
608
  /// Set condition.
609
314
  void setNumThreads(Expr *NThreads) { NumThreads = NThreads; }
610
611
public:
612
  /// Build 'num_threads' clause with condition \a NumThreads.
613
  ///
614
  /// \param NumThreads Number of threads for the construct.
615
  /// \param HelperNumThreads Helper Number of threads for the construct.
616
  /// \param CaptureRegion Innermost OpenMP region where expressions in this
617
  /// clause must be captured.
618
  /// \param StartLoc Starting location of the clause.
619
  /// \param LParenLoc Location of '('.
620
  /// \param EndLoc Ending location of the clause.
621
  OMPNumThreadsClause(Expr *NumThreads, Stmt *HelperNumThreads,
622
                      OpenMPDirectiveKind CaptureRegion,
623
                      SourceLocation StartLoc, SourceLocation LParenLoc,
624
                      SourceLocation EndLoc)
625
      : OMPClause(llvm::omp::OMPC_num_threads, StartLoc, EndLoc),
626
        OMPClauseWithPreInit(this), LParenLoc(LParenLoc),
627
1.98k
        NumThreads(NumThreads) {
628
1.98k
    setPreInitStmt(HelperNumThreads, CaptureRegion);
629
1.98k
  }
630
631
  /// Build an empty clause.
632
  OMPNumThreadsClause()
633
      : OMPClause(llvm::omp::OMPC_num_threads, SourceLocation(),
634
                  SourceLocation()),
635
314
        OMPClauseWithPreInit(this) {}
636
637
  /// Sets the location of '('.
638
314
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
639
640
  /// Returns the location of '('.
641
1.17k
  SourceLocation getLParenLoc() const { return LParenLoc; }
642
643
  /// Returns number of threads.
644
2.71k
  Expr *getNumThreads() const { return cast_or_null<Expr>(NumThreads); }
645
646
502
  child_range children() { return child_range(&NumThreads, &NumThreads + 1); }
647
648
0
  const_child_range children() const {
649
0
    return const_child_range(&NumThreads, &NumThreads + 1);
650
0
  }
651
652
1.79k
  child_range used_children() {
653
1.79k
    return child_range(child_iterator(), child_iterator());
654
1.79k
  }
655
0
  const_child_range used_children() const {
656
0
    return const_child_range(const_child_iterator(), const_child_iterator());
657
0
  }
658
659
18.7k
  static bool classof(const OMPClause *T) {
660
18.7k
    return T->getClauseKind() == llvm::omp::OMPC_num_threads;
661
18.7k
  }
662
};
663
664
/// This represents 'safelen' clause in the '#pragma omp ...'
665
/// directive.
666
///
667
/// \code
668
/// #pragma omp simd safelen(4)
669
/// \endcode
670
/// In this example directive '#pragma omp simd' has clause 'safelen'
671
/// with single expression '4'.
672
/// If the safelen clause is used then no two iterations executed
673
/// concurrently with SIMD instructions can have a greater distance
674
/// in the logical iteration space than its value. The parameter of
675
/// the safelen clause must be a constant positive integer expression.
676
class OMPSafelenClause : public OMPClause {
677
  friend class OMPClauseReader;
678
679
  /// Location of '('.
680
  SourceLocation LParenLoc;
681
682
  /// Safe iteration space distance.
683
  Stmt *Safelen = nullptr;
684
685
  /// Set safelen.
686
228
  void setSafelen(Expr *Len) { Safelen = Len; }
687
688
public:
689
  /// Build 'safelen' clause.
690
  ///
691
  /// \param Len Expression associated with this clause.
692
  /// \param StartLoc Starting location of the clause.
693
  /// \param EndLoc Ending location of the clause.
694
  OMPSafelenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc,
695
                   SourceLocation EndLoc)
696
      : OMPClause(llvm::omp::OMPC_safelen, StartLoc, EndLoc),
697
3.34k
        LParenLoc(LParenLoc), Safelen(Len) {}
698
699
  /// Build an empty clause.
700
  explicit OMPSafelenClause()
701
228
      : OMPClause(llvm::omp::OMPC_safelen, SourceLocation(), SourceLocation()) {
702
228
  }
703
704
  /// Sets the location of '('.
705
228
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
706
707
  /// Returns the location of '('.
708
2.19k
  SourceLocation getLParenLoc() const { return LParenLoc; }
709
710
  /// Return safe iteration space distance.
711
3.44k
  Expr *getSafelen() const { return cast_or_null<Expr>(Safelen); }
712
713
708
  child_range children() { return child_range(&Safelen, &Safelen + 1); }
714
715
0
  const_child_range children() const {
716
0
    return const_child_range(&Safelen, &Safelen + 1);
717
0
  }
718
719
648
  child_range used_children() {
720
648
    return child_range(child_iterator(), child_iterator());
721
648
  }
722
0
  const_child_range used_children() const {
723
0
    return const_child_range(const_child_iterator(), const_child_iterator());
724
0
  }
725
726
18.0k
  static bool classof(const OMPClause *T) {
727
18.0k
    return T->getClauseKind() == llvm::omp::OMPC_safelen;
728
18.0k
  }
729
};
730
731
/// This represents 'simdlen' clause in the '#pragma omp ...'
732
/// directive.
733
///
734
/// \code
735
/// #pragma omp simd simdlen(4)
736
/// \endcode
737
/// In this example directive '#pragma omp simd' has clause 'simdlen'
738
/// with single expression '4'.
739
/// If the 'simdlen' clause is used then it specifies the preferred number of
740
/// iterations to be executed concurrently. The parameter of the 'simdlen'
741
/// clause must be a constant positive integer expression.
742
class OMPSimdlenClause : public OMPClause {
743
  friend class OMPClauseReader;
744
745
  /// Location of '('.
746
  SourceLocation LParenLoc;
747
748
  /// Safe iteration space distance.
749
  Stmt *Simdlen = nullptr;
750
751
  /// Set simdlen.
752
232
  void setSimdlen(Expr *Len) { Simdlen = Len; }
753
754
public:
755
  /// Build 'simdlen' clause.
756
  ///
757
  /// \param Len Expression associated with this clause.
758
  /// \param StartLoc Starting location of the clause.
759
  /// \param EndLoc Ending location of the clause.
760
  OMPSimdlenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc,
761
                   SourceLocation EndLoc)
762
      : OMPClause(llvm::omp::OMPC_simdlen, StartLoc, EndLoc),
763
2.08k
        LParenLoc(LParenLoc), Simdlen(Len) {}
764
765
  /// Build an empty clause.
766
  explicit OMPSimdlenClause()
767
232
      : OMPClause(llvm::omp::OMPC_simdlen, SourceLocation(), SourceLocation()) {
768
232
  }
769
770
  /// Sets the location of '('.
771
232
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
772
773
  /// Returns the location of '('.
774
1.22k
  SourceLocation getLParenLoc() const { return LParenLoc; }
775
776
  /// Return safe iteration space distance.
777
2.57k
  Expr *getSimdlen() const { return cast_or_null<Expr>(Simdlen); }
778
779
290
  child_range children() { return child_range(&Simdlen, &Simdlen + 1); }
780
781
0
  const_child_range children() const {
782
0
    return const_child_range(&Simdlen, &Simdlen + 1);
783
0
  }
784
785
672
  child_range used_children() {
786
672
    return child_range(child_iterator(), child_iterator());
787
672
  }
788
0
  const_child_range used_children() const {
789
0
    return const_child_range(const_child_iterator(), const_child_iterator());
790
0
  }
791
792
15.9k
  static bool classof(const OMPClause *T) {
793
15.9k
    return T->getClauseKind() == llvm::omp::OMPC_simdlen;
794
15.9k
  }
795
};
796
797
/// This represents the 'sizes' clause in the '#pragma omp tile' directive.
798
///
799
/// \code
800
/// #pragma omp tile sizes(5,5)
801
/// for (int i = 0; i < 64; ++i)
802
///   for (int j = 0; j < 64; ++j)
803
/// \endcode
804
class OMPSizesClause final
805
    : public OMPClause,
806
      private llvm::TrailingObjects<OMPSizesClause, Expr *> {
807
  friend class OMPClauseReader;
808
  friend class llvm::TrailingObjects<OMPSizesClause, Expr *>;
809
810
  /// Location of '('.
811
  SourceLocation LParenLoc;
812
813
  /// Number of tile sizes in the clause.
814
  unsigned NumSizes;
815
816
  /// Build an empty clause.
817
  explicit OMPSizesClause(int NumSizes)
818
      : OMPClause(llvm::omp::OMPC_sizes, SourceLocation(), SourceLocation()),
819
95
        NumSizes(NumSizes) {}
820
821
public:
822
  /// Build a 'sizes' AST node.
823
  ///
824
  /// \param C         Context of the AST.
825
  /// \param StartLoc  Location of the 'sizes' identifier.
826
  /// \param LParenLoc Location of '('.
827
  /// \param EndLoc    Location of ')'.
828
  /// \param Sizes     Content of the clause.
829
  static OMPSizesClause *Create(const ASTContext &C, SourceLocation StartLoc,
830
                                SourceLocation LParenLoc, SourceLocation EndLoc,
831
                                ArrayRef<Expr *> Sizes);
832
833
  /// Build an empty 'sizes' AST node for deserialization.
834
  ///
835
  /// \param C     Context of the AST.
836
  /// \param NumSizes Number of items in the clause.
837
  static OMPSizesClause *CreateEmpty(const ASTContext &C, unsigned NumSizes);
838
839
  /// Sets the location of '('.
840
95
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
841
842
  /// Returns the location of '('.
843
25
  SourceLocation getLParenLoc() const { return LParenLoc; }
844
845
  /// Returns the number of list items.
846
95
  unsigned getNumSizes() const { return NumSizes; }
847
848
  /// Returns the tile size expressions.
849
77
  MutableArrayRef<Expr *> getSizesRefs() {
850
77
    return MutableArrayRef<Expr *>(static_cast<OMPSizesClause *>(this)
851
77
                                       ->template getTrailingObjects<Expr *>(),
852
77
                                   NumSizes);
853
77
  }
854
164
  ArrayRef<Expr *> getSizesRefs() const {
855
164
    return ArrayRef<Expr *>(static_cast<const OMPSizesClause *>(this)
856
164
                                ->template getTrailingObjects<Expr *>(),
857
164
                            NumSizes);
858
164
  }
859
860
  /// Sets the tile size expressions.
861
71
  void setSizesRefs(ArrayRef<Expr *> VL) {
862
71
    assert(VL.size() == NumSizes);
863
0
    std::copy(VL.begin(), VL.end(),
864
71
              static_cast<OMPSizesClause *>(this)
865
71
                  ->template getTrailingObjects<Expr *>());
866
71
  }
867
868
14
  child_range children() {
869
14
    MutableArrayRef<Expr *> Sizes = getSizesRefs();
870
14
    return child_range(reinterpret_cast<Stmt **>(Sizes.begin()),
871
14
                       reinterpret_cast<Stmt **>(Sizes.end()));
872
14
  }
873
0
  const_child_range children() const {
874
0
    ArrayRef<Expr *> Sizes = getSizesRefs();
875
0
    return const_child_range(reinterpret_cast<Stmt *const *>(Sizes.begin()),
876
0
                             reinterpret_cast<Stmt *const *>(Sizes.end()));
877
0
  }
878
879
0
  child_range used_children() {
880
0
    return child_range(child_iterator(), child_iterator());
881
0
  }
882
0
  const_child_range used_children() const {
883
0
    return const_child_range(const_child_iterator(), const_child_iterator());
884
0
  }
885
886
147
  static bool classof(const OMPClause *T) {
887
147
    return T->getClauseKind() == llvm::omp::OMPC_sizes;
888
147
  }
889
};
890
891
/// Representation of the 'full' clause of the '#pragma omp unroll' directive.
892
///
893
/// \code
894
/// #pragma omp unroll full
895
/// for (int i = 0; i < 64; ++i)
896
/// \endcode
897
class OMPFullClause final : public OMPClause {
898
  friend class OMPClauseReader;
899
900
  /// Build an empty clause.
901
18
  explicit OMPFullClause() : OMPClause(llvm::omp::OMPC_full, {}, {}) {}
902
903
public:
904
  /// Build an AST node for a 'full' clause.
905
  ///
906
  /// \param C        Context of the AST.
907
  /// \param StartLoc Starting location of the clause.
908
  /// \param EndLoc   Ending location of the clause.
909
  static OMPFullClause *Create(const ASTContext &C, SourceLocation StartLoc,
910
                               SourceLocation EndLoc);
911
912
  /// Build an empty 'full' AST node for deserialization.
913
  ///
914
  /// \param C Context of the AST.
915
  static OMPFullClause *CreateEmpty(const ASTContext &C);
916
917
2
  child_range children() { return {child_iterator(), child_iterator()}; }
918
0
  const_child_range children() const {
919
0
    return {const_child_iterator(), const_child_iterator()};
920
0
  }
921
922
0
  child_range used_children() {
923
0
    return child_range(child_iterator(), child_iterator());
924
0
  }
925
0
  const_child_range used_children() const {
926
0
    return const_child_range(const_child_iterator(), const_child_iterator());
927
0
  }
928
929
98
  static bool classof(const OMPClause *T) {
930
98
    return T->getClauseKind() == llvm::omp::OMPC_full;
931
98
  }
932
};
933
934
/// Representation of the 'partial' clause of the '#pragma omp unroll'
935
/// directive.
936
///
937
/// \code
938
/// #pragma omp unroll partial(4)
939
/// for (int i = start; i < end; ++i)
940
/// \endcode
941
class OMPPartialClause final : public OMPClause {
942
  friend class OMPClauseReader;
943
944
  /// Location of '('.
945
  SourceLocation LParenLoc;
946
947
  /// Optional argument to the clause (unroll factor).
948
  Stmt *Factor;
949
950
  /// Build an empty clause.
951
78
  explicit OMPPartialClause() : OMPClause(llvm::omp::OMPC_partial, {}, {}) {}
952
953
  /// Set the unroll factor.
954
78
  void setFactor(Expr *E) { Factor = E; }
955
956
  /// Sets the location of '('.
957
78
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
958
959
public:
960
  /// Build an AST node for a 'partial' clause.
961
  ///
962
  /// \param C         Context of the AST.
963
  /// \param StartLoc  Location of the 'partial' identifier.
964
  /// \param LParenLoc Location of '('.
965
  /// \param EndLoc    Location of ')'.
966
  /// \param Factor    Clause argument.
967
  static OMPPartialClause *Create(const ASTContext &C, SourceLocation StartLoc,
968
                                  SourceLocation LParenLoc,
969
                                  SourceLocation EndLoc, Expr *Factor);
970
971
  /// Build an empty 'partial' AST node for deserialization.
972
  ///
973
  /// \param C     Context of the AST.
974
  static OMPPartialClause *CreateEmpty(const ASTContext &C);
975
976
  /// Returns the location of '('.
977
20
  SourceLocation getLParenLoc() const { return LParenLoc; }
978
979
  /// Returns the argument of the clause or nullptr if not set.
980
104
  Expr *getFactor() const { return cast_or_null<Expr>(Factor); }
981
982
10
  child_range children() { return child_range(&Factor, &Factor + 1); }
983
0
  const_child_range children() const {
984
0
    return const_child_range(&Factor, &Factor + 1);
985
0
  }
986
987
0
  child_range used_children() {
988
0
    return child_range(child_iterator(), child_iterator());
989
0
  }
990
0
  const_child_range used_children() const {
991
0
    return const_child_range(const_child_iterator(), const_child_iterator());
992
0
  }
993
994
155
  static bool classof(const OMPClause *T) {
995
155
    return T->getClauseKind() == llvm::omp::OMPC_partial;
996
155
  }
997
};
998
999
/// This represents 'collapse' clause in the '#pragma omp ...'
1000
/// directive.
1001
///
1002
/// \code
1003
/// #pragma omp simd collapse(3)
1004
/// \endcode
1005
/// In this example directive '#pragma omp simd' has clause 'collapse'
1006
/// with single expression '3'.
1007
/// The parameter must be a constant positive integer expression, it specifies
1008
/// the number of nested loops that should be collapsed into a single iteration
1009
/// space.
1010
class OMPCollapseClause : public OMPClause {
1011
  friend class OMPClauseReader;
1012
1013
  /// Location of '('.
1014
  SourceLocation LParenLoc;
1015
1016
  /// Number of for-loops.
1017
  Stmt *NumForLoops = nullptr;
1018
1019
  /// Set the number of associated for-loops.
1020
401
  void setNumForLoops(Expr *Num) { NumForLoops = Num; }
1021
1022
public:
1023
  /// Build 'collapse' clause.
1024
  ///
1025
  /// \param Num Expression associated with this clause.
1026
  /// \param StartLoc Starting location of the clause.
1027
  /// \param LParenLoc Location of '('.
1028
  /// \param EndLoc Ending location of the clause.
1029
  OMPCollapseClause(Expr *Num, SourceLocation StartLoc,
1030
                    SourceLocation LParenLoc, SourceLocation EndLoc)
1031
      : OMPClause(llvm::omp::OMPC_collapse, StartLoc, EndLoc),
1032
5.43k
        LParenLoc(LParenLoc), NumForLoops(Num) {}
1033
1034
  /// Build an empty clause.
1035
  explicit OMPCollapseClause()
1036
      : OMPClause(llvm::omp::OMPC_collapse, SourceLocation(),
1037
401
                  SourceLocation()) {}
1038
1039
  /// Sets the location of '('.
1040
401
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1041
1042
  /// Returns the location of '('.
1043
3.32k
  SourceLocation getLParenLoc() const { return LParenLoc; }
1044
1045
  /// Return the number of associated for-loops.
1046
9.38k
  Expr *getNumForLoops() const { return cast_or_null<Expr>(NumForLoops); }
1047
1048
768
  child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); }
1049
1050
0
  const_child_range children() const {
1051
0
    return const_child_range(&NumForLoops, &NumForLoops + 1);
1052
0
  }
1053
1054
1.17k
  child_range used_children() {
1055
1.17k
    return child_range(child_iterator(), child_iterator());
1056
1.17k
  }
1057
0
  const_child_range used_children() const {
1058
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1059
0
  }
1060
1061
116k
  static bool classof(const OMPClause *T) {
1062
116k
    return T->getClauseKind() == llvm::omp::OMPC_collapse;
1063
116k
  }
1064
};
1065
1066
/// This represents 'default' clause in the '#pragma omp ...' directive.
1067
///
1068
/// \code
1069
/// #pragma omp parallel default(shared)
1070
/// \endcode
1071
/// In this example directive '#pragma omp parallel' has simple 'default'
1072
/// clause with kind 'shared'.
1073
class OMPDefaultClause : public OMPClause {
1074
  friend class OMPClauseReader;
1075
1076
  /// Location of '('.
1077
  SourceLocation LParenLoc;
1078
1079
  /// A kind of the 'default' clause.
1080
  llvm::omp::DefaultKind Kind = llvm::omp::OMP_DEFAULT_unknown;
1081
1082
  /// Start location of the kind in source code.
1083
  SourceLocation KindKwLoc;
1084
1085
  /// Set kind of the clauses.
1086
  ///
1087
  /// \param K Argument of clause.
1088
255
  void setDefaultKind(llvm::omp::DefaultKind K) { Kind = K; }
1089
1090
  /// Set argument location.
1091
  ///
1092
  /// \param KLoc Argument location.
1093
255
  void setDefaultKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
1094
1095
public:
1096
  /// Build 'default' clause with argument \a A ('none' or 'shared').
1097
  ///
1098
  /// \param A Argument of the clause ('none' or 'shared').
1099
  /// \param ALoc Starting location of the argument.
1100
  /// \param StartLoc Starting location of the clause.
1101
  /// \param LParenLoc Location of '('.
1102
  /// \param EndLoc Ending location of the clause.
1103
  OMPDefaultClause(llvm::omp::DefaultKind A, SourceLocation ALoc,
1104
                   SourceLocation StartLoc, SourceLocation LParenLoc,
1105
                   SourceLocation EndLoc)
1106
      : OMPClause(llvm::omp::OMPC_default, StartLoc, EndLoc),
1107
1.86k
        LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
1108
1109
  /// Build an empty clause.
1110
  OMPDefaultClause()
1111
255
      : OMPClause(llvm::omp::OMPC_default, SourceLocation(), SourceLocation()) {
1112
255
  }
1113
1114
  /// Sets the location of '('.
1115
255
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1116
1117
  /// Returns the location of '('.
1118
707
  SourceLocation getLParenLoc() const { return LParenLoc; }
1119
1120
  /// Returns kind of the clause.
1121
1.60k
  llvm::omp::DefaultKind getDefaultKind() const { return Kind; }
1122
1123
  /// Returns location of clause kind.
1124
707
  SourceLocation getDefaultKindKwLoc() const { return KindKwLoc; }
1125
1126
514
  child_range children() {
1127
514
    return child_range(child_iterator(), child_iterator());
1128
514
  }
1129
1130
0
  const_child_range children() const {
1131
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1132
0
  }
1133
1134
870
  child_range used_children() {
1135
870
    return child_range(child_iterator(), child_iterator());
1136
870
  }
1137
0
  const_child_range used_children() const {
1138
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1139
0
  }
1140
1141
626
  static bool classof(const OMPClause *T) {
1142
626
    return T->getClauseKind() == llvm::omp::OMPC_default;
1143
626
  }
1144
};
1145
1146
/// This represents 'proc_bind' clause in the '#pragma omp ...'
1147
/// directive.
1148
///
1149
/// \code
1150
/// #pragma omp parallel proc_bind(master)
1151
/// \endcode
1152
/// In this example directive '#pragma omp parallel' has simple 'proc_bind'
1153
/// clause with kind 'master'.
1154
class OMPProcBindClause : public OMPClause {
1155
  friend class OMPClauseReader;
1156
1157
  /// Location of '('.
1158
  SourceLocation LParenLoc;
1159
1160
  /// A kind of the 'proc_bind' clause.
1161
  llvm::omp::ProcBindKind Kind = llvm::omp::OMP_PROC_BIND_unknown;
1162
1163
  /// Start location of the kind in source code.
1164
  SourceLocation KindKwLoc;
1165
1166
  /// Set kind of the clause.
1167
  ///
1168
  /// \param K Kind of clause.
1169
106
  void setProcBindKind(llvm::omp::ProcBindKind K) { Kind = K; }
1170
1171
  /// Set clause kind location.
1172
  ///
1173
  /// \param KLoc Kind location.
1174
106
  void setProcBindKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
1175
1176
public:
1177
  /// Build 'proc_bind' clause with argument \a A ('master', 'close' or
1178
  ///        'spread').
1179
  ///
1180
  /// \param A Argument of the clause ('master', 'close' or 'spread').
1181
  /// \param ALoc Starting location of the argument.
1182
  /// \param StartLoc Starting location of the clause.
1183
  /// \param LParenLoc Location of '('.
1184
  /// \param EndLoc Ending location of the clause.
1185
  OMPProcBindClause(llvm::omp::ProcBindKind A, SourceLocation ALoc,
1186
                    SourceLocation StartLoc, SourceLocation LParenLoc,
1187
                    SourceLocation EndLoc)
1188
      : OMPClause(llvm::omp::OMPC_proc_bind, StartLoc, EndLoc),
1189
782
        LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
1190
1191
  /// Build an empty clause.
1192
  OMPProcBindClause()
1193
      : OMPClause(llvm::omp::OMPC_proc_bind, SourceLocation(),
1194
106
                  SourceLocation()) {}
1195
1196
  /// Sets the location of '('.
1197
106
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1198
1199
  /// Returns the location of '('.
1200
365
  SourceLocation getLParenLoc() const { return LParenLoc; }
1201
1202
  /// Returns kind of the clause.
1203
692
  llvm::omp::ProcBindKind getProcBindKind() const { return Kind; }
1204
1205
  /// Returns location of clause kind.
1206
365
  SourceLocation getProcBindKindKwLoc() const { return KindKwLoc; }
1207
1208
150
  child_range children() {
1209
150
    return child_range(child_iterator(), child_iterator());
1210
150
  }
1211
1212
0
  const_child_range children() const {
1213
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1214
0
  }
1215
1216
760
  child_range used_children() {
1217
760
    return child_range(child_iterator(), child_iterator());
1218
760
  }
1219
0
  const_child_range used_children() const {
1220
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1221
0
  }
1222
1223
8.10k
  static bool classof(const OMPClause *T) {
1224
8.10k
    return T->getClauseKind() == llvm::omp::OMPC_proc_bind;
1225
8.10k
  }
1226
};
1227
1228
/// This represents 'unified_address' clause in the '#pragma omp requires'
1229
/// directive.
1230
///
1231
/// \code
1232
/// #pragma omp requires unified_address
1233
/// \endcode
1234
/// In this example directive '#pragma omp requires' has 'unified_address'
1235
/// clause.
1236
class OMPUnifiedAddressClause final : public OMPClause {
1237
public:
1238
  friend class OMPClauseReader;
1239
  /// Build 'unified_address' clause.
1240
  ///
1241
  /// \param StartLoc Starting location of the clause.
1242
  /// \param EndLoc Ending location of the clause.
1243
  OMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc)
1244
14
      : OMPClause(llvm::omp::OMPC_unified_address, StartLoc, EndLoc) {}
1245
1246
  /// Build an empty clause.
1247
  OMPUnifiedAddressClause()
1248
      : OMPClause(llvm::omp::OMPC_unified_address, SourceLocation(),
1249
2
                  SourceLocation()) {}
1250
1251
0
  child_range children() {
1252
0
    return child_range(child_iterator(), child_iterator());
1253
0
  }
1254
1255
0
  const_child_range children() const {
1256
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1257
0
  }
1258
1259
0
  child_range used_children() {
1260
0
    return child_range(child_iterator(), child_iterator());
1261
0
  }
1262
0
  const_child_range used_children() const {
1263
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1264
0
  }
1265
1266
4.89k
  static bool classof(const OMPClause *T) {
1267
4.89k
    return T->getClauseKind() == llvm::omp::OMPC_unified_address;
1268
4.89k
  }
1269
};
1270
1271
/// This represents 'unified_shared_memory' clause in the '#pragma omp requires'
1272
/// directive.
1273
///
1274
/// \code
1275
/// #pragma omp requires unified_shared_memory
1276
/// \endcode
1277
/// In this example directive '#pragma omp requires' has 'unified_shared_memory'
1278
/// clause.
1279
class OMPUnifiedSharedMemoryClause final : public OMPClause {
1280
public:
1281
  friend class OMPClauseReader;
1282
  /// Build 'unified_shared_memory' clause.
1283
  ///
1284
  /// \param StartLoc Starting location of the clause.
1285
  /// \param EndLoc Ending location of the clause.
1286
  OMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc)
1287
31
      : OMPClause(llvm::omp::OMPC_unified_shared_memory, StartLoc, EndLoc) {}
1288
1289
  /// Build an empty clause.
1290
  OMPUnifiedSharedMemoryClause()
1291
      : OMPClause(llvm::omp::OMPC_unified_shared_memory, SourceLocation(),
1292
2
                  SourceLocation()) {}
1293
1294
0
  child_range children() {
1295
0
    return child_range(child_iterator(), child_iterator());
1296
0
  }
1297
1298
0
  const_child_range children() const {
1299
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1300
0
  }
1301
1302
0
  child_range used_children() {
1303
0
    return child_range(child_iterator(), child_iterator());
1304
0
  }
1305
0
  const_child_range used_children() const {
1306
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1307
0
  }
1308
1309
4.91k
  static bool classof(const OMPClause *T) {
1310
4.91k
    return T->getClauseKind() == llvm::omp::OMPC_unified_shared_memory;
1311
4.91k
  }
1312
};
1313
1314
/// This represents 'reverse_offload' clause in the '#pragma omp requires'
1315
/// directive.
1316
///
1317
/// \code
1318
/// #pragma omp requires reverse_offload
1319
/// \endcode
1320
/// In this example directive '#pragma omp requires' has 'reverse_offload'
1321
/// clause.
1322
class OMPReverseOffloadClause final : public OMPClause {
1323
public:
1324
  friend class OMPClauseReader;
1325
  /// Build 'reverse_offload' clause.
1326
  ///
1327
  /// \param StartLoc Starting location of the clause.
1328
  /// \param EndLoc Ending location of the clause.
1329
  OMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc)
1330
9
      : OMPClause(llvm::omp::OMPC_reverse_offload, StartLoc, EndLoc) {}
1331
1332
  /// Build an empty clause.
1333
  OMPReverseOffloadClause()
1334
      : OMPClause(llvm::omp::OMPC_reverse_offload, SourceLocation(),
1335
2
                  SourceLocation()) {}
1336
1337
0
  child_range children() {
1338
0
    return child_range(child_iterator(), child_iterator());
1339
0
  }
1340
1341
0
  const_child_range children() const {
1342
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1343
0
  }
1344
1345
0
  child_range used_children() {
1346
0
    return child_range(child_iterator(), child_iterator());
1347
0
  }
1348
0
  const_child_range used_children() const {
1349
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1350
0
  }
1351
1352
4.89k
  static bool classof(const OMPClause *T) {
1353
4.89k
    return T->getClauseKind() == llvm::omp::OMPC_reverse_offload;
1354
4.89k
  }
1355
};
1356
1357
/// This represents 'dynamic_allocators' clause in the '#pragma omp requires'
1358
/// directive.
1359
///
1360
/// \code
1361
/// #pragma omp requires dynamic_allocators
1362
/// \endcode
1363
/// In this example directive '#pragma omp requires' has 'dynamic_allocators'
1364
/// clause.
1365
class OMPDynamicAllocatorsClause final : public OMPClause {
1366
public:
1367
  friend class OMPClauseReader;
1368
  /// Build 'dynamic_allocators' clause.
1369
  ///
1370
  /// \param StartLoc Starting location of the clause.
1371
  /// \param EndLoc Ending location of the clause.
1372
  OMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc)
1373
91
      : OMPClause(llvm::omp::OMPC_dynamic_allocators, StartLoc, EndLoc) {}
1374
1375
  /// Build an empty clause.
1376
  OMPDynamicAllocatorsClause()
1377
      : OMPClause(llvm::omp::OMPC_dynamic_allocators, SourceLocation(),
1378
2
                  SourceLocation()) {}
1379
1380
0
  child_range children() {
1381
0
    return child_range(child_iterator(), child_iterator());
1382
0
  }
1383
1384
0
  const_child_range children() const {
1385
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1386
0
  }
1387
1388
0
  child_range used_children() {
1389
0
    return child_range(child_iterator(), child_iterator());
1390
0
  }
1391
0
  const_child_range used_children() const {
1392
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1393
0
  }
1394
1395
4.95k
  static bool classof(const OMPClause *T) {
1396
4.95k
    return T->getClauseKind() == llvm::omp::OMPC_dynamic_allocators;
1397
4.95k
  }
1398
};
1399
1400
/// This represents 'atomic_default_mem_order' clause in the '#pragma omp
1401
/// requires'  directive.
1402
///
1403
/// \code
1404
/// #pragma omp requires atomic_default_mem_order(seq_cst)
1405
/// \endcode
1406
/// In this example directive '#pragma omp requires' has simple
1407
/// atomic_default_mem_order' clause with kind 'seq_cst'.
1408
class OMPAtomicDefaultMemOrderClause final : public OMPClause {
1409
  friend class OMPClauseReader;
1410
1411
  /// Location of '('
1412
  SourceLocation LParenLoc;
1413
1414
  /// A kind of the 'atomic_default_mem_order' clause.
1415
  OpenMPAtomicDefaultMemOrderClauseKind Kind =
1416
      OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown;
1417
1418
  /// Start location of the kind in source code.
1419
  SourceLocation KindKwLoc;
1420
1421
  /// Set kind of the clause.
1422
  ///
1423
  /// \param K Kind of clause.
1424
12
  void setAtomicDefaultMemOrderKind(OpenMPAtomicDefaultMemOrderClauseKind K) {
1425
12
    Kind = K;
1426
12
  }
1427
1428
  /// Set clause kind location.
1429
  ///
1430
  /// \param KLoc Kind location.
1431
12
  void setAtomicDefaultMemOrderKindKwLoc(SourceLocation KLoc) {
1432
12
    KindKwLoc = KLoc;
1433
12
  }
1434
1435
public:
1436
  /// Build 'atomic_default_mem_order' clause with argument \a A ('seq_cst',
1437
  /// 'acq_rel' or 'relaxed').
1438
  ///
1439
  /// \param A Argument of the clause ('seq_cst', 'acq_rel' or 'relaxed').
1440
  /// \param ALoc Starting location of the argument.
1441
  /// \param StartLoc Starting location of the clause.
1442
  /// \param LParenLoc Location of '('.
1443
  /// \param EndLoc Ending location of the clause.
1444
  OMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind A,
1445
                                 SourceLocation ALoc, SourceLocation StartLoc,
1446
                                 SourceLocation LParenLoc,
1447
                                 SourceLocation EndLoc)
1448
      : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, StartLoc, EndLoc),
1449
35
        LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {}
1450
1451
  /// Build an empty clause.
1452
  OMPAtomicDefaultMemOrderClause()
1453
      : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, SourceLocation(),
1454
12
                  SourceLocation()) {}
1455
1456
  /// Sets the location of '('.
1457
12
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1458
1459
  /// Returns the locaiton of '('.
1460
12
  SourceLocation getLParenLoc() const { return LParenLoc; }
1461
1462
  /// Returns kind of the clause.
1463
36
  OpenMPAtomicDefaultMemOrderClauseKind getAtomicDefaultMemOrderKind() const {
1464
36
    return Kind;
1465
36
  }
1466
1467
  /// Returns location of clause kind.
1468
12
  SourceLocation getAtomicDefaultMemOrderKindKwLoc() const { return KindKwLoc; }
1469
1470
0
  child_range children() {
1471
0
    return child_range(child_iterator(), child_iterator());
1472
0
  }
1473
1474
0
  const_child_range children() const {
1475
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1476
0
  }
1477
1478
0
  child_range used_children() {
1479
0
    return child_range(child_iterator(), child_iterator());
1480
0
  }
1481
0
  const_child_range used_children() const {
1482
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1483
0
  }
1484
1485
27
  static bool classof(const OMPClause *T) {
1486
27
    return T->getClauseKind() == llvm::omp::OMPC_atomic_default_mem_order;
1487
27
  }
1488
};
1489
1490
/// This represents 'schedule' clause in the '#pragma omp ...' directive.
1491
///
1492
/// \code
1493
/// #pragma omp for schedule(static, 3)
1494
/// \endcode
1495
/// In this example directive '#pragma omp for' has 'schedule' clause with
1496
/// arguments 'static' and '3'.
1497
class OMPScheduleClause : public OMPClause, public OMPClauseWithPreInit {
1498
  friend class OMPClauseReader;
1499
1500
  /// Location of '('.
1501
  SourceLocation LParenLoc;
1502
1503
  /// A kind of the 'schedule' clause.
1504
  OpenMPScheduleClauseKind Kind = OMPC_SCHEDULE_unknown;
1505
1506
  /// Modifiers for 'schedule' clause.
1507
  enum {FIRST, SECOND, NUM_MODIFIERS};
1508
  OpenMPScheduleClauseModifier Modifiers[NUM_MODIFIERS];
1509
1510
  /// Locations of modifiers.
1511
  SourceLocation ModifiersLoc[NUM_MODIFIERS];
1512
1513
  /// Start location of the schedule ind in source code.
1514
  SourceLocation KindLoc;
1515
1516
  /// Location of ',' (if any).
1517
  SourceLocation CommaLoc;
1518
1519
  /// Chunk size.
1520
  Expr *ChunkSize = nullptr;
1521
1522
  /// Set schedule kind.
1523
  ///
1524
  /// \param K Schedule kind.
1525
596
  void setScheduleKind(OpenMPScheduleClauseKind K) { Kind = K; }
1526
1527
  /// Set the first schedule modifier.
1528
  ///
1529
  /// \param M Schedule modifier.
1530
596
  void setFirstScheduleModifier(OpenMPScheduleClauseModifier M) {
1531
596
    Modifiers[FIRST] = M;
1532
596
  }
1533
1534
  /// Set the second schedule modifier.
1535
  ///
1536
  /// \param M Schedule modifier.
1537
596
  void setSecondScheduleModifier(OpenMPScheduleClauseModifier M) {
1538
596
    Modifiers[SECOND] = M;
1539
596
  }
1540
1541
  /// Set location of the first schedule modifier.
1542
596
  void setFirstScheduleModifierLoc(SourceLocation Loc) {
1543
596
    ModifiersLoc[FIRST] = Loc;
1544
596
  }
1545
1546
  /// Set location of the second schedule modifier.
1547
596
  void setSecondScheduleModifierLoc(SourceLocation Loc) {
1548
596
    ModifiersLoc[SECOND] = Loc;
1549
596
  }
1550
1551
  /// Set schedule modifier location.
1552
  ///
1553
  /// \param M Schedule modifier location.
1554
0
  void setScheduleModifer(OpenMPScheduleClauseModifier M) {
1555
0
    if (Modifiers[FIRST] == OMPC_SCHEDULE_MODIFIER_unknown)
1556
0
      Modifiers[FIRST] = M;
1557
0
    else {
1558
0
      assert(Modifiers[SECOND] == OMPC_SCHEDULE_MODIFIER_unknown);
1559
0
      Modifiers[SECOND] = M;
1560
0
    }
1561
0
  }
1562
1563
  /// Sets the location of '('.
1564
  ///
1565
  /// \param Loc Location of '('.
1566
596
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1567
1568
  /// Set schedule kind start location.
1569
  ///
1570
  /// \param KLoc Schedule kind location.
1571
596
  void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
1572
1573
  /// Set location of ','.
1574
  ///
1575
  /// \param Loc Location of ','.
1576
596
  void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
1577
1578
  /// Set chunk size.
1579
  ///
1580
  /// \param E Chunk size.
1581
596
  void setChunkSize(Expr *E) { ChunkSize = E; }
1582
1583
public:
1584
  /// Build 'schedule' clause with schedule kind \a Kind and chunk size
1585
  /// expression \a ChunkSize.
1586
  ///
1587
  /// \param StartLoc Starting location of the clause.
1588
  /// \param LParenLoc Location of '('.
1589
  /// \param KLoc Starting location of the argument.
1590
  /// \param CommaLoc Location of ','.
1591
  /// \param EndLoc Ending location of the clause.
1592
  /// \param Kind Schedule kind.
1593
  /// \param ChunkSize Chunk size.
1594
  /// \param HelperChunkSize Helper chunk size for combined directives.
1595
  /// \param M1 The first modifier applied to 'schedule' clause.
1596
  /// \param M1Loc Location of the first modifier
1597
  /// \param M2 The second modifier applied to 'schedule' clause.
1598
  /// \param M2Loc Location of the second modifier
1599
  OMPScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1600
                    SourceLocation KLoc, SourceLocation CommaLoc,
1601
                    SourceLocation EndLoc, OpenMPScheduleClauseKind Kind,
1602
                    Expr *ChunkSize, Stmt *HelperChunkSize,
1603
                    OpenMPScheduleClauseModifier M1, SourceLocation M1Loc,
1604
                    OpenMPScheduleClauseModifier M2, SourceLocation M2Loc)
1605
      : OMPClause(llvm::omp::OMPC_schedule, StartLoc, EndLoc),
1606
        OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Kind(Kind),
1607
3.68k
        KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) {
1608
3.68k
    setPreInitStmt(HelperChunkSize);
1609
3.68k
    Modifiers[FIRST] = M1;
1610
3.68k
    Modifiers[SECOND] = M2;
1611
3.68k
    ModifiersLoc[FIRST] = M1Loc;
1612
3.68k
    ModifiersLoc[SECOND] = M2Loc;
1613
3.68k
  }
1614
1615
  /// Build an empty clause.
1616
  explicit OMPScheduleClause()
1617
      : OMPClause(llvm::omp::OMPC_schedule, SourceLocation(), SourceLocation()),
1618
596
        OMPClauseWithPreInit(this) {
1619
596
    Modifiers[FIRST] = OMPC_SCHEDULE_MODIFIER_unknown;
1620
596
    Modifiers[SECOND] = OMPC_SCHEDULE_MODIFIER_unknown;
1621
596
  }
1622
1623
  /// Get kind of the clause.
1624
3.68k
  OpenMPScheduleClauseKind getScheduleKind() const { return Kind; }
1625
1626
  /// Get the first modifier of the clause.
1627
7.26k
  OpenMPScheduleClauseModifier getFirstScheduleModifier() const {
1628
7.26k
    return Modifiers[FIRST];
1629
7.26k
  }
1630
1631
  /// Get the second modifier of the clause.
1632
6.73k
  OpenMPScheduleClauseModifier getSecondScheduleModifier() const {
1633
6.73k
    return Modifiers[SECOND];
1634
6.73k
  }
1635
1636
  /// Get location of '('.
1637
1.86k
  SourceLocation getLParenLoc() { return LParenLoc; }
1638
1639
  /// Get kind location.
1640
1.86k
  SourceLocation getScheduleKindLoc() { return KindLoc; }
1641
1642
  /// Get the first modifier location.
1643
1.87k
  SourceLocation getFirstScheduleModifierLoc() const {
1644
1.87k
    return ModifiersLoc[FIRST];
1645
1.87k
  }
1646
1647
  /// Get the second modifier location.
1648
1.86k
  SourceLocation getSecondScheduleModifierLoc() const {
1649
1.86k
    return ModifiersLoc[SECOND];
1650
1.86k
  }
1651
1652
  /// Get location of ','.
1653
1.86k
  SourceLocation getCommaLoc() { return CommaLoc; }
1654
1655
  /// Get chunk size.
1656
2.28k
  Expr *getChunkSize() { return ChunkSize; }
1657
1658
  /// Get chunk size.
1659
1.55k
  const Expr *getChunkSize() const { return ChunkSize; }
1660
1661
1.24k
  child_range children() {
1662
1.24k
    return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
1663
1.24k
                       reinterpret_cast<Stmt **>(&ChunkSize) + 1);
1664
1.24k
  }
1665
1666
0
  const_child_range children() const {
1667
0
    auto Children = const_cast<OMPScheduleClause *>(this)->children();
1668
0
    return const_child_range(Children.begin(), Children.end());
1669
0
  }
1670
1671
2.24k
  child_range used_children() {
1672
2.24k
    return child_range(child_iterator(), child_iterator());
1673
2.24k
  }
1674
0
  const_child_range used_children() const {
1675
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1676
0
  }
1677
1678
13.0k
  static bool classof(const OMPClause *T) {
1679
13.0k
    return T->getClauseKind() == llvm::omp::OMPC_schedule;
1680
13.0k
  }
1681
};
1682
1683
/// This represents 'ordered' clause in the '#pragma omp ...' directive.
1684
///
1685
/// \code
1686
/// #pragma omp for ordered (2)
1687
/// \endcode
1688
/// In this example directive '#pragma omp for' has 'ordered' clause with
1689
/// parameter 2.
1690
class OMPOrderedClause final
1691
    : public OMPClause,
1692
      private llvm::TrailingObjects<OMPOrderedClause, Expr *> {
1693
  friend class OMPClauseReader;
1694
  friend TrailingObjects;
1695
1696
  /// Location of '('.
1697
  SourceLocation LParenLoc;
1698
1699
  /// Number of for-loops.
1700
  Stmt *NumForLoops = nullptr;
1701
1702
  /// Real number of loops.
1703
  unsigned NumberOfLoops = 0;
1704
1705
  /// Build 'ordered' clause.
1706
  ///
1707
  /// \param Num Expression, possibly associated with this clause.
1708
  /// \param NumLoops Number of loops, associated with this clause.
1709
  /// \param StartLoc Starting location of the clause.
1710
  /// \param LParenLoc Location of '('.
1711
  /// \param EndLoc Ending location of the clause.
1712
  OMPOrderedClause(Expr *Num, unsigned NumLoops, SourceLocation StartLoc,
1713
                   SourceLocation LParenLoc, SourceLocation EndLoc)
1714
      : OMPClause(llvm::omp::OMPC_ordered, StartLoc, EndLoc),
1715
1.18k
        LParenLoc(LParenLoc), NumForLoops(Num), NumberOfLoops(NumLoops) {}
1716
1717
  /// Build an empty clause.
1718
  explicit OMPOrderedClause(unsigned NumLoops)
1719
      : OMPClause(llvm::omp::OMPC_ordered, SourceLocation(), SourceLocation()),
1720
89
        NumberOfLoops(NumLoops) {}
1721
1722
  /// Set the number of associated for-loops.
1723
89
  void setNumForLoops(Expr *Num) { NumForLoops = Num; }
1724
1725
public:
1726
  /// Build 'ordered' clause.
1727
  ///
1728
  /// \param Num Expression, possibly associated with this clause.
1729
  /// \param NumLoops Number of loops, associated with this clause.
1730
  /// \param StartLoc Starting location of the clause.
1731
  /// \param LParenLoc Location of '('.
1732
  /// \param EndLoc Ending location of the clause.
1733
  static OMPOrderedClause *Create(const ASTContext &C, Expr *Num,
1734
                                  unsigned NumLoops, SourceLocation StartLoc,
1735
                                  SourceLocation LParenLoc,
1736
                                  SourceLocation EndLoc);
1737
1738
  /// Build an empty clause.
1739
  static OMPOrderedClause* CreateEmpty(const ASTContext &C, unsigned NumLoops);
1740
1741
  /// Sets the location of '('.
1742
89
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
1743
1744
  /// Returns the location of '('.
1745
589
  SourceLocation getLParenLoc() const { return LParenLoc; }
1746
1747
  /// Return the number of associated for-loops.
1748
3.21k
  Expr *getNumForLoops() const { return cast_or_null<Expr>(NumForLoops); }
1749
1750
  /// Set number of iterations for the specified loop.
1751
  void setLoopNumIterations(unsigned NumLoop, Expr *NumIterations);
1752
  /// Get number of iterations for all the loops.
1753
  ArrayRef<Expr *> getLoopNumIterations() const;
1754
1755
  /// Set loop counter for the specified loop.
1756
  void setLoopCounter(unsigned NumLoop, Expr *Counter);
1757
  /// Get loops counter for the specified loop.
1758
  Expr *getLoopCounter(unsigned NumLoop);
1759
  const Expr *getLoopCounter(unsigned NumLoop) const;
1760
1761
60
  child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); }
1762
1763
0
  const_child_range children() const {
1764
0
    return const_child_range(&NumForLoops, &NumForLoops + 1);
1765
0
  }
1766
1767
204
  child_range used_children() {
1768
204
    return child_range(child_iterator(), child_iterator());
1769
204
  }
1770
0
  const_child_range used_children() const {
1771
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1772
0
  }
1773
1774
83.8k
  static bool classof(const OMPClause *T) {
1775
83.8k
    return T->getClauseKind() == llvm::omp::OMPC_ordered;
1776
83.8k
  }
1777
};
1778
1779
/// This represents 'nowait' clause in the '#pragma omp ...' directive.
1780
///
1781
/// \code
1782
/// #pragma omp for nowait
1783
/// \endcode
1784
/// In this example directive '#pragma omp for' has 'nowait' clause.
1785
class OMPNowaitClause : public OMPClause {
1786
public:
1787
  /// Build 'nowait' clause.
1788
  ///
1789
  /// \param StartLoc Starting location of the clause.
1790
  /// \param EndLoc Ending location of the clause.
1791
  OMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc)
1792
1.52k
      : OMPClause(llvm::omp::OMPC_nowait, StartLoc, EndLoc) {}
1793
1794
  /// Build an empty clause.
1795
  OMPNowaitClause()
1796
595
      : OMPClause(llvm::omp::OMPC_nowait, SourceLocation(), SourceLocation()) {}
1797
1798
64
  child_range children() {
1799
64
    return child_range(child_iterator(), child_iterator());
1800
64
  }
1801
1802
0
  const_child_range children() const {
1803
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1804
0
  }
1805
1806
3.40k
  child_range used_children() {
1807
3.40k
    return child_range(child_iterator(), child_iterator());
1808
3.40k
  }
1809
0
  const_child_range used_children() const {
1810
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1811
0
  }
1812
1813
30.1k
  static bool classof(const OMPClause *T) {
1814
30.1k
    return T->getClauseKind() == llvm::omp::OMPC_nowait;
1815
30.1k
  }
1816
};
1817
1818
/// This represents 'untied' clause in the '#pragma omp ...' directive.
1819
///
1820
/// \code
1821
/// #pragma omp task untied
1822
/// \endcode
1823
/// In this example directive '#pragma omp task' has 'untied' clause.
1824
class OMPUntiedClause : public OMPClause {
1825
public:
1826
  /// Build 'untied' clause.
1827
  ///
1828
  /// \param StartLoc Starting location of the clause.
1829
  /// \param EndLoc Ending location of the clause.
1830
  OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
1831
92
      : OMPClause(llvm::omp::OMPC_untied, StartLoc, EndLoc) {}
1832
1833
  /// Build an empty clause.
1834
  OMPUntiedClause()
1835
34
      : OMPClause(llvm::omp::OMPC_untied, SourceLocation(), SourceLocation()) {}
1836
1837
72
  child_range children() {
1838
72
    return child_range(child_iterator(), child_iterator());
1839
72
  }
1840
1841
0
  const_child_range children() const {
1842
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1843
0
  }
1844
1845
312
  child_range used_children() {
1846
312
    return child_range(child_iterator(), child_iterator());
1847
312
  }
1848
0
  const_child_range used_children() const {
1849
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1850
0
  }
1851
1852
347
  static bool classof(const OMPClause *T) {
1853
347
    return T->getClauseKind() == llvm::omp::OMPC_untied;
1854
347
  }
1855
};
1856
1857
/// This represents 'mergeable' clause in the '#pragma omp ...'
1858
/// directive.
1859
///
1860
/// \code
1861
/// #pragma omp task mergeable
1862
/// \endcode
1863
/// In this example directive '#pragma omp task' has 'mergeable' clause.
1864
class OMPMergeableClause : public OMPClause {
1865
public:
1866
  /// Build 'mergeable' clause.
1867
  ///
1868
  /// \param StartLoc Starting location of the clause.
1869
  /// \param EndLoc Ending location of the clause.
1870
  OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
1871
128
      : OMPClause(llvm::omp::OMPC_mergeable, StartLoc, EndLoc) {}
1872
1873
  /// Build an empty clause.
1874
  OMPMergeableClause()
1875
      : OMPClause(llvm::omp::OMPC_mergeable, SourceLocation(),
1876
40
                  SourceLocation()) {}
1877
1878
122
  child_range children() {
1879
122
    return child_range(child_iterator(), child_iterator());
1880
122
  }
1881
1882
0
  const_child_range children() const {
1883
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1884
0
  }
1885
1886
328
  child_range used_children() {
1887
328
    return child_range(child_iterator(), child_iterator());
1888
328
  }
1889
0
  const_child_range used_children() const {
1890
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1891
0
  }
1892
1893
100
  static bool classof(const OMPClause *T) {
1894
100
    return T->getClauseKind() == llvm::omp::OMPC_mergeable;
1895
100
  }
1896
};
1897
1898
/// This represents 'read' clause in the '#pragma omp atomic' directive.
1899
///
1900
/// \code
1901
/// #pragma omp atomic read
1902
/// \endcode
1903
/// In this example directive '#pragma omp atomic' has 'read' clause.
1904
class OMPReadClause : public OMPClause {
1905
public:
1906
  /// Build 'read' clause.
1907
  ///
1908
  /// \param StartLoc Starting location of the clause.
1909
  /// \param EndLoc Ending location of the clause.
1910
  OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
1911
405
      : OMPClause(llvm::omp::OMPC_read, StartLoc, EndLoc) {}
1912
1913
  /// Build an empty clause.
1914
  OMPReadClause()
1915
128
      : OMPClause(llvm::omp::OMPC_read, SourceLocation(), SourceLocation()) {}
1916
1917
16
  child_range children() {
1918
16
    return child_range(child_iterator(), child_iterator());
1919
16
  }
1920
1921
0
  const_child_range children() const {
1922
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1923
0
  }
1924
1925
92
  child_range used_children() {
1926
92
    return child_range(child_iterator(), child_iterator());
1927
92
  }
1928
0
  const_child_range used_children() const {
1929
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1930
0
  }
1931
1932
72
  static bool classof(const OMPClause *T) {
1933
72
    return T->getClauseKind() == llvm::omp::OMPC_read;
1934
72
  }
1935
};
1936
1937
/// This represents 'write' clause in the '#pragma omp atomic' directive.
1938
///
1939
/// \code
1940
/// #pragma omp atomic write
1941
/// \endcode
1942
/// In this example directive '#pragma omp atomic' has 'write' clause.
1943
class OMPWriteClause : public OMPClause {
1944
public:
1945
  /// Build 'write' clause.
1946
  ///
1947
  /// \param StartLoc Starting location of the clause.
1948
  /// \param EndLoc Ending location of the clause.
1949
  OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
1950
400
      : OMPClause(llvm::omp::OMPC_write, StartLoc, EndLoc) {}
1951
1952
  /// Build an empty clause.
1953
  OMPWriteClause()
1954
130
      : OMPClause(llvm::omp::OMPC_write, SourceLocation(), SourceLocation()) {}
1955
1956
16
  child_range children() {
1957
16
    return child_range(child_iterator(), child_iterator());
1958
16
  }
1959
1960
0
  const_child_range children() const {
1961
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1962
0
  }
1963
1964
56
  child_range used_children() {
1965
56
    return child_range(child_iterator(), child_iterator());
1966
56
  }
1967
0
  const_child_range used_children() const {
1968
0
    return const_child_range(const_child_iterator(), const_child_iterator());
1969
0
  }
1970
1971
52
  static bool classof(const OMPClause *T) {
1972
52
    return T->getClauseKind() == llvm::omp::OMPC_write;
1973
52
  }
1974
};
1975
1976
/// This represents 'update' clause in the '#pragma omp atomic'
1977
/// directive.
1978
///
1979
/// \code
1980
/// #pragma omp atomic update
1981
/// \endcode
1982
/// In this example directive '#pragma omp atomic' has 'update' clause.
1983
/// Also, this class represents 'update' clause in  '#pragma omp depobj'
1984
/// directive.
1985
///
1986
/// \code
1987
/// #pragma omp depobj(a) update(in)
1988
/// \endcode
1989
/// In this example directive '#pragma omp depobj' has 'update' clause with 'in'
1990
/// dependence kind.
1991
class OMPUpdateClause final
1992
    : public OMPClause,
1993
      private llvm::TrailingObjects<OMPUpdateClause, SourceLocation,
1994
                                    OpenMPDependClauseKind> {
1995
  friend class OMPClauseReader;
1996
  friend TrailingObjects;
1997
1998
  /// true if extended version of the clause for 'depobj' directive.
1999
  bool IsExtended = false;
2000
2001
  /// Define the sizes of each trailing object array except the last one. This
2002
  /// is required for TrailingObjects to work properly.
2003
60
  size_t numTrailingObjects(OverloadToken<SourceLocation>) const {
2004
    // 2 locations: for '(' and argument location.
2005
60
    return IsExtended ? 2 : 
00
;
2006
60
  }
2007
2008
  /// Sets the location of '(' in clause for 'depobj' directive.
2009
36
  void setLParenLoc(SourceLocation Loc) {
2010
36
    assert(IsExtended && "Expected extended clause.");
2011
0
    *getTrailingObjects<SourceLocation>() = Loc;
2012
36
  }
2013
2014
  /// Sets the location of '(' in clause for 'depobj' directive.
2015
36
  void setArgumentLoc(SourceLocation Loc) {
2016
36
    assert(IsExtended && "Expected extended clause.");
2017
0
    *std::next(getTrailingObjects<SourceLocation>(), 1) = Loc;
2018
36
  }
2019
2020
  /// Sets the dependence kind for the clause for 'depobj' directive.
2021
36
  void setDependencyKind(OpenMPDependClauseKind DK) {
2022
36
    assert(IsExtended && "Expected extended clause.");
2023
0
    *getTrailingObjects<OpenMPDependClauseKind>() = DK;
2024
36
  }
2025
2026
  /// Build 'update' clause.
2027
  ///
2028
  /// \param StartLoc Starting location of the clause.
2029
  /// \param EndLoc Ending location of the clause.
2030
  OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc,
2031
                  bool IsExtended)
2032
      : OMPClause(llvm::omp::OMPC_update, StartLoc, EndLoc),
2033
453
        IsExtended(IsExtended) {}
2034
2035
  /// Build an empty clause.
2036
  OMPUpdateClause(bool IsExtended)
2037
      : OMPClause(llvm::omp::OMPC_update, SourceLocation(), SourceLocation()),
2038
88
        IsExtended(IsExtended) {}
2039
2040
public:
2041
  /// Creates clause for 'atomic' directive.
2042
  ///
2043
  /// \param C AST context.
2044
  /// \param StartLoc Starting location of the clause.
2045
  /// \param EndLoc Ending location of the clause.
2046
  static OMPUpdateClause *Create(const ASTContext &C, SourceLocation StartLoc,
2047
                                 SourceLocation EndLoc);
2048
2049
  /// Creates clause for 'depobj' directive.
2050
  ///
2051
  /// \param C AST context.
2052
  /// \param StartLoc Starting location of the clause.
2053
  /// \param LParenLoc Location of '('.
2054
  /// \param ArgumentLoc Location of the argument.
2055
  /// \param DK Dependence kind.
2056
  /// \param EndLoc Ending location of the clause.
2057
  static OMPUpdateClause *Create(const ASTContext &C, SourceLocation StartLoc,
2058
                                 SourceLocation LParenLoc,
2059
                                 SourceLocation ArgumentLoc,
2060
                                 OpenMPDependClauseKind DK,
2061
                                 SourceLocation EndLoc);
2062
2063
  /// Creates an empty clause with the place for \a N variables.
2064
  ///
2065
  /// \param C AST context.
2066
  /// \param IsExtended true if extended clause for 'depobj' directive must be
2067
  /// created.
2068
  static OMPUpdateClause *CreateEmpty(const ASTContext &C, bool IsExtended);
2069
2070
  /// Checks if the clause is the extended clauses for 'depobj' directive.
2071
360
  bool isExtended() const { return IsExtended; }
2072
2073
8
  child_range children() {
2074
8
    return child_range(child_iterator(), child_iterator());
2075
8
  }
2076
2077
0
  const_child_range children() const {
2078
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2079
0
  }
2080
2081
72
  child_range used_children() {
2082
72
    return child_range(child_iterator(), child_iterator());
2083
72
  }
2084
0
  const_child_range used_children() const {
2085
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2086
0
  }
2087
2088
  /// Gets the location of '(' in clause for 'depobj' directive.
2089
8
  SourceLocation getLParenLoc() const {
2090
8
    assert(IsExtended && "Expected extended clause.");
2091
0
    return *getTrailingObjects<SourceLocation>();
2092
8
  }
2093
2094
  /// Gets the location of argument in clause for 'depobj' directive.
2095
8
  SourceLocation getArgumentLoc() const {
2096
8
    assert(IsExtended && "Expected extended clause.");
2097
0
    return *std::next(getTrailingObjects<SourceLocation>(), 1);
2098
8
  }
2099
2100
  /// Gets the dependence kind in clause for 'depobj' directive.
2101
24
  OpenMPDependClauseKind getDependencyKind() const {
2102
24
    assert(IsExtended && "Expected extended clause.");
2103
0
    return *getTrailingObjects<OpenMPDependClauseKind>();
2104
24
  }
2105
2106
102
  static bool classof(const OMPClause *T) {
2107
102
    return T->getClauseKind() == llvm::omp::OMPC_update;
2108
102
  }
2109
};
2110
2111
/// This represents 'capture' clause in the '#pragma omp atomic'
2112
/// directive.
2113
///
2114
/// \code
2115
/// #pragma omp atomic capture
2116
/// \endcode
2117
/// In this example directive '#pragma omp atomic' has 'capture' clause.
2118
class OMPCaptureClause : public OMPClause {
2119
public:
2120
  /// Build 'capture' clause.
2121
  ///
2122
  /// \param StartLoc Starting location of the clause.
2123
  /// \param EndLoc Ending location of the clause.
2124
  OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
2125
1.36k
      : OMPClause(llvm::omp::OMPC_capture, StartLoc, EndLoc) {}
2126
2127
  /// Build an empty clause.
2128
  OMPCaptureClause()
2129
254
      : OMPClause(llvm::omp::OMPC_capture, SourceLocation(), SourceLocation()) {
2130
254
  }
2131
2132
16
  child_range children() {
2133
16
    return child_range(child_iterator(), child_iterator());
2134
16
  }
2135
2136
0
  const_child_range children() const {
2137
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2138
0
  }
2139
2140
880
  child_range used_children() {
2141
880
    return child_range(child_iterator(), child_iterator());
2142
880
  }
2143
0
  const_child_range used_children() const {
2144
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2145
0
  }
2146
2147
288
  static bool classof(const OMPClause *T) {
2148
288
    return T->getClauseKind() == llvm::omp::OMPC_capture;
2149
288
  }
2150
};
2151
2152
/// This represents 'seq_cst' clause in the '#pragma omp atomic'
2153
/// directive.
2154
///
2155
/// \code
2156
/// #pragma omp atomic seq_cst
2157
/// \endcode
2158
/// In this example directive '#pragma omp atomic' has 'seq_cst' clause.
2159
class OMPSeqCstClause : public OMPClause {
2160
public:
2161
  /// Build 'seq_cst' clause.
2162
  ///
2163
  /// \param StartLoc Starting location of the clause.
2164
  /// \param EndLoc Ending location of the clause.
2165
  OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
2166
192
      : OMPClause(llvm::omp::OMPC_seq_cst, StartLoc, EndLoc) {}
2167
2168
  /// Build an empty clause.
2169
  OMPSeqCstClause()
2170
64
      : OMPClause(llvm::omp::OMPC_seq_cst, SourceLocation(), SourceLocation()) {
2171
64
  }
2172
2173
0
  child_range children() {
2174
0
    return child_range(child_iterator(), child_iterator());
2175
0
  }
2176
2177
0
  const_child_range children() const {
2178
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2179
0
  }
2180
2181
112
  child_range used_children() {
2182
112
    return child_range(child_iterator(), child_iterator());
2183
112
  }
2184
0
  const_child_range used_children() const {
2185
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2186
0
  }
2187
2188
648
  static bool classof(const OMPClause *T) {
2189
648
    return T->getClauseKind() == llvm::omp::OMPC_seq_cst;
2190
648
  }
2191
};
2192
2193
/// This represents 'acq_rel' clause in the '#pragma omp atomic|flush'
2194
/// directives.
2195
///
2196
/// \code
2197
/// #pragma omp flush acq_rel
2198
/// \endcode
2199
/// In this example directive '#pragma omp flush' has 'acq_rel' clause.
2200
class OMPAcqRelClause final : public OMPClause {
2201
public:
2202
  /// Build 'ack_rel' clause.
2203
  ///
2204
  /// \param StartLoc Starting location of the clause.
2205
  /// \param EndLoc Ending location of the clause.
2206
  OMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc)
2207
64
      : OMPClause(llvm::omp::OMPC_acq_rel, StartLoc, EndLoc) {}
2208
2209
  /// Build an empty clause.
2210
  OMPAcqRelClause()
2211
22
      : OMPClause(llvm::omp::OMPC_acq_rel, SourceLocation(), SourceLocation()) {
2212
22
  }
2213
2214
0
  child_range children() {
2215
0
    return child_range(child_iterator(), child_iterator());
2216
0
  }
2217
2218
0
  const_child_range children() const {
2219
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2220
0
  }
2221
2222
60
  child_range used_children() {
2223
60
    return child_range(child_iterator(), child_iterator());
2224
60
  }
2225
0
  const_child_range used_children() const {
2226
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2227
0
  }
2228
2229
516
  static bool classof(const OMPClause *T) {
2230
516
    return T->getClauseKind() == llvm::omp::OMPC_acq_rel;
2231
516
  }
2232
};
2233
2234
/// This represents 'acquire' clause in the '#pragma omp atomic|flush'
2235
/// directives.
2236
///
2237
/// \code
2238
/// #pragma omp flush acquire
2239
/// \endcode
2240
/// In this example directive '#pragma omp flush' has 'acquire' clause.
2241
class OMPAcquireClause final : public OMPClause {
2242
public:
2243
  /// Build 'acquire' clause.
2244
  ///
2245
  /// \param StartLoc Starting location of the clause.
2246
  /// \param EndLoc Ending location of the clause.
2247
  OMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc)
2248
74
      : OMPClause(llvm::omp::OMPC_acquire, StartLoc, EndLoc) {}
2249
2250
  /// Build an empty clause.
2251
  OMPAcquireClause()
2252
28
      : OMPClause(llvm::omp::OMPC_acquire, SourceLocation(), SourceLocation()) {
2253
28
  }
2254
2255
0
  child_range children() {
2256
0
    return child_range(child_iterator(), child_iterator());
2257
0
  }
2258
2259
0
  const_child_range children() const {
2260
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2261
0
  }
2262
2263
68
  child_range used_children() {
2264
68
    return child_range(child_iterator(), child_iterator());
2265
68
  }
2266
0
  const_child_range used_children() const {
2267
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2268
0
  }
2269
2270
514
  static bool classof(const OMPClause *T) {
2271
514
    return T->getClauseKind() == llvm::omp::OMPC_acquire;
2272
514
  }
2273
};
2274
2275
/// This represents 'release' clause in the '#pragma omp atomic|flush'
2276
/// directives.
2277
///
2278
/// \code
2279
/// #pragma omp flush release
2280
/// \endcode
2281
/// In this example directive '#pragma omp flush' has 'release' clause.
2282
class OMPReleaseClause final : public OMPClause {
2283
public:
2284
  /// Build 'release' clause.
2285
  ///
2286
  /// \param StartLoc Starting location of the clause.
2287
  /// \param EndLoc Ending location of the clause.
2288
  OMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc)
2289
92
      : OMPClause(llvm::omp::OMPC_release, StartLoc, EndLoc) {}
2290
2291
  /// Build an empty clause.
2292
  OMPReleaseClause()
2293
38
      : OMPClause(llvm::omp::OMPC_release, SourceLocation(), SourceLocation()) {
2294
38
  }
2295
2296
0
  child_range children() {
2297
0
    return child_range(child_iterator(), child_iterator());
2298
0
  }
2299
2300
0
  const_child_range children() const {
2301
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2302
0
  }
2303
2304
84
  child_range used_children() {
2305
84
    return child_range(child_iterator(), child_iterator());
2306
84
  }
2307
0
  const_child_range used_children() const {
2308
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2309
0
  }
2310
2311
512
  static bool classof(const OMPClause *T) {
2312
512
    return T->getClauseKind() == llvm::omp::OMPC_release;
2313
512
  }
2314
};
2315
2316
/// This represents 'relaxed' clause in the '#pragma omp atomic'
2317
/// directives.
2318
///
2319
/// \code
2320
/// #pragma omp atomic relaxed
2321
/// \endcode
2322
/// In this example directive '#pragma omp atomic' has 'relaxed' clause.
2323
class OMPRelaxedClause final : public OMPClause {
2324
public:
2325
  /// Build 'relaxed' clause.
2326
  ///
2327
  /// \param StartLoc Starting location of the clause.
2328
  /// \param EndLoc Ending location of the clause.
2329
  OMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc)
2330
96
      : OMPClause(llvm::omp::OMPC_relaxed, StartLoc, EndLoc) {}
2331
2332
  /// Build an empty clause.
2333
  OMPRelaxedClause()
2334
42
      : OMPClause(llvm::omp::OMPC_relaxed, SourceLocation(), SourceLocation()) {
2335
42
  }
2336
2337
0
  child_range children() {
2338
0
    return child_range(child_iterator(), child_iterator());
2339
0
  }
2340
2341
0
  const_child_range children() const {
2342
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2343
0
  }
2344
2345
72
  child_range used_children() {
2346
72
    return child_range(child_iterator(), child_iterator());
2347
72
  }
2348
0
  const_child_range used_children() const {
2349
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2350
0
  }
2351
2352
496
  static bool classof(const OMPClause *T) {
2353
496
    return T->getClauseKind() == llvm::omp::OMPC_relaxed;
2354
496
  }
2355
};
2356
2357
/// This represents clause 'private' in the '#pragma omp ...' directives.
2358
///
2359
/// \code
2360
/// #pragma omp parallel private(a,b)
2361
/// \endcode
2362
/// In this example directive '#pragma omp parallel' has clause 'private'
2363
/// with the variables 'a' and 'b'.
2364
class OMPPrivateClause final
2365
    : public OMPVarListClause<OMPPrivateClause>,
2366
      private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
2367
  friend class OMPClauseReader;
2368
  friend OMPVarListClause;
2369
  friend TrailingObjects;
2370
2371
  /// Build clause with number of variables \a N.
2372
  ///
2373
  /// \param StartLoc Starting location of the clause.
2374
  /// \param LParenLoc Location of '('.
2375
  /// \param EndLoc Ending location of the clause.
2376
  /// \param N Number of the variables in the clause.
2377
  OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2378
                   SourceLocation EndLoc, unsigned N)
2379
      : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private, StartLoc,
2380
12.9k
                                           LParenLoc, EndLoc, N) {}
2381
2382
  /// Build an empty clause.
2383
  ///
2384
  /// \param N Number of variables.
2385
  explicit OMPPrivateClause(unsigned N)
2386
      : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private,
2387
                                           SourceLocation(), SourceLocation(),
2388
1.38k
                                           SourceLocation(), N) {}
2389
2390
  /// Sets the list of references to private copies with initializers for
2391
  /// new private variables.
2392
  /// \param VL List of references.
2393
  void setPrivateCopies(ArrayRef<Expr *> VL);
2394
2395
  /// Gets the list of references to private copies with initializers for
2396
  /// new private variables.
2397
19.0k
  MutableArrayRef<Expr *> getPrivateCopies() {
2398
19.0k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2399
19.0k
  }
2400
3.72k
  ArrayRef<const Expr *> getPrivateCopies() const {
2401
3.72k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2402
3.72k
  }
2403
2404
public:
2405
  /// Creates clause with a list of variables \a VL.
2406
  ///
2407
  /// \param C AST context.
2408
  /// \param StartLoc Starting location of the clause.
2409
  /// \param LParenLoc Location of '('.
2410
  /// \param EndLoc Ending location of the clause.
2411
  /// \param VL List of references to the variables.
2412
  /// \param PrivateVL List of references to private copies with initializers.
2413
  static OMPPrivateClause *Create(const ASTContext &C, SourceLocation StartLoc,
2414
                                  SourceLocation LParenLoc,
2415
                                  SourceLocation EndLoc, ArrayRef<Expr *> VL,
2416
                                  ArrayRef<Expr *> PrivateVL);
2417
2418
  /// Creates an empty clause with the place for \a N variables.
2419
  ///
2420
  /// \param C AST context.
2421
  /// \param N The number of variables.
2422
  static OMPPrivateClause *CreateEmpty(const ASTContext &C, unsigned N);
2423
2424
  using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
2425
  using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
2426
  using private_copies_range = llvm::iterator_range<private_copies_iterator>;
2427
  using private_copies_const_range =
2428
      llvm::iterator_range<private_copies_const_iterator>;
2429
2430
9.50k
  private_copies_range private_copies() {
2431
9.50k
    return private_copies_range(getPrivateCopies().begin(),
2432
9.50k
                                getPrivateCopies().end());
2433
9.50k
  }
2434
2435
1.86k
  private_copies_const_range private_copies() const {
2436
1.86k
    return private_copies_const_range(getPrivateCopies().begin(),
2437
1.86k
                                      getPrivateCopies().end());
2438
1.86k
  }
2439
2440
15.6k
  child_range children() {
2441
15.6k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2442
15.6k
                       reinterpret_cast<Stmt **>(varlist_end()));
2443
15.6k
  }
2444
2445
0
  const_child_range children() const {
2446
0
    auto Children = const_cast<OMPPrivateClause *>(this)->children();
2447
0
    return const_child_range(Children.begin(), Children.end());
2448
0
  }
2449
2450
2.30k
  child_range used_children() {
2451
2.30k
    return child_range(child_iterator(), child_iterator());
2452
2.30k
  }
2453
0
  const_child_range used_children() const {
2454
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2455
0
  }
2456
2457
105k
  static bool classof(const OMPClause *T) {
2458
105k
    return T->getClauseKind() == llvm::omp::OMPC_private;
2459
105k
  }
2460
};
2461
2462
/// This represents clause 'firstprivate' in the '#pragma omp ...'
2463
/// directives.
2464
///
2465
/// \code
2466
/// #pragma omp parallel firstprivate(a,b)
2467
/// \endcode
2468
/// In this example directive '#pragma omp parallel' has clause 'firstprivate'
2469
/// with the variables 'a' and 'b'.
2470
class OMPFirstprivateClause final
2471
    : public OMPVarListClause<OMPFirstprivateClause>,
2472
      public OMPClauseWithPreInit,
2473
      private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
2474
  friend class OMPClauseReader;
2475
  friend OMPVarListClause;
2476
  friend TrailingObjects;
2477
2478
  /// Build clause with number of variables \a N.
2479
  ///
2480
  /// \param StartLoc Starting location of the clause.
2481
  /// \param LParenLoc Location of '('.
2482
  /// \param EndLoc Ending location of the clause.
2483
  /// \param N Number of the variables in the clause.
2484
  OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2485
                        SourceLocation EndLoc, unsigned N)
2486
      : OMPVarListClause<OMPFirstprivateClause>(llvm::omp::OMPC_firstprivate,
2487
                                                StartLoc, LParenLoc, EndLoc, N),
2488
50.2k
        OMPClauseWithPreInit(this) {}
2489
2490
  /// Build an empty clause.
2491
  ///
2492
  /// \param N Number of variables.
2493
  explicit OMPFirstprivateClause(unsigned N)
2494
      : OMPVarListClause<OMPFirstprivateClause>(
2495
            llvm::omp::OMPC_firstprivate, SourceLocation(), SourceLocation(),
2496
            SourceLocation(), N),
2497
4.23k
        OMPClauseWithPreInit(this) {}
2498
2499
  /// Sets the list of references to private copies with initializers for
2500
  /// new private variables.
2501
  /// \param VL List of references.
2502
  void setPrivateCopies(ArrayRef<Expr *> VL);
2503
2504
  /// Gets the list of references to private copies with initializers for
2505
  /// new private variables.
2506
166k
  MutableArrayRef<Expr *> getPrivateCopies() {
2507
166k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2508
166k
  }
2509
44.4k
  ArrayRef<const Expr *> getPrivateCopies() const {
2510
44.4k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2511
44.4k
  }
2512
2513
  /// Sets the list of references to initializer variables for new
2514
  /// private variables.
2515
  /// \param VL List of references.
2516
  void setInits(ArrayRef<Expr *> VL);
2517
2518
  /// Gets the list of references to initializer variables for new
2519
  /// private variables.
2520
8.63k
  MutableArrayRef<Expr *> getInits() {
2521
8.63k
    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
2522
8.63k
  }
2523
22.2k
  ArrayRef<const Expr *> getInits() const {
2524
22.2k
    return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
2525
22.2k
  }
2526
2527
public:
2528
  /// Creates clause with a list of variables \a VL.
2529
  ///
2530
  /// \param C AST context.
2531
  /// \param StartLoc Starting location of the clause.
2532
  /// \param LParenLoc Location of '('.
2533
  /// \param EndLoc Ending location of the clause.
2534
  /// \param VL List of references to the original variables.
2535
  /// \param PrivateVL List of references to private copies with initializers.
2536
  /// \param InitVL List of references to auto generated variables used for
2537
  /// initialization of a single array element. Used if firstprivate variable is
2538
  /// of array type.
2539
  /// \param PreInit Statement that must be executed before entering the OpenMP
2540
  /// region with this clause.
2541
  static OMPFirstprivateClause *
2542
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2543
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
2544
         ArrayRef<Expr *> InitVL, Stmt *PreInit);
2545
2546
  /// Creates an empty clause with the place for \a N variables.
2547
  ///
2548
  /// \param C AST context.
2549
  /// \param N The number of variables.
2550
  static OMPFirstprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
2551
2552
  using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
2553
  using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
2554
  using private_copies_range = llvm::iterator_range<private_copies_iterator>;
2555
  using private_copies_const_range =
2556
      llvm::iterator_range<private_copies_const_iterator>;
2557
2558
51.9k
  private_copies_range private_copies() {
2559
51.9k
    return private_copies_range(getPrivateCopies().begin(),
2560
51.9k
                                getPrivateCopies().end());
2561
51.9k
  }
2562
11.1k
  private_copies_const_range private_copies() const {
2563
11.1k
    return private_copies_const_range(getPrivateCopies().begin(),
2564
11.1k
                                      getPrivateCopies().end());
2565
11.1k
  }
2566
2567
  using inits_iterator = MutableArrayRef<Expr *>::iterator;
2568
  using inits_const_iterator = ArrayRef<const Expr *>::iterator;
2569
  using inits_range = llvm::iterator_range<inits_iterator>;
2570
  using inits_const_range = llvm::iterator_range<inits_const_iterator>;
2571
2572
4.31k
  inits_range inits() {
2573
4.31k
    return inits_range(getInits().begin(), getInits().end());
2574
4.31k
  }
2575
11.1k
  inits_const_range inits() const {
2576
11.1k
    return inits_const_range(getInits().begin(), getInits().end());
2577
11.1k
  }
2578
2579
8.94k
  child_range children() {
2580
8.94k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2581
8.94k
                       reinterpret_cast<Stmt **>(varlist_end()));
2582
8.94k
  }
2583
2584
0
  const_child_range children() const {
2585
0
    auto Children = const_cast<OMPFirstprivateClause *>(this)->children();
2586
0
    return const_child_range(Children.begin(), Children.end());
2587
0
  }
2588
2589
23.5k
  child_range used_children() {
2590
23.5k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2591
23.5k
                       reinterpret_cast<Stmt **>(varlist_end()));
2592
23.5k
  }
2593
0
  const_child_range used_children() const {
2594
0
    auto Children = const_cast<OMPFirstprivateClause *>(this)->used_children();
2595
0
    return const_child_range(Children.begin(), Children.end());
2596
0
  }
2597
2598
226k
  static bool classof(const OMPClause *T) {
2599
226k
    return T->getClauseKind() == llvm::omp::OMPC_firstprivate;
2600
226k
  }
2601
};
2602
2603
/// This represents clause 'lastprivate' in the '#pragma omp ...'
2604
/// directives.
2605
///
2606
/// \code
2607
/// #pragma omp simd lastprivate(a,b)
2608
/// \endcode
2609
/// In this example directive '#pragma omp simd' has clause 'lastprivate'
2610
/// with the variables 'a' and 'b'.
2611
class OMPLastprivateClause final
2612
    : public OMPVarListClause<OMPLastprivateClause>,
2613
      public OMPClauseWithPostUpdate,
2614
      private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
2615
  // There are 4 additional tail-allocated arrays at the end of the class:
2616
  // 1. Contains list of pseudo variables with the default initialization for
2617
  // each non-firstprivate variables. Used in codegen for initialization of
2618
  // lastprivate copies.
2619
  // 2. List of helper expressions for proper generation of assignment operation
2620
  // required for lastprivate clause. This list represents private variables
2621
  // (for arrays, single array element).
2622
  // 3. List of helper expressions for proper generation of assignment operation
2623
  // required for lastprivate clause. This list represents original variables
2624
  // (for arrays, single array element).
2625
  // 4. List of helper expressions that represents assignment operation:
2626
  // \code
2627
  // DstExprs = SrcExprs;
2628
  // \endcode
2629
  // Required for proper codegen of final assignment performed by the
2630
  // lastprivate clause.
2631
  friend class OMPClauseReader;
2632
  friend OMPVarListClause;
2633
  friend TrailingObjects;
2634
2635
  /// Optional lastprivate kind, e.g. 'conditional', if specified by user.
2636
  OpenMPLastprivateModifier LPKind;
2637
  /// Optional location of the lasptrivate kind, if specified by user.
2638
  SourceLocation LPKindLoc;
2639
  /// Optional colon location, if specified by user.
2640
  SourceLocation ColonLoc;
2641
2642
  /// Build clause with number of variables \a N.
2643
  ///
2644
  /// \param StartLoc Starting location of the clause.
2645
  /// \param LParenLoc Location of '('.
2646
  /// \param EndLoc Ending location of the clause.
2647
  /// \param N Number of the variables in the clause.
2648
  OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2649
                       SourceLocation EndLoc, OpenMPLastprivateModifier LPKind,
2650
                       SourceLocation LPKindLoc, SourceLocation ColonLoc,
2651
                       unsigned N)
2652
      : OMPVarListClause<OMPLastprivateClause>(llvm::omp::OMPC_lastprivate,
2653
                                               StartLoc, LParenLoc, EndLoc, N),
2654
        OMPClauseWithPostUpdate(this), LPKind(LPKind), LPKindLoc(LPKindLoc),
2655
5.83k
        ColonLoc(ColonLoc) {}
2656
2657
  /// Build an empty clause.
2658
  ///
2659
  /// \param N Number of variables.
2660
  explicit OMPLastprivateClause(unsigned N)
2661
      : OMPVarListClause<OMPLastprivateClause>(
2662
            llvm::omp::OMPC_lastprivate, SourceLocation(), SourceLocation(),
2663
            SourceLocation(), N),
2664
394
        OMPClauseWithPostUpdate(this) {}
2665
2666
  /// Get the list of helper expressions for initialization of private
2667
  /// copies for lastprivate variables.
2668
30.9k
  MutableArrayRef<Expr *> getPrivateCopies() {
2669
30.9k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2670
30.9k
  }
2671
6.68k
  ArrayRef<const Expr *> getPrivateCopies() const {
2672
6.68k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2673
6.68k
  }
2674
2675
  /// Set list of helper expressions, required for proper codegen of the
2676
  /// clause. These expressions represent private variables (for arrays, single
2677
  /// array element) in the final assignment statement performed by the
2678
  /// lastprivate clause.
2679
  void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2680
2681
  /// Get the list of helper source expressions.
2682
15.1k
  MutableArrayRef<Expr *> getSourceExprs() {
2683
15.1k
    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
2684
15.1k
  }
2685
5.60k
  ArrayRef<const Expr *> getSourceExprs() const {
2686
5.60k
    return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
2687
5.60k
  }
2688
2689
  /// Set list of helper expressions, required for proper codegen of the
2690
  /// clause. These expressions represent original variables (for arrays, single
2691
  /// array element) in the final assignment statement performed by the
2692
  /// lastprivate clause.
2693
  void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2694
2695
  /// Get the list of helper destination expressions.
2696
7.99k
  MutableArrayRef<Expr *> getDestinationExprs() {
2697
7.99k
    return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2698
7.99k
  }
2699
4.09k
  ArrayRef<const Expr *> getDestinationExprs() const {
2700
4.09k
    return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2701
4.09k
  }
2702
2703
  /// Set list of helper assignment expressions, required for proper
2704
  /// codegen of the clause. These expressions are assignment expressions that
2705
  /// assign private copy of the variable to original variable.
2706
  void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2707
2708
  /// Get the list of helper assignment expressions.
2709
884
  MutableArrayRef<Expr *> getAssignmentOps() {
2710
884
    return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2711
884
  }
2712
1.50k
  ArrayRef<const Expr *> getAssignmentOps() const {
2713
1.50k
    return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2714
1.50k
  }
2715
2716
  /// Sets lastprivate kind.
2717
394
  void setKind(OpenMPLastprivateModifier Kind) { LPKind = Kind; }
2718
  /// Sets location of the lastprivate kind.
2719
394
  void setKindLoc(SourceLocation Loc) { LPKindLoc = Loc; }
2720
  /// Sets colon symbol location.
2721
394
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
2722
2723
public:
2724
  /// Creates clause with a list of variables \a VL.
2725
  ///
2726
  /// \param C AST context.
2727
  /// \param StartLoc Starting location of the clause.
2728
  /// \param LParenLoc Location of '('.
2729
  /// \param EndLoc Ending location of the clause.
2730
  /// \param VL List of references to the variables.
2731
  /// \param SrcExprs List of helper expressions for proper generation of
2732
  /// assignment operation required for lastprivate clause. This list represents
2733
  /// private variables (for arrays, single array element).
2734
  /// \param DstExprs List of helper expressions for proper generation of
2735
  /// assignment operation required for lastprivate clause. This list represents
2736
  /// original variables (for arrays, single array element).
2737
  /// \param AssignmentOps List of helper expressions that represents assignment
2738
  /// operation:
2739
  /// \code
2740
  /// DstExprs = SrcExprs;
2741
  /// \endcode
2742
  /// Required for proper codegen of final assignment performed by the
2743
  /// lastprivate clause.
2744
  /// \param LPKind Lastprivate kind, e.g. 'conditional'.
2745
  /// \param LPKindLoc Location of the lastprivate kind.
2746
  /// \param ColonLoc Location of the ':' symbol if lastprivate kind is used.
2747
  /// \param PreInit Statement that must be executed before entering the OpenMP
2748
  /// region with this clause.
2749
  /// \param PostUpdate Expression that must be executed after exit from the
2750
  /// OpenMP region with this clause.
2751
  static OMPLastprivateClause *
2752
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2753
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2754
         ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
2755
         OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc,
2756
         SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate);
2757
2758
  /// Creates an empty clause with the place for \a N variables.
2759
  ///
2760
  /// \param C AST context.
2761
  /// \param N The number of variables.
2762
  static OMPLastprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
2763
2764
  /// Lastprivate kind.
2765
7.76k
  OpenMPLastprivateModifier getKind() const { return LPKind; }
2766
  /// Returns the location of the lastprivate kind.
2767
1.78k
  SourceLocation getKindLoc() const { return LPKindLoc; }
2768
  /// Returns the location of the ':' symbol, if any.
2769
1.78k
  SourceLocation getColonLoc() const { return ColonLoc; }
2770
2771
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
2772
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
2773
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
2774
  using helper_expr_const_range =
2775
      llvm::iterator_range<helper_expr_const_iterator>;
2776
2777
  /// Set list of helper expressions, required for generation of private
2778
  /// copies of original lastprivate variables.
2779
  void setPrivateCopies(ArrayRef<Expr *> PrivateCopies);
2780
2781
540
  helper_expr_const_range private_copies() const {
2782
540
    return helper_expr_const_range(getPrivateCopies().begin(),
2783
540
                                   getPrivateCopies().end());
2784
540
  }
2785
2786
4.82k
  helper_expr_range private_copies() {
2787
4.82k
    return helper_expr_range(getPrivateCopies().begin(),
2788
4.82k
                             getPrivateCopies().end());
2789
4.82k
  }
2790
2791
754
  helper_expr_const_range source_exprs() const {
2792
754
    return helper_expr_const_range(getSourceExprs().begin(),
2793
754
                                   getSourceExprs().end());
2794
754
  }
2795
2796
442
  helper_expr_range source_exprs() {
2797
442
    return helper_expr_range(getSourceExprs().begin(), getSourceExprs().end());
2798
442
  }
2799
2800
1.29k
  helper_expr_const_range destination_exprs() const {
2801
1.29k
    return helper_expr_const_range(getDestinationExprs().begin(),
2802
1.29k
                                   getDestinationExprs().end());
2803
1.29k
  }
2804
2805
442
  helper_expr_range destination_exprs() {
2806
442
    return helper_expr_range(getDestinationExprs().begin(),
2807
442
                             getDestinationExprs().end());
2808
442
  }
2809
2810
754
  helper_expr_const_range assignment_ops() const {
2811
754
    return helper_expr_const_range(getAssignmentOps().begin(),
2812
754
                                   getAssignmentOps().end());
2813
754
  }
2814
2815
442
  helper_expr_range assignment_ops() {
2816
442
    return helper_expr_range(getAssignmentOps().begin(),
2817
442
                             getAssignmentOps().end());
2818
442
  }
2819
2820
8.36k
  child_range children() {
2821
8.36k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2822
8.36k
                       reinterpret_cast<Stmt **>(varlist_end()));
2823
8.36k
  }
2824
2825
0
  const_child_range children() const {
2826
0
    auto Children = const_cast<OMPLastprivateClause *>(this)->children();
2827
0
    return const_child_range(Children.begin(), Children.end());
2828
0
  }
2829
2830
1.31k
  child_range used_children() {
2831
1.31k
    return child_range(child_iterator(), child_iterator());
2832
1.31k
  }
2833
0
  const_child_range used_children() const {
2834
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2835
0
  }
2836
2837
304k
  static bool classof(const OMPClause *T) {
2838
304k
    return T->getClauseKind() == llvm::omp::OMPC_lastprivate;
2839
304k
  }
2840
};
2841
2842
/// This represents clause 'shared' in the '#pragma omp ...' directives.
2843
///
2844
/// \code
2845
/// #pragma omp parallel shared(a,b)
2846
/// \endcode
2847
/// In this example directive '#pragma omp parallel' has clause 'shared'
2848
/// with the variables 'a' and 'b'.
2849
class OMPSharedClause final
2850
    : public OMPVarListClause<OMPSharedClause>,
2851
      private llvm::TrailingObjects<OMPSharedClause, Expr *> {
2852
  friend OMPVarListClause;
2853
  friend TrailingObjects;
2854
2855
  /// Build clause with number of variables \a N.
2856
  ///
2857
  /// \param StartLoc Starting location of the clause.
2858
  /// \param LParenLoc Location of '('.
2859
  /// \param EndLoc Ending location of the clause.
2860
  /// \param N Number of the variables in the clause.
2861
  OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2862
                  SourceLocation EndLoc, unsigned N)
2863
      : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared, StartLoc,
2864
3.93k
                                          LParenLoc, EndLoc, N) {}
2865
2866
  /// Build an empty clause.
2867
  ///
2868
  /// \param N Number of variables.
2869
  explicit OMPSharedClause(unsigned N)
2870
      : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared,
2871
                                          SourceLocation(), SourceLocation(),
2872
400
                                          SourceLocation(), N) {}
2873
2874
public:
2875
  /// Creates clause with a list of variables \a VL.
2876
  ///
2877
  /// \param C AST context.
2878
  /// \param StartLoc Starting location of the clause.
2879
  /// \param LParenLoc Location of '('.
2880
  /// \param EndLoc Ending location of the clause.
2881
  /// \param VL List of references to the variables.
2882
  static OMPSharedClause *Create(const ASTContext &C, SourceLocation StartLoc,
2883
                                 SourceLocation LParenLoc,
2884
                                 SourceLocation EndLoc, ArrayRef<Expr *> VL);
2885
2886
  /// Creates an empty clause with \a N variables.
2887
  ///
2888
  /// \param C AST context.
2889
  /// \param N The number of variables.
2890
  static OMPSharedClause *CreateEmpty(const ASTContext &C, unsigned N);
2891
2892
675
  child_range children() {
2893
675
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2894
675
                       reinterpret_cast<Stmt **>(varlist_end()));
2895
675
  }
2896
2897
0
  const_child_range children() const {
2898
0
    auto Children = const_cast<OMPSharedClause *>(this)->children();
2899
0
    return const_child_range(Children.begin(), Children.end());
2900
0
  }
2901
2902
1.31k
  child_range used_children() {
2903
1.31k
    return child_range(child_iterator(), child_iterator());
2904
1.31k
  }
2905
0
  const_child_range used_children() const {
2906
0
    return const_child_range(const_child_iterator(), const_child_iterator());
2907
0
  }
2908
2909
1.41k
  static bool classof(const OMPClause *T) {
2910
1.41k
    return T->getClauseKind() == llvm::omp::OMPC_shared;
2911
1.41k
  }
2912
};
2913
2914
/// This represents clause 'reduction' in the '#pragma omp ...'
2915
/// directives.
2916
///
2917
/// \code
2918
/// #pragma omp parallel reduction(+:a,b)
2919
/// \endcode
2920
/// In this example directive '#pragma omp parallel' has clause 'reduction'
2921
/// with operator '+' and the variables 'a' and 'b'.
2922
class OMPReductionClause final
2923
    : public OMPVarListClause<OMPReductionClause>,
2924
      public OMPClauseWithPostUpdate,
2925
      private llvm::TrailingObjects<OMPReductionClause, Expr *> {
2926
  friend class OMPClauseReader;
2927
  friend OMPVarListClause;
2928
  friend TrailingObjects;
2929
2930
  /// Reduction modifier.
2931
  OpenMPReductionClauseModifier Modifier = OMPC_REDUCTION_unknown;
2932
2933
  /// Reduction modifier location.
2934
  SourceLocation ModifierLoc;
2935
2936
  /// Location of ':'.
2937
  SourceLocation ColonLoc;
2938
2939
  /// Nested name specifier for C++.
2940
  NestedNameSpecifierLoc QualifierLoc;
2941
2942
  /// Name of custom operator.
2943
  DeclarationNameInfo NameInfo;
2944
2945
  /// Build clause with number of variables \a N.
2946
  ///
2947
  /// \param StartLoc Starting location of the clause.
2948
  /// \param LParenLoc Location of '('.
2949
  /// \param ModifierLoc Modifier location.
2950
  /// \param ColonLoc Location of ':'.
2951
  /// \param EndLoc Ending location of the clause.
2952
  /// \param N Number of the variables in the clause.
2953
  /// \param QualifierLoc The nested-name qualifier with location information
2954
  /// \param NameInfo The full name info for reduction identifier.
2955
  OMPReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2956
                     SourceLocation ModifierLoc, SourceLocation ColonLoc,
2957
                     SourceLocation EndLoc,
2958
                     OpenMPReductionClauseModifier Modifier, unsigned N,
2959
                     NestedNameSpecifierLoc QualifierLoc,
2960
                     const DeclarationNameInfo &NameInfo)
2961
      : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
2962
                                             StartLoc, LParenLoc, EndLoc, N),
2963
        OMPClauseWithPostUpdate(this), Modifier(Modifier),
2964
        ModifierLoc(ModifierLoc), ColonLoc(ColonLoc),
2965
24.7k
        QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
2966
2967
  /// Build an empty clause.
2968
  ///
2969
  /// \param N Number of variables.
2970
  explicit OMPReductionClause(unsigned N)
2971
      : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction,
2972
                                             SourceLocation(), SourceLocation(),
2973
                                             SourceLocation(), N),
2974
916
        OMPClauseWithPostUpdate(this) {}
2975
2976
  /// Sets reduction modifier.
2977
916
  void setModifier(OpenMPReductionClauseModifier M) { Modifier = M; }
2978
2979
  /// Sets location of the modifier.
2980
916
  void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; }
2981
2982
  /// Sets location of ':' symbol in clause.
2983
916
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
2984
2985
  /// Sets the name info for specified reduction identifier.
2986
916
  void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
2987
2988
  /// Sets the nested name specifier.
2989
916
  void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
2990
2991
  /// Set list of helper expressions, required for proper codegen of the
2992
  /// clause. These expressions represent private copy of the reduction
2993
  /// variable.
2994
  void setPrivates(ArrayRef<Expr *> Privates);
2995
2996
  /// Get the list of helper privates.
2997
147k
  MutableArrayRef<Expr *> getPrivates() {
2998
147k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2999
147k
  }
3000
29.3k
  ArrayRef<const Expr *> getPrivates() const {
3001
29.3k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
3002
29.3k
  }
3003
3004
  /// Set list of helper expressions, required for proper codegen of the
3005
  /// clause. These expressions represent LHS expression in the final
3006
  /// reduction expression performed by the reduction clause.
3007
  void setLHSExprs(ArrayRef<Expr *> LHSExprs);
3008
3009
  /// Get the list of helper LHS expressions.
3010
92.8k
  MutableArrayRef<Expr *> getLHSExprs() {
3011
92.8k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
3012
92.8k
  }
3013
22.0k
  ArrayRef<const Expr *> getLHSExprs() const {
3014
22.0k
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
3015
22.0k
  }
3016
3017
  /// Set list of helper expressions, required for proper codegen of the
3018
  /// clause. These expressions represent RHS expression in the final
3019
  /// reduction expression performed by the reduction clause.
3020
  /// Also, variables in these expressions are used for proper initialization of
3021
  /// reduction copies.
3022
  void setRHSExprs(ArrayRef<Expr *> RHSExprs);
3023
3024
  /// Get the list of helper destination expressions.
3025
65.2k
  MutableArrayRef<Expr *> getRHSExprs() {
3026
65.2k
    return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
3027
65.2k
  }
3028
15.0k
  ArrayRef<const Expr *> getRHSExprs() const {
3029
15.0k
    return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
3030
15.0k
  }
3031
3032
  /// Set list of helper reduction expressions, required for proper
3033
  /// codegen of the clause. These expressions are binary expressions or
3034
  /// operator/custom reduction call that calculates new value from source
3035
  /// helper expressions to destination helper expressions.
3036
  void setReductionOps(ArrayRef<Expr *> ReductionOps);
3037
3038
  /// Get the list of helper reduction expressions.
3039
37.6k
  MutableArrayRef<Expr *> getReductionOps() {
3040
37.6k
    return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
3041
37.6k
  }
3042
7.98k
  ArrayRef<const Expr *> getReductionOps() const {
3043
7.98k
    return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
3044
7.98k
  }
3045
3046
  /// Set list of helper copy operations for inscan reductions.
3047
  /// The form is: Temps[i] = LHS[i];
3048
  void setInscanCopyOps(ArrayRef<Expr *> Ops);
3049
3050
  /// Get the list of helper inscan copy operations.
3051
560
  MutableArrayRef<Expr *> getInscanCopyOps() {
3052
560
    return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size());
3053
560
  }
3054
876
  ArrayRef<const Expr *> getInscanCopyOps() const {
3055
876
    return llvm::makeArrayRef(getReductionOps().end(), varlist_size());
3056
876
  }
3057
3058
  /// Set list of helper temp vars for inscan copy array operations.
3059
  void setInscanCopyArrayTemps(ArrayRef<Expr *> CopyArrayTemps);
3060
3061
  /// Get the list of helper inscan copy temps.
3062
350
  MutableArrayRef<Expr *> getInscanCopyArrayTemps() {
3063
350
    return MutableArrayRef<Expr *>(getInscanCopyOps().end(), varlist_size());
3064
350
  }
3065
640
  ArrayRef<const Expr *> getInscanCopyArrayTemps() const {
3066
640
    return llvm::makeArrayRef(getInscanCopyOps().end(), varlist_size());
3067
640
  }
3068
3069
  /// Set list of helper temp elements vars for inscan copy array operations.
3070
  void setInscanCopyArrayElems(ArrayRef<Expr *> CopyArrayElems);
3071
3072
  /// Get the list of helper inscan copy temps.
3073
48
  MutableArrayRef<Expr *> getInscanCopyArrayElems() {
3074
48
    return MutableArrayRef<Expr *>(getInscanCopyArrayTemps().end(),
3075
48
                                   varlist_size());
3076
48
  }
3077
300
  ArrayRef<const Expr *> getInscanCopyArrayElems() const {
3078
300
    return llvm::makeArrayRef(getInscanCopyArrayTemps().end(), varlist_size());
3079
300
  }
3080
3081
public:
3082
  /// Creates clause with a list of variables \a VL.
3083
  ///
3084
  /// \param StartLoc Starting location of the clause.
3085
  /// \param LParenLoc Location of '('.
3086
  /// \param ModifierLoc Modifier location.
3087
  /// \param ColonLoc Location of ':'.
3088
  /// \param EndLoc Ending location of the clause.
3089
  /// \param VL The variables in the clause.
3090
  /// \param QualifierLoc The nested-name qualifier with location information
3091
  /// \param NameInfo The full name info for reduction identifier.
3092
  /// \param Privates List of helper expressions for proper generation of
3093
  /// private copies.
3094
  /// \param LHSExprs List of helper expressions for proper generation of
3095
  /// assignment operation required for copyprivate clause. This list represents
3096
  /// LHSs of the reduction expressions.
3097
  /// \param RHSExprs List of helper expressions for proper generation of
3098
  /// assignment operation required for copyprivate clause. This list represents
3099
  /// RHSs of the reduction expressions.
3100
  /// Also, variables in these expressions are used for proper initialization of
3101
  /// reduction copies.
3102
  /// \param ReductionOps List of helper expressions that represents reduction
3103
  /// expressions:
3104
  /// \code
3105
  /// LHSExprs binop RHSExprs;
3106
  /// operator binop(LHSExpr, RHSExpr);
3107
  /// <CutomReduction>(LHSExpr, RHSExpr);
3108
  /// \endcode
3109
  /// Required for proper codegen of final reduction operation performed by the
3110
  /// reduction clause.
3111
  /// \param CopyOps List of copy operations for inscan reductions:
3112
  /// \code
3113
  /// TempExprs = LHSExprs;
3114
  /// \endcode
3115
  /// \param CopyArrayTemps Temp arrays for prefix sums.
3116
  /// \param CopyArrayElems Temp arrays for prefix sums.
3117
  /// \param PreInit Statement that must be executed before entering the OpenMP
3118
  /// region with this clause.
3119
  /// \param PostUpdate Expression that must be executed after exit from the
3120
  /// OpenMP region with this clause.
3121
  static OMPReductionClause *
3122
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3123
         SourceLocation ModifierLoc, SourceLocation ColonLoc,
3124
         SourceLocation EndLoc, OpenMPReductionClauseModifier Modifier,
3125
         ArrayRef<Expr *> VL, NestedNameSpecifierLoc QualifierLoc,
3126
         const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
3127
         ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
3128
         ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> CopyOps,
3129
         ArrayRef<Expr *> CopyArrayTemps, ArrayRef<Expr *> CopyArrayElems,
3130
         Stmt *PreInit, Expr *PostUpdate);
3131
3132
  /// Creates an empty clause with the place for \a N variables.
3133
  ///
3134
  /// \param C AST context.
3135
  /// \param N The number of variables.
3136
  /// \param Modifier Reduction modifier.
3137
  static OMPReductionClause *
3138
  CreateEmpty(const ASTContext &C, unsigned N,
3139
              OpenMPReductionClauseModifier Modifier);
3140
3141
  /// Returns modifier.
3142
83.0k
  OpenMPReductionClauseModifier getModifier() const { return Modifier; }
3143
3144
  /// Returns modifier location.
3145
20.4k
  SourceLocation getModifierLoc() const { return ModifierLoc; }
3146
3147
  /// Gets location of ':' symbol in clause.
3148
18.4k
  SourceLocation getColonLoc() const { return ColonLoc; }
3149
3150
  /// Gets the name info for specified reduction identifier.
3151
21.1k
  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
3152
3153
  /// Gets the nested name specifier.
3154
20.7k
  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
3155
3156
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
3157
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
3158
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
3159
  using helper_expr_const_range =
3160
      llvm::iterator_range<helper_expr_const_iterator>;
3161
3162
3.61k
  helper_expr_const_range privates() const {
3163
3.61k
    return helper_expr_const_range(getPrivates().begin(), getPrivates().end());
3164
3.61k
  }
3165
3166
14.4k
  helper_expr_range privates() {
3167
14.4k
    return helper_expr_range(getPrivates().begin(), getPrivates().end());
3168
14.4k
  }
3169
3170
3.52k
  helper_expr_const_range lhs_exprs() const {
3171
3.52k
    return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end());
3172
3.52k
  }
3173
3174
959
  helper_expr_range lhs_exprs() {
3175
959
    return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end());
3176
959
  }
3177
3178
3.52k
  helper_expr_const_range rhs_exprs() const {
3179
3.52k
    return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end());
3180
3.52k
  }
3181
3182
959
  helper_expr_range rhs_exprs() {
3183
959
    return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end());
3184
959
  }
3185
3186
3.55k
  helper_expr_const_range reduction_ops() const {
3187
3.55k
    return helper_expr_const_range(getReductionOps().begin(),
3188
3.55k
                                   getReductionOps().end());
3189
3.55k
  }
3190
3191
18.4k
  helper_expr_range reduction_ops() {
3192
18.4k
    return helper_expr_range(getReductionOps().begin(),
3193
18.4k
                             getReductionOps().end());
3194
18.4k
  }
3195
3196
118
  helper_expr_const_range copy_ops() const {
3197
118
    return helper_expr_const_range(getInscanCopyOps().begin(),
3198
118
                                   getInscanCopyOps().end());
3199
118
  }
3200
3201
24
  helper_expr_range copy_ops() {
3202
24
    return helper_expr_range(getInscanCopyOps().begin(),
3203
24
                             getInscanCopyOps().end());
3204
24
  }
3205
3206
170
  helper_expr_const_range copy_array_temps() const {
3207
170
    return helper_expr_const_range(getInscanCopyArrayTemps().begin(),
3208
170
                                   getInscanCopyArrayTemps().end());
3209
170
  }
3210
3211
70
  helper_expr_range copy_array_temps() {
3212
70
    return helper_expr_range(getInscanCopyArrayTemps().begin(),
3213
70
                             getInscanCopyArrayTemps().end());
3214
70
  }
3215
3216
150
  helper_expr_const_range copy_array_elems() const {
3217
150
    return helper_expr_const_range(getInscanCopyArrayElems().begin(),
3218
150
                                   getInscanCopyArrayElems().end());
3219
150
  }
3220
3221
24
  helper_expr_range copy_array_elems() {
3222
24
    return helper_expr_range(getInscanCopyArrayElems().begin(),
3223
24
                             getInscanCopyArrayElems().end());
3224
24
  }
3225
3226
29.5k
  child_range children() {
3227
29.5k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3228
29.5k
                       reinterpret_cast<Stmt **>(varlist_end()));
3229
29.5k
  }
3230
3231
0
  const_child_range children() const {
3232
0
    auto Children = const_cast<OMPReductionClause *>(this)->children();
3233
0
    return const_child_range(Children.begin(), Children.end());
3234
0
  }
3235
3236
7.74k
  child_range used_children() {
3237
7.74k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3238
7.74k
                       reinterpret_cast<Stmt **>(varlist_end()));
3239
7.74k
  }
3240
0
  const_child_range used_children() const {
3241
0
    auto Children = const_cast<OMPReductionClause *>(this)->used_children();
3242
0
    return const_child_range(Children.begin(), Children.end());
3243
0
  }
3244
3245
304k
  static bool classof(const OMPClause *T) {
3246
304k
    return T->getClauseKind() == llvm::omp::OMPC_reduction;
3247
304k
  }
3248
};
3249
3250
/// This represents clause 'task_reduction' in the '#pragma omp taskgroup'
3251
/// directives.
3252
///
3253
/// \code
3254
/// #pragma omp taskgroup task_reduction(+:a,b)
3255
/// \endcode
3256
/// In this example directive '#pragma omp taskgroup' has clause
3257
/// 'task_reduction' with operator '+' and the variables 'a' and 'b'.
3258
class OMPTaskReductionClause final
3259
    : public OMPVarListClause<OMPTaskReductionClause>,
3260
      public OMPClauseWithPostUpdate,
3261
      private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
3262
  friend class OMPClauseReader;
3263
  friend OMPVarListClause;
3264
  friend TrailingObjects;
3265
3266
  /// Location of ':'.
3267
  SourceLocation ColonLoc;
3268
3269
  /// Nested name specifier for C++.
3270
  NestedNameSpecifierLoc QualifierLoc;
3271
3272
  /// Name of custom operator.
3273
  DeclarationNameInfo NameInfo;
3274
3275
  /// Build clause with number of variables \a N.
3276
  ///
3277
  /// \param StartLoc Starting location of the clause.
3278
  /// \param LParenLoc Location of '('.
3279
  /// \param EndLoc Ending location of the clause.
3280
  /// \param ColonLoc Location of ':'.
3281
  /// \param N Number of the variables in the clause.
3282
  /// \param QualifierLoc The nested-name qualifier with location information
3283
  /// \param NameInfo The full name info for reduction identifier.
3284
  OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3285
                         SourceLocation ColonLoc, SourceLocation EndLoc,
3286
                         unsigned N, NestedNameSpecifierLoc QualifierLoc,
3287
                         const DeclarationNameInfo &NameInfo)
3288
      : OMPVarListClause<OMPTaskReductionClause>(
3289
            llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N),
3290
        OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
3291
2.26k
        QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3292
3293
  /// Build an empty clause.
3294
  ///
3295
  /// \param N Number of variables.
3296
  explicit OMPTaskReductionClause(unsigned N)
3297
      : OMPVarListClause<OMPTaskReductionClause>(
3298
            llvm::omp::OMPC_task_reduction, SourceLocation(), SourceLocation(),
3299
            SourceLocation(), N),
3300
86
        OMPClauseWithPostUpdate(this) {}
3301
3302
  /// Sets location of ':' symbol in clause.
3303
86
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
3304
3305
  /// Sets the name info for specified reduction identifier.
3306
86
  void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
3307
3308
  /// Sets the nested name specifier.
3309
86
  void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
3310
3311
  /// Set list of helper expressions, required for proper codegen of the clause.
3312
  /// These expressions represent private copy of the reduction variable.
3313
  void setPrivates(ArrayRef<Expr *> Privates);
3314
3315
  /// Get the list of helper privates.
3316
13.1k
  MutableArrayRef<Expr *> getPrivates() {
3317
13.1k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
3318
13.1k
  }
3319
1.00k
  ArrayRef<const Expr *> getPrivates() const {
3320
1.00k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
3321
1.00k
  }
3322
3323
  /// Set list of helper expressions, required for proper codegen of the clause.
3324
  /// These expressions represent LHS expression in the final reduction
3325
  /// expression performed by the reduction clause.
3326
  void setLHSExprs(ArrayRef<Expr *> LHSExprs);
3327
3328
  /// Get the list of helper LHS expressions.
3329
7.70k
  MutableArrayRef<Expr *> getLHSExprs() {
3330
7.70k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
3331
7.70k
  }
3332
756
  ArrayRef<const Expr *> getLHSExprs() const {
3333
756
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
3334
756
  }
3335
3336
  /// Set list of helper expressions, required for proper codegen of the clause.
3337
  /// These expressions represent RHS expression in the final reduction
3338
  /// expression performed by the reduction clause. Also, variables in these
3339
  /// expressions are used for proper initialization of reduction copies.
3340
  void setRHSExprs(ArrayRef<Expr *> RHSExprs);
3341
3342
  ///  Get the list of helper destination expressions.
3343
5.18k
  MutableArrayRef<Expr *> getRHSExprs() {
3344
5.18k
    return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
3345
5.18k
  }
3346
504
  ArrayRef<const Expr *> getRHSExprs() const {
3347
504
    return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
3348
504
  }
3349
3350
  /// Set list of helper reduction expressions, required for proper
3351
  /// codegen of the clause. These expressions are binary expressions or
3352
  /// operator/custom reduction call that calculates new value from source
3353
  /// helper expressions to destination helper expressions.
3354
  void setReductionOps(ArrayRef<Expr *> ReductionOps);
3355
3356
  ///  Get the list of helper reduction expressions.
3357
2.66k
  MutableArrayRef<Expr *> getReductionOps() {
3358
2.66k
    return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
3359
2.66k
  }
3360
252
  ArrayRef<const Expr *> getReductionOps() const {
3361
252
    return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
3362
252
  }
3363
3364
public:
3365
  /// Creates clause with a list of variables \a VL.
3366
  ///
3367
  /// \param StartLoc Starting location of the clause.
3368
  /// \param LParenLoc Location of '('.
3369
  /// \param ColonLoc Location of ':'.
3370
  /// \param EndLoc Ending location of the clause.
3371
  /// \param VL The variables in the clause.
3372
  /// \param QualifierLoc The nested-name qualifier with location information
3373
  /// \param NameInfo The full name info for reduction identifier.
3374
  /// \param Privates List of helper expressions for proper generation of
3375
  /// private copies.
3376
  /// \param LHSExprs List of helper expressions for proper generation of
3377
  /// assignment operation required for copyprivate clause. This list represents
3378
  /// LHSs of the reduction expressions.
3379
  /// \param RHSExprs List of helper expressions for proper generation of
3380
  /// assignment operation required for copyprivate clause. This list represents
3381
  /// RHSs of the reduction expressions.
3382
  /// Also, variables in these expressions are used for proper initialization of
3383
  /// reduction copies.
3384
  /// \param ReductionOps List of helper expressions that represents reduction
3385
  /// expressions:
3386
  /// \code
3387
  /// LHSExprs binop RHSExprs;
3388
  /// operator binop(LHSExpr, RHSExpr);
3389
  /// <CutomReduction>(LHSExpr, RHSExpr);
3390
  /// \endcode
3391
  /// Required for proper codegen of final reduction operation performed by the
3392
  /// reduction clause.
3393
  /// \param PreInit Statement that must be executed before entering the OpenMP
3394
  /// region with this clause.
3395
  /// \param PostUpdate Expression that must be executed after exit from the
3396
  /// OpenMP region with this clause.
3397
  static OMPTaskReductionClause *
3398
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3399
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
3400
         NestedNameSpecifierLoc QualifierLoc,
3401
         const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
3402
         ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
3403
         ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
3404
3405
  /// Creates an empty clause with the place for \a N variables.
3406
  ///
3407
  /// \param C AST context.
3408
  /// \param N The number of variables.
3409
  static OMPTaskReductionClause *CreateEmpty(const ASTContext &C, unsigned N);
3410
3411
  /// Gets location of ':' symbol in clause.
3412
1.33k
  SourceLocation getColonLoc() const { return ColonLoc; }
3413
3414
  /// Gets the name info for specified reduction identifier.
3415
1.63k
  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
3416
3417
  /// Gets the nested name specifier.
3418
1.62k
  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
3419
3420
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
3421
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
3422
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
3423
  using helper_expr_const_range =
3424
      llvm::iterator_range<helper_expr_const_iterator>;
3425
3426
126
  helper_expr_const_range privates() const {
3427
126
    return helper_expr_const_range(getPrivates().begin(), getPrivates().end());
3428
126
  }
3429
3430
1.54k
  helper_expr_range privates() {
3431
1.54k
    return helper_expr_range(getPrivates().begin(), getPrivates().end());
3432
1.54k
  }
3433
3434
126
  helper_expr_const_range lhs_exprs() const {
3435
126
    return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end());
3436
126
  }
3437
3438
86
  helper_expr_range lhs_exprs() {
3439
86
    return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end());
3440
86
  }
3441
3442
126
  helper_expr_const_range rhs_exprs() const {
3443
126
    return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end());
3444
126
  }
3445
3446
86
  helper_expr_range rhs_exprs() {
3447
86
    return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end());
3448
86
  }
3449
3450
126
  helper_expr_const_range reduction_ops() const {
3451
126
    return helper_expr_const_range(getReductionOps().begin(),
3452
126
                                   getReductionOps().end());
3453
126
  }
3454
3455
1.33k
  helper_expr_range reduction_ops() {
3456
1.33k
    return helper_expr_range(getReductionOps().begin(),
3457
1.33k
                             getReductionOps().end());
3458
1.33k
  }
3459
3460
2.26k
  child_range children() {
3461
2.26k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3462
2.26k
                       reinterpret_cast<Stmt **>(varlist_end()));
3463
2.26k
  }
3464
3465
0
  const_child_range children() const {
3466
0
    auto Children = const_cast<OMPTaskReductionClause *>(this)->children();
3467
0
    return const_child_range(Children.begin(), Children.end());
3468
0
  }
3469
3470
300
  child_range used_children() {
3471
300
    return child_range(child_iterator(), child_iterator());
3472
300
  }
3473
0
  const_child_range used_children() const {
3474
0
    return const_child_range(const_child_iterator(), const_child_iterator());
3475
0
  }
3476
3477
2.76k
  static bool classof(const OMPClause *T) {
3478
2.76k
    return T->getClauseKind() == llvm::omp::OMPC_task_reduction;
3479
2.76k
  }
3480
};
3481
3482
/// This represents clause 'in_reduction' in the '#pragma omp task' directives.
3483
///
3484
/// \code
3485
/// #pragma omp task in_reduction(+:a,b)
3486
/// \endcode
3487
/// In this example directive '#pragma omp task' has clause 'in_reduction' with
3488
/// operator '+' and the variables 'a' and 'b'.
3489
class OMPInReductionClause final
3490
    : public OMPVarListClause<OMPInReductionClause>,
3491
      public OMPClauseWithPostUpdate,
3492
      private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
3493
  friend class OMPClauseReader;
3494
  friend OMPVarListClause;
3495
  friend TrailingObjects;
3496
3497
  /// Location of ':'.
3498
  SourceLocation ColonLoc;
3499
3500
  /// Nested name specifier for C++.
3501
  NestedNameSpecifierLoc QualifierLoc;
3502
3503
  /// Name of custom operator.
3504
  DeclarationNameInfo NameInfo;
3505
3506
  /// Build clause with number of variables \a N.
3507
  ///
3508
  /// \param StartLoc Starting location of the clause.
3509
  /// \param LParenLoc Location of '('.
3510
  /// \param EndLoc Ending location of the clause.
3511
  /// \param ColonLoc Location of ':'.
3512
  /// \param N Number of the variables in the clause.
3513
  /// \param QualifierLoc The nested-name qualifier with location information
3514
  /// \param NameInfo The full name info for reduction identifier.
3515
  OMPInReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3516
                       SourceLocation ColonLoc, SourceLocation EndLoc,
3517
                       unsigned N, NestedNameSpecifierLoc QualifierLoc,
3518
                       const DeclarationNameInfo &NameInfo)
3519
      : OMPVarListClause<OMPInReductionClause>(llvm::omp::OMPC_in_reduction,
3520
                                               StartLoc, LParenLoc, EndLoc, N),
3521
        OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
3522
1.56k
        QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
3523
3524
  /// Build an empty clause.
3525
  ///
3526
  /// \param N Number of variables.
3527
  explicit OMPInReductionClause(unsigned N)
3528
      : OMPVarListClause<OMPInReductionClause>(
3529
            llvm::omp::OMPC_in_reduction, SourceLocation(), SourceLocation(),
3530
            SourceLocation(), N),
3531
78
        OMPClauseWithPostUpdate(this) {}
3532
3533
  /// Sets location of ':' symbol in clause.
3534
78
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
3535
3536
  /// Sets the name info for specified reduction identifier.
3537
78
  void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
3538
3539
  /// Sets the nested name specifier.
3540
78
  void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
3541
3542
  /// Set list of helper expressions, required for proper codegen of the clause.
3543
  /// These expressions represent private copy of the reduction variable.
3544
  void setPrivates(ArrayRef<Expr *> Privates);
3545
3546
  /// Get the list of helper privates.
3547
14.8k
  MutableArrayRef<Expr *> getPrivates() {
3548
14.8k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
3549
14.8k
  }
3550
304
  ArrayRef<const Expr *> getPrivates() const {
3551
304
    return llvm::makeArrayRef(varlist_end(), varlist_size());
3552
304
  }
3553
3554
  /// Set list of helper expressions, required for proper codegen of the clause.
3555
  /// These expressions represent LHS expression in the final reduction
3556
  /// expression performed by the reduction clause.
3557
  void setLHSExprs(ArrayRef<Expr *> LHSExprs);
3558
3559
  /// Get the list of helper LHS expressions.
3560
11.2k
  MutableArrayRef<Expr *> getLHSExprs() {
3561
11.2k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
3562
11.2k
  }
3563
208
  ArrayRef<const Expr *> getLHSExprs() const {
3564
208
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
3565
208
  }
3566
3567
  /// Set list of helper expressions, required for proper codegen of the clause.
3568
  /// These expressions represent RHS expression in the final reduction
3569
  /// expression performed by the reduction clause. Also, variables in these
3570
  /// expressions are used for proper initialization of reduction copies.
3571
  void setRHSExprs(ArrayRef<Expr *> RHSExprs);
3572
3573
  ///  Get the list of helper destination expressions.
3574
9.42k
  MutableArrayRef<Expr *> getRHSExprs() {
3575
9.42k
    return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
3576
9.42k
  }
3577
200
  ArrayRef<const Expr *> getRHSExprs() const {
3578
200
    return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
3579
200
  }
3580
3581
  /// Set list of helper reduction expressions, required for proper
3582
  /// codegen of the clause. These expressions are binary expressions or
3583
  /// operator/custom reduction call that calculates new value from source
3584
  /// helper expressions to destination helper expressions.
3585
  void setReductionOps(ArrayRef<Expr *> ReductionOps);
3586
3587
  ///  Get the list of helper reduction expressions.
3588
7.63k
  MutableArrayRef<Expr *> getReductionOps() {
3589
7.63k
    return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
3590
7.63k
  }
3591
192
  ArrayRef<const Expr *> getReductionOps() const {
3592
192
    return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
3593
192
  }
3594
3595
  /// Set list of helper reduction taskgroup descriptors.
3596
  void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
3597
3598
  ///  Get the list of helper reduction taskgroup descriptors.
3599
3.58k
  MutableArrayRef<Expr *> getTaskgroupDescriptors() {
3600
3.58k
    return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size());
3601
3.58k
  }
3602
96
  ArrayRef<const Expr *> getTaskgroupDescriptors() const {
3603
96
    return llvm::makeArrayRef(getReductionOps().end(), varlist_size());
3604
96
  }
3605
3606
public:
3607
  /// Creates clause with a list of variables \a VL.
3608
  ///
3609
  /// \param StartLoc Starting location of the clause.
3610
  /// \param LParenLoc Location of '('.
3611
  /// \param ColonLoc Location of ':'.
3612
  /// \param EndLoc Ending location of the clause.
3613
  /// \param VL The variables in the clause.
3614
  /// \param QualifierLoc The nested-name qualifier with location information
3615
  /// \param NameInfo The full name info for reduction identifier.
3616
  /// \param Privates List of helper expressions for proper generation of
3617
  /// private copies.
3618
  /// \param LHSExprs List of helper expressions for proper generation of
3619
  /// assignment operation required for copyprivate clause. This list represents
3620
  /// LHSs of the reduction expressions.
3621
  /// \param RHSExprs List of helper expressions for proper generation of
3622
  /// assignment operation required for copyprivate clause. This list represents
3623
  /// RHSs of the reduction expressions.
3624
  /// Also, variables in these expressions are used for proper initialization of
3625
  /// reduction copies.
3626
  /// \param ReductionOps List of helper expressions that represents reduction
3627
  /// expressions:
3628
  /// \code
3629
  /// LHSExprs binop RHSExprs;
3630
  /// operator binop(LHSExpr, RHSExpr);
3631
  /// <CutomReduction>(LHSExpr, RHSExpr);
3632
  /// \endcode
3633
  /// Required for proper codegen of final reduction operation performed by the
3634
  /// reduction clause.
3635
  /// \param TaskgroupDescriptors List of helper taskgroup descriptors for
3636
  /// corresponding items in parent taskgroup task_reduction clause.
3637
  /// \param PreInit Statement that must be executed before entering the OpenMP
3638
  /// region with this clause.
3639
  /// \param PostUpdate Expression that must be executed after exit from the
3640
  /// OpenMP region with this clause.
3641
  static OMPInReductionClause *
3642
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3643
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
3644
         NestedNameSpecifierLoc QualifierLoc,
3645
         const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
3646
         ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
3647
         ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
3648
         Stmt *PreInit, Expr *PostUpdate);
3649
3650
  /// Creates an empty clause with the place for \a N variables.
3651
  ///
3652
  /// \param C AST context.
3653
  /// \param N The number of variables.
3654
  static OMPInReductionClause *CreateEmpty(const ASTContext &C, unsigned N);
3655
3656
  /// Gets location of ':' symbol in clause.
3657
1.20k
  SourceLocation getColonLoc() const { return ColonLoc; }
3658
3659
  /// Gets the name info for specified reduction identifier.
3660
1.34k
  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
3661
3662
  /// Gets the nested name specifier.
3663
1.33k
  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
3664
3665
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
3666
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
3667
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
3668
  using helper_expr_const_range =
3669
      llvm::iterator_range<helper_expr_const_iterator>;
3670
3671
48
  helper_expr_const_range privates() const {
3672
48
    return helper_expr_const_range(getPrivates().begin(), getPrivates().end());
3673
48
  }
3674
3675
1.01k
  helper_expr_range privates() {
3676
1.01k
    return helper_expr_range(getPrivates().begin(), getPrivates().end());
3677
1.01k
  }
3678
3679
4
  helper_expr_const_range lhs_exprs() const {
3680
4
    return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end());
3681
4
  }
3682
3683
78
  helper_expr_range lhs_exprs() {
3684
78
    return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end());
3685
78
  }
3686
3687
4
  helper_expr_const_range rhs_exprs() const {
3688
4
    return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end());
3689
4
  }
3690
3691
78
  helper_expr_range rhs_exprs() {
3692
78
    return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end());
3693
78
  }
3694
3695
48
  helper_expr_const_range reduction_ops() const {
3696
48
    return helper_expr_const_range(getReductionOps().begin(),
3697
48
                                   getReductionOps().end());
3698
48
  }
3699
3700
1.20k
  helper_expr_range reduction_ops() {
3701
1.20k
    return helper_expr_range(getReductionOps().begin(),
3702
1.20k
                             getReductionOps().end());
3703
1.20k
  }
3704
3705
48
  helper_expr_const_range taskgroup_descriptors() const {
3706
48
    return helper_expr_const_range(getTaskgroupDescriptors().begin(),
3707
48
                                   getTaskgroupDescriptors().end());
3708
48
  }
3709
3710
1.79k
  helper_expr_range taskgroup_descriptors() {
3711
1.79k
    return helper_expr_range(getTaskgroupDescriptors().begin(),
3712
1.79k
                             getTaskgroupDescriptors().end());
3713
1.79k
  }
3714
3715
2.34k
  child_range children() {
3716
2.34k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3717
2.34k
                       reinterpret_cast<Stmt **>(varlist_end()));
3718
2.34k
  }
3719
3720
0
  const_child_range children() const {
3721
0
    auto Children = const_cast<OMPInReductionClause *>(this)->children();
3722
0
    return const_child_range(Children.begin(), Children.end());
3723
0
  }
3724
3725
352
  child_range used_children() {
3726
352
    return child_range(child_iterator(), child_iterator());
3727
352
  }
3728
0
  const_child_range used_children() const {
3729
0
    return const_child_range(const_child_iterator(), const_child_iterator());
3730
0
  }
3731
3732
109k
  static bool classof(const OMPClause *T) {
3733
109k
    return T->getClauseKind() == llvm::omp::OMPC_in_reduction;
3734
109k
  }
3735
};
3736
3737
/// This represents clause 'linear' in the '#pragma omp ...'
3738
/// directives.
3739
///
3740
/// \code
3741
/// #pragma omp simd linear(a,b : 2)
3742
/// \endcode
3743
/// In this example directive '#pragma omp simd' has clause 'linear'
3744
/// with variables 'a', 'b' and linear step '2'.
3745
class OMPLinearClause final
3746
    : public OMPVarListClause<OMPLinearClause>,
3747
      public OMPClauseWithPostUpdate,
3748
      private llvm::TrailingObjects<OMPLinearClause, Expr *> {
3749
  friend class OMPClauseReader;
3750
  friend OMPVarListClause;
3751
  friend TrailingObjects;
3752
3753
  /// Modifier of 'linear' clause.
3754
  OpenMPLinearClauseKind Modifier = OMPC_LINEAR_val;
3755
3756
  /// Location of linear modifier if any.
3757
  SourceLocation ModifierLoc;
3758
3759
  /// Location of ':'.
3760
  SourceLocation ColonLoc;
3761
3762
  /// Sets the linear step for clause.
3763
2.98k
  void setStep(Expr *Step) { *(getFinals().end()) = Step; }
3764
3765
  /// Sets the expression to calculate linear step for clause.
3766
2.98k
  void setCalcStep(Expr *CalcStep) { *(getFinals().end() + 1) = CalcStep; }
3767
3768
  /// Build 'linear' clause with given number of variables \a NumVars.
3769
  ///
3770
  /// \param StartLoc Starting location of the clause.
3771
  /// \param LParenLoc Location of '('.
3772
  /// \param ColonLoc Location of ':'.
3773
  /// \param EndLoc Ending location of the clause.
3774
  /// \param NumVars Number of variables.
3775
  OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3776
                  OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
3777
                  SourceLocation ColonLoc, SourceLocation EndLoc,
3778
                  unsigned NumVars)
3779
      : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear, StartLoc,
3780
                                          LParenLoc, EndLoc, NumVars),
3781
        OMPClauseWithPostUpdate(this), Modifier(Modifier),
3782
2.61k
        ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {}
3783
3784
  /// Build an empty clause.
3785
  ///
3786
  /// \param NumVars Number of variables.
3787
  explicit OMPLinearClause(unsigned NumVars)
3788
      : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear,
3789
                                          SourceLocation(), SourceLocation(),
3790
                                          SourceLocation(), NumVars),
3791
374
        OMPClauseWithPostUpdate(this) {}
3792
3793
  /// Gets the list of initial values for linear variables.
3794
  ///
3795
  /// There are NumVars expressions with initial values allocated after the
3796
  /// varlist, they are followed by NumVars update expressions (used to update
3797
  /// the linear variable's value on current iteration) and they are followed by
3798
  /// NumVars final expressions (used to calculate the linear variable's
3799
  /// value after the loop body). After these lists, there are 2 helper
3800
  /// expressions - linear step and a helper to calculate it before the
3801
  /// loop body (used when the linear step is not constant):
3802
  ///
3803
  /// { Vars[] /* in OMPVarListClause */; Privates[]; Inits[]; Updates[];
3804
  /// Finals[]; Step; CalcStep; }
3805
58.9k
  MutableArrayRef<Expr *> getPrivates() {
3806
58.9k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
3807
58.9k
  }
3808
7.38k
  ArrayRef<const Expr *> getPrivates() const {
3809
7.38k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
3810
7.38k
  }
3811
3812
47.7k
  MutableArrayRef<Expr *> getInits() {
3813
47.7k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
3814
47.7k
  }
3815
5.82k
  ArrayRef<const Expr *> getInits() const {
3816
5.82k
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
3817
5.82k
  }
3818
3819
  /// Sets the list of update expressions for linear variables.
3820
35.4k
  MutableArrayRef<Expr *> getUpdates() {
3821
35.4k
    return MutableArrayRef<Expr *>(getInits().end(), varlist_size());
3822
35.4k
  }
3823
4.26k
  ArrayRef<const Expr *> getUpdates() const {
3824
4.26k
    return llvm::makeArrayRef(getInits().end(), varlist_size());
3825
4.26k
  }
3826
3827
  /// Sets the list of final update expressions for linear variables.
3828
27.0k
  MutableArrayRef<Expr *> getFinals() {
3829
27.0k
    return MutableArrayRef<Expr *>(getUpdates().end(), varlist_size());
3830
27.0k
  }
3831
2.89k
  ArrayRef<const Expr *> getFinals() const {
3832
2.89k
    return llvm::makeArrayRef(getUpdates().end(), varlist_size());
3833
2.89k
  }
3834
3835
  /// Gets the list of used expressions for linear variables.
3836
10.1k
  MutableArrayRef<Expr *> getUsedExprs() {
3837
10.1k
    return MutableArrayRef<Expr *>(getFinals().end() + 2, varlist_size() + 1);
3838
10.1k
  }
3839
0
  ArrayRef<const Expr *> getUsedExprs() const {
3840
0
    return llvm::makeArrayRef(getFinals().end() + 2, varlist_size() + 1);
3841
0
  }
3842
3843
  /// Sets the list of the copies of original linear variables.
3844
  /// \param PL List of expressions.
3845
  void setPrivates(ArrayRef<Expr *> PL);
3846
3847
  /// Sets the list of the initial values for linear variables.
3848
  /// \param IL List of expressions.
3849
  void setInits(ArrayRef<Expr *> IL);
3850
3851
public:
3852
  /// Creates clause with a list of variables \a VL and a linear step
3853
  /// \a Step.
3854
  ///
3855
  /// \param C AST Context.
3856
  /// \param StartLoc Starting location of the clause.
3857
  /// \param LParenLoc Location of '('.
3858
  /// \param Modifier Modifier of 'linear' clause.
3859
  /// \param ModifierLoc Modifier location.
3860
  /// \param ColonLoc Location of ':'.
3861
  /// \param EndLoc Ending location of the clause.
3862
  /// \param VL List of references to the variables.
3863
  /// \param PL List of private copies of original variables.
3864
  /// \param IL List of initial values for the variables.
3865
  /// \param Step Linear step.
3866
  /// \param CalcStep Calculation of the linear step.
3867
  /// \param PreInit Statement that must be executed before entering the OpenMP
3868
  /// region with this clause.
3869
  /// \param PostUpdate Expression that must be executed after exit from the
3870
  /// OpenMP region with this clause.
3871
  static OMPLinearClause *
3872
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3873
         OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
3874
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
3875
         ArrayRef<Expr *> PL, ArrayRef<Expr *> IL, Expr *Step, Expr *CalcStep,
3876
         Stmt *PreInit, Expr *PostUpdate);
3877
3878
  /// Creates an empty clause with the place for \a NumVars variables.
3879
  ///
3880
  /// \param C AST context.
3881
  /// \param NumVars Number of variables.
3882
  static OMPLinearClause *CreateEmpty(const ASTContext &C, unsigned NumVars);
3883
3884
  /// Set modifier.
3885
374
  void setModifier(OpenMPLinearClauseKind Kind) { Modifier = Kind; }
3886
3887
  /// Return modifier.
3888
2.93k
  OpenMPLinearClauseKind getModifier() const { return Modifier; }
3889
3890
  /// Set modifier location.
3891
374
  void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; }
3892
3893
  /// Return modifier location.
3894
1.74k
  SourceLocation getModifierLoc() const { return ModifierLoc; }
3895
3896
  /// Sets the location of ':'.
3897
374
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3898
3899
  /// Returns the location of ':'.
3900
908
  SourceLocation getColonLoc() const { return ColonLoc; }
3901
3902
  /// Returns linear step.
3903
5.46k
  Expr *getStep() { return *(getFinals().end()); }
3904
3905
  /// Returns linear step.
3906
486
  const Expr *getStep() const { return *(getFinals().end()); }
3907
3908
  /// Returns expression to calculate linear step.
3909
2.36k
  Expr *getCalcStep() { return *(getFinals().end() + 1); }
3910
3911
  /// Returns expression to calculate linear step.
3912
848
  const Expr *getCalcStep() const { return *(getFinals().end() + 1); }
3913
3914
  /// Sets the list of update expressions for linear variables.
3915
  /// \param UL List of expressions.
3916
  void setUpdates(ArrayRef<Expr *> UL);
3917
3918
  /// Sets the list of final update expressions for linear variables.
3919
  /// \param FL List of expressions.
3920
  void setFinals(ArrayRef<Expr *> FL);
3921
3922
  /// Sets the list of used expressions for the linear clause.
3923
  void setUsedExprs(ArrayRef<Expr *> UE);
3924
3925
  using privates_iterator = MutableArrayRef<Expr *>::iterator;
3926
  using privates_const_iterator = ArrayRef<const Expr *>::iterator;
3927
  using privates_range = llvm::iterator_range<privates_iterator>;
3928
  using privates_const_range = llvm::iterator_range<privates_const_iterator>;
3929
3930
4.13k
  privates_range privates() {
3931
4.13k
    return privates_range(getPrivates().begin(), getPrivates().end());
3932
4.13k
  }
3933
3934
780
  privates_const_range privates() const {
3935
780
    return privates_const_range(getPrivates().begin(), getPrivates().end());
3936
780
  }
3937
3938
  using inits_iterator = MutableArrayRef<Expr *>::iterator;
3939
  using inits_const_iterator = ArrayRef<const Expr *>::iterator;
3940
  using inits_range = llvm::iterator_range<inits_iterator>;
3941
  using inits_const_range = llvm::iterator_range<inits_const_iterator>;
3942
3943
2.36k
  inits_range inits() {
3944
2.36k
    return inits_range(getInits().begin(), getInits().end());
3945
2.36k
  }
3946
3947
780
  inits_const_range inits() const {
3948
780
    return inits_const_range(getInits().begin(), getInits().end());
3949
780
  }
3950
3951
  using updates_iterator = MutableArrayRef<Expr *>::iterator;
3952
  using updates_const_iterator = ArrayRef<const Expr *>::iterator;
3953
  using updates_range = llvm::iterator_range<updates_iterator>;
3954
  using updates_const_range = llvm::iterator_range<updates_const_iterator>;
3955
3956
383
  updates_range updates() {
3957
383
    return updates_range(getUpdates().begin(), getUpdates().end());
3958
383
  }
3959
3960
684
  updates_const_range updates() const {
3961
684
    return updates_const_range(getUpdates().begin(), getUpdates().end());
3962
684
  }
3963
3964
  using finals_iterator = MutableArrayRef<Expr *>::iterator;
3965
  using finals_const_iterator = ArrayRef<const Expr *>::iterator;
3966
  using finals_range = llvm::iterator_range<finals_iterator>;
3967
  using finals_const_range = llvm::iterator_range<finals_const_iterator>;
3968
3969
383
  finals_range finals() {
3970
383
    return finals_range(getFinals().begin(), getFinals().end());
3971
383
  }
3972
3973
780
  finals_const_range finals() const {
3974
780
    return finals_const_range(getFinals().begin(), getFinals().end());
3975
780
  }
3976
3977
  using used_expressions_iterator = MutableArrayRef<Expr *>::iterator;
3978
  using used_expressions_const_iterator = ArrayRef<const Expr *>::iterator;
3979
  using used_expressions_range =
3980
      llvm::iterator_range<used_expressions_iterator>;
3981
  using used_expressions_const_range =
3982
      llvm::iterator_range<used_expressions_const_iterator>;
3983
3984
374
  used_expressions_range used_expressions() {
3985
374
    return finals_range(getUsedExprs().begin(), getUsedExprs().end());
3986
374
  }
3987
3988
0
  used_expressions_const_range used_expressions() const {
3989
0
    return finals_const_range(getUsedExprs().begin(), getUsedExprs().end());
3990
0
  }
3991
3992
2.95k
  child_range children() {
3993
2.95k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3994
2.95k
                       reinterpret_cast<Stmt **>(varlist_end()));
3995
2.95k
  }
3996
3997
0
  const_child_range children() const {
3998
0
    auto Children = const_cast<OMPLinearClause *>(this)->children();
3999
0
    return const_child_range(Children.begin(), Children.end());
4000
0
  }
4001
4002
  child_range used_children();
4003
4004
0
  const_child_range used_children() const {
4005
0
    auto Children = const_cast<OMPLinearClause *>(this)->used_children();
4006
0
    return const_child_range(Children.begin(), Children.end());
4007
0
  }
4008
4009
161k
  static bool classof(const OMPClause *T) {
4010
161k
    return T->getClauseKind() == llvm::omp::OMPC_linear;
4011
161k
  }
4012
};
4013
4014
/// This represents clause 'aligned' in the '#pragma omp ...'
4015
/// directives.
4016
///
4017
/// \code
4018
/// #pragma omp simd aligned(a,b : 8)
4019
/// \endcode
4020
/// In this example directive '#pragma omp simd' has clause 'aligned'
4021
/// with variables 'a', 'b' and alignment '8'.
4022
class OMPAlignedClause final
4023
    : public OMPVarListClause<OMPAlignedClause>,
4024
      private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
4025
  friend class OMPClauseReader;
4026
  friend OMPVarListClause;
4027
  friend TrailingObjects;
4028
4029
  /// Location of ':'.
4030
  SourceLocation ColonLoc;
4031
4032
  /// Sets the alignment for clause.
4033
1.94k
  void setAlignment(Expr *A) { *varlist_end() = A; }
4034
4035
  /// Build 'aligned' clause with given number of variables \a NumVars.
4036
  ///
4037
  /// \param StartLoc Starting location of the clause.
4038
  /// \param LParenLoc Location of '('.
4039
  /// \param ColonLoc Location of ':'.
4040
  /// \param EndLoc Ending location of the clause.
4041
  /// \param NumVars Number of variables.
4042
  OMPAlignedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
4043
                   SourceLocation ColonLoc, SourceLocation EndLoc,
4044
                   unsigned NumVars)
4045
      : OMPVarListClause<OMPAlignedClause>(llvm::omp::OMPC_aligned, StartLoc,
4046
                                           LParenLoc, EndLoc, NumVars),
4047
1.69k
        ColonLoc(ColonLoc) {}
4048
4049
  /// Build an empty clause.
4050
  ///
4051
  /// \param NumVars Number of variables.
4052
  explicit OMPAlignedClause(unsigned NumVars)
4053
      : OMPVarListClause<OMPAlignedClause>(llvm::omp::OMPC_aligned,
4054
                                           SourceLocation(), SourceLocation(),
4055
250
                                           SourceLocation(), NumVars) {}
4056
4057
public:
4058
  /// Creates clause with a list of variables \a VL and alignment \a A.
4059
  ///
4060
  /// \param C AST Context.
4061
  /// \param StartLoc Starting location of the clause.
4062
  /// \param LParenLoc Location of '('.
4063
  /// \param ColonLoc Location of ':'.
4064
  /// \param EndLoc Ending location of the clause.
4065
  /// \param VL List of references to the variables.
4066
  /// \param A Alignment.
4067
  static OMPAlignedClause *Create(const ASTContext &C, SourceLocation StartLoc,
4068
                                  SourceLocation LParenLoc,
4069
                                  SourceLocation ColonLoc,
4070
                                  SourceLocation EndLoc, ArrayRef<Expr *> VL,
4071
                                  Expr *A);
4072
4073
  /// Creates an empty clause with the place for \a NumVars variables.
4074
  ///
4075
  /// \param C AST context.
4076
  /// \param NumVars Number of variables.
4077
  static OMPAlignedClause *CreateEmpty(const ASTContext &C, unsigned NumVars);
4078
4079
  /// Sets the location of ':'.
4080
250
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
4081
4082
  /// Returns the location of ':'.
4083
718
  SourceLocation getColonLoc() const { return ColonLoc; }
4084
4085
  /// Returns alignment.
4086
1.42k
  Expr *getAlignment() { return *varlist_end(); }
4087