Coverage Report

Created: 2020-09-15 12:33

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