Coverage Report

Created: 2020-11-24 06:42

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