Coverage Report

Created: 2018-09-23 22:08

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/AST/OpenMPClause.h
Line
Count
Source (jump to first uncovered line)
1
//===- OpenMPClause.h - Classes for OpenMP clauses --------------*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
/// \file
11
/// This file defines OpenMP AST classes for clauses.
12
/// There are clauses for executable directives, clauses for declarative
13
/// directives and clauses which can be used in both kinds of directives.
14
//
15
//===----------------------------------------------------------------------===//
16
17
#ifndef LLVM_CLANG_AST_OPENMPCLAUSE_H
18
#define LLVM_CLANG_AST_OPENMPCLAUSE_H
19
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/Support/Casting.h"
35
#include "llvm/Support/Compiler.h"
36
#include "llvm/Support/TrailingObjects.h"
37
#include <cassert>
38
#include <cstddef>
39
#include <iterator>
40
#include <utility>
41
42
namespace clang {
43
44
class ASTContext;
45
46
//===----------------------------------------------------------------------===//
47
// AST classes for clauses.
48
//===----------------------------------------------------------------------===//
49
50
/// This is a basic class for representing single OpenMP clause.
51
class OMPClause {
52
  /// Starting location of the clause (the clause keyword).
53
  SourceLocation StartLoc;
54
55
  /// Ending location of the clause.
56
  SourceLocation EndLoc;
57
58
  /// Kind of the clause.
59
  OpenMPClauseKind Kind;
60
61
protected:
62
  OMPClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
63
108k
      : StartLoc(StartLoc), EndLoc(EndLoc), Kind(K) {}
64
65
public:
66
  /// Returns the starting location of the clause.
67
44.1k
  SourceLocation getBeginLoc() const { return StartLoc; }
68
69
  /// Returns the ending location of the clause.
70
41.7k
  SourceLocation getEndLoc() const { return EndLoc; }
71
72
  /// Sets the starting location of the clause.
73
11.9k
  void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
74
75
  /// Sets the ending location of the clause.
76
11.9k
  void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
77
78
  /// Returns kind of OpenMP clause (private, shared, reduction, etc.).
79
1.37M
  OpenMPClauseKind getClauseKind() const { return Kind; }
80
81
16.7k
  bool isImplicit() const { return StartLoc.isInvalid(); }
82
83
  using child_iterator = StmtIterator;
84
  using const_child_iterator = ConstStmtIterator;
85
  using child_range = llvm::iterator_range<child_iterator>;
86
  using const_child_range = llvm::iterator_range<const_child_iterator>;
87
88
  child_range children();
89
0
  const_child_range children() const {
90
0
    auto Children = const_cast<OMPClause *>(this)->children();
91
0
    return const_child_range(Children.begin(), Children.end());
92
0
  }
93
94
  static bool classof(const OMPClause *) { return true; }
95
};
96
97
/// Class that handles pre-initialization statement for some clauses, like
98
/// 'shedule', 'firstprivate' etc.
99
class OMPClauseWithPreInit {
100
  friend class OMPClauseReader;
101
102
  /// Pre-initialization statement for the clause.
103
  Stmt *PreInit = nullptr;
104
105
  /// Region that captures the associated stmt.
106
  OpenMPDirectiveKind CaptureRegion = OMPD_unknown;
107
108
protected:
109
59.7k
  OMPClauseWithPreInit(const OMPClause *This) {
110
59.7k
    assert(get(This) && "get is not tuned for pre-init.");
111
59.7k
  }
112
113
  /// Set pre-initialization statement for the clause.
114
59.7k
  void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion = OMPD_unknown) {
115
59.7k
    PreInit = S;
116
59.7k
    CaptureRegion = ThisRegion;
117
59.7k
  }
118
119
public:
120
  /// Get pre-initialization statement for the clause.
121
41.0k
  const Stmt *getPreInitStmt() const { return PreInit; }
122
123
  /// Get pre-initialization statement for the clause.
124
6.47k
  Stmt *getPreInitStmt() { return PreInit; }
125
126
  /// Get capture region for the stmt in the clause.
127
37.2k
  OpenMPDirectiveKind getCaptureRegion() const { return CaptureRegion; }
128
129
  static OMPClauseWithPreInit *get(OMPClause *C);
130
  static const OMPClauseWithPreInit *get(const OMPClause *C);
131
};
132
133
/// Class that handles post-update expression for some clauses, like
134
/// 'lastprivate', 'reduction' etc.
135
class OMPClauseWithPostUpdate : public OMPClauseWithPreInit {
136
  friend class OMPClauseReader;
137
138
  /// Post-update expression for the clause.
139
  Expr *PostUpdate = nullptr;
140
141
protected:
142
18.6k
  OMPClauseWithPostUpdate(const OMPClause *This) : OMPClauseWithPreInit(This) {
143
18.6k
    assert(get(This) && "get is not tuned for post-update.");
144
18.6k
  }
145
146
  /// Set pre-initialization statement for the clause.
147
18.6k
  void setPostUpdateExpr(Expr *S) { PostUpdate = S; }
148
149
public:
150
  /// Get post-update expression for the clause.
151
1.94k
  const Expr *getPostUpdateExpr() const { return PostUpdate; }
152
153
  /// Get post-update expression for the clause.
154
1.20k
  Expr *getPostUpdateExpr() { return PostUpdate; }
155
156
  static OMPClauseWithPostUpdate *get(OMPClause *C);
157
  static const OMPClauseWithPostUpdate *get(const OMPClause *C);
158
};
159
160
/// This represents clauses with the list of variables like 'private',
161
/// 'firstprivate', 'copyin', 'shared', or 'reduction' clauses in the
162
/// '#pragma omp ...' directives.
163
template <class T> class OMPVarListClause : public OMPClause {
164
  friend class OMPClauseReader;
165
166
  /// Location of '('.
167
  SourceLocation LParenLoc;
168
169
  /// Number of variables in the list.
170
  unsigned NumVars;
171
172
protected:
173
  /// Build a clause with \a N variables
174
  ///
175
  /// \param K Kind of the clause.
176
  /// \param StartLoc Starting location of the clause (the clause keyword).
177
  /// \param LParenLoc Location of '('.
178
  /// \param EndLoc Ending location of the clause.
179
  /// \param N Number of the variables in the clause.
180
  OMPVarListClause(OpenMPClauseKind K, SourceLocation StartLoc,
181
                   SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
182
75.5k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPPrivateClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
8.53k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPFirstprivateClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
23.1k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPLastprivateClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
3.02k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPSharedClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
2.18k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPLinearClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
2.05k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPAlignedClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
1.27k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPCopyinClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
380
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPCopyprivateClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
158
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPReductionClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
11.2k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPTaskReductionClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
1.46k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPInReductionClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
862
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPFlushClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
60
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPDependClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
2.71k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPMapClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
14.3k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPToClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
748
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPFromClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
394
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
428
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::OMPVarListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int)
Line
Count
Source
182
2.54k
      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
183
184
  /// Fetches list of variables associated with this clause.
185
360k
  MutableArrayRef<Expr *> getVarRefs() {
186
360k
    return MutableArrayRef<Expr *>(
187
360k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
360k
  }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::getVarRefs()
Line
Count
Source
185
74.4k
  MutableArrayRef<Expr *> getVarRefs() {
186
74.4k
    return MutableArrayRef<Expr *>(
187
74.4k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
74.4k
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::getVarRefs()
Line
Count
Source
185
30.4k
  MutableArrayRef<Expr *> getVarRefs() {
186
30.4k
    return MutableArrayRef<Expr *>(
187
30.4k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
30.4k
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::getVarRefs()
Line
Count
Source
185
41.2k
  MutableArrayRef<Expr *> getVarRefs() {
186
41.2k
    return MutableArrayRef<Expr *>(
187
41.2k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
41.2k
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::getVarRefs()
Line
Count
Source
185
2.61k
  MutableArrayRef<Expr *> getVarRefs() {
186
2.61k
    return MutableArrayRef<Expr *>(
187
2.61k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
2.61k
  }
clang::OMPVarListClause<clang::OMPReductionClause>::getVarRefs()
Line
Count
Source
185
109k
  MutableArrayRef<Expr *> getVarRefs() {
186
109k
    return MutableArrayRef<Expr *>(
187
109k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
109k
  }
clang::OMPVarListClause<clang::OMPLinearClause>::getVarRefs()
Line
Count
Source
185
38.3k
  MutableArrayRef<Expr *> getVarRefs() {
186
38.3k
    return MutableArrayRef<Expr *>(
187
38.3k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
38.3k
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::getVarRefs()
Line
Count
Source
185
4.13k
  MutableArrayRef<Expr *> getVarRefs() {
186
4.13k
    return MutableArrayRef<Expr *>(
187
4.13k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
4.13k
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::getVarRefs()
Line
Count
Source
185
1.21k
  MutableArrayRef<Expr *> getVarRefs() {
186
1.21k
    return MutableArrayRef<Expr *>(
187
1.21k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
1.21k
  }
clang::OMPVarListClause<clang::OMPDependClause>::getVarRefs()
Line
Count
Source
185
5.02k
  MutableArrayRef<Expr *> getVarRefs() {
186
5.02k
    return MutableArrayRef<Expr *>(
187
5.02k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
5.02k
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::getVarRefs()
Line
Count
Source
185
12.6k
  MutableArrayRef<Expr *> getVarRefs() {
186
12.6k
    return MutableArrayRef<Expr *>(
187
12.6k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
12.6k
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::getVarRefs()
Line
Count
Source
185
12.5k
  MutableArrayRef<Expr *> getVarRefs() {
186
12.5k
    return MutableArrayRef<Expr *>(
187
12.5k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
12.5k
  }
clang::OMPVarListClause<clang::OMPFlushClause>::getVarRefs()
Line
Count
Source
185
104
  MutableArrayRef<Expr *> getVarRefs() {
186
104
    return MutableArrayRef<Expr *>(
187
104
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
104
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::getVarRefs()
Line
Count
Source
185
1.76k
  MutableArrayRef<Expr *> getVarRefs() {
186
1.76k
    return MutableArrayRef<Expr *>(
187
1.76k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
1.76k
  }
clang::OMPVarListClause<clang::OMPSharedClause>::getVarRefs()
Line
Count
Source
185
3.60k
  MutableArrayRef<Expr *> getVarRefs() {
186
3.60k
    return MutableArrayRef<Expr *>(
187
3.60k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
3.60k
  }
clang::OMPVarListClause<clang::OMPMapClause>::getVarRefs()
Line
Count
Source
185
15.6k
  MutableArrayRef<Expr *> getVarRefs() {
186
15.6k
    return MutableArrayRef<Expr *>(
187
15.6k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
15.6k
  }
clang::OMPVarListClause<clang::OMPToClause>::getVarRefs()
Line
Count
Source
185
568
  MutableArrayRef<Expr *> getVarRefs() {
186
568
    return MutableArrayRef<Expr *>(
187
568
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
568
  }
clang::OMPVarListClause<clang::OMPFromClause>::getVarRefs()
Line
Count
Source
185
412
  MutableArrayRef<Expr *> getVarRefs() {
186
412
    return MutableArrayRef<Expr *>(
187
412
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
412
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::getVarRefs()
Line
Count
Source
185
5.79k
  MutableArrayRef<Expr *> getVarRefs() {
186
5.79k
    return MutableArrayRef<Expr *>(
187
5.79k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
5.79k
  }
189
190
  /// Sets the list of variables for this clause.
191
75.5k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
75.5k
    assert(VL.size() == NumVars &&
193
75.5k
           "Number of variables is not the same as the preallocated buffer");
194
75.5k
    std::copy(VL.begin(), VL.end(),
195
75.5k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
75.5k
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
8.53k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
8.53k
    assert(VL.size() == NumVars &&
193
8.53k
           "Number of variables is not the same as the preallocated buffer");
194
8.53k
    std::copy(VL.begin(), VL.end(),
195
8.53k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
8.53k
  }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
23.1k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
23.1k
    assert(VL.size() == NumVars &&
193
23.1k
           "Number of variables is not the same as the preallocated buffer");
194
23.1k
    std::copy(VL.begin(), VL.end(),
195
23.1k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
23.1k
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
3.02k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
3.02k
    assert(VL.size() == NumVars &&
193
3.02k
           "Number of variables is not the same as the preallocated buffer");
194
3.02k
    std::copy(VL.begin(), VL.end(),
195
3.02k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
3.02k
  }
clang::OMPVarListClause<clang::OMPSharedClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
2.18k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
2.18k
    assert(VL.size() == NumVars &&
193
2.18k
           "Number of variables is not the same as the preallocated buffer");
194
2.18k
    std::copy(VL.begin(), VL.end(),
195
2.18k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
2.18k
  }
clang::OMPVarListClause<clang::OMPReductionClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
11.2k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
11.2k
    assert(VL.size() == NumVars &&
193
11.2k
           "Number of variables is not the same as the preallocated buffer");
194
11.2k
    std::copy(VL.begin(), VL.end(),
195
11.2k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
11.2k
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
1.46k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
1.46k
    assert(VL.size() == NumVars &&
193
1.46k
           "Number of variables is not the same as the preallocated buffer");
194
1.46k
    std::copy(VL.begin(), VL.end(),
195
1.46k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
1.46k
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
862
  void setVarRefs(ArrayRef<Expr *> VL) {
192
862
    assert(VL.size() == NumVars &&
193
862
           "Number of variables is not the same as the preallocated buffer");
194
862
    std::copy(VL.begin(), VL.end(),
195
862
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
862
  }
clang::OMPVarListClause<clang::OMPLinearClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
2.05k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
2.05k
    assert(VL.size() == NumVars &&
193
2.05k
           "Number of variables is not the same as the preallocated buffer");
194
2.05k
    std::copy(VL.begin(), VL.end(),
195
2.05k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
2.05k
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
1.27k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
1.27k
    assert(VL.size() == NumVars &&
193
1.27k
           "Number of variables is not the same as the preallocated buffer");
194
1.27k
    std::copy(VL.begin(), VL.end(),
195
1.27k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
1.27k
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
380
  void setVarRefs(ArrayRef<Expr *> VL) {
192
380
    assert(VL.size() == NumVars &&
193
380
           "Number of variables is not the same as the preallocated buffer");
194
380
    std::copy(VL.begin(), VL.end(),
195
380
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
380
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
158
  void setVarRefs(ArrayRef<Expr *> VL) {
192
158
    assert(VL.size() == NumVars &&
193
158
           "Number of variables is not the same as the preallocated buffer");
194
158
    std::copy(VL.begin(), VL.end(),
195
158
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
158
  }
clang::OMPVarListClause<clang::OMPFlushClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
60
  void setVarRefs(ArrayRef<Expr *> VL) {
192
60
    assert(VL.size() == NumVars &&
193
60
           "Number of variables is not the same as the preallocated buffer");
194
60
    std::copy(VL.begin(), VL.end(),
195
60
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
60
  }
clang::OMPVarListClause<clang::OMPDependClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
2.71k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
2.71k
    assert(VL.size() == NumVars &&
193
2.71k
           "Number of variables is not the same as the preallocated buffer");
194
2.71k
    std::copy(VL.begin(), VL.end(),
195
2.71k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
2.71k
  }
clang::OMPVarListClause<clang::OMPMapClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
14.3k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
14.3k
    assert(VL.size() == NumVars &&
193
14.3k
           "Number of variables is not the same as the preallocated buffer");
194
14.3k
    std::copy(VL.begin(), VL.end(),
195
14.3k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
14.3k
  }
clang::OMPVarListClause<clang::OMPToClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
748
  void setVarRefs(ArrayRef<Expr *> VL) {
192
748
    assert(VL.size() == NumVars &&
193
748
           "Number of variables is not the same as the preallocated buffer");
194
748
    std::copy(VL.begin(), VL.end(),
195
748
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
748
  }
clang::OMPVarListClause<clang::OMPFromClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
394
  void setVarRefs(ArrayRef<Expr *> VL) {
192
394
    assert(VL.size() == NumVars &&
193
394
           "Number of variables is not the same as the preallocated buffer");
194
394
    std::copy(VL.begin(), VL.end(),
195
394
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
394
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
428
  void setVarRefs(ArrayRef<Expr *> VL) {
192
428
    assert(VL.size() == NumVars &&
193
428
           "Number of variables is not the same as the preallocated buffer");
194
428
    std::copy(VL.begin(), VL.end(),
195
428
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
428
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>)
Line
Count
Source
191
2.54k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
2.54k
    assert(VL.size() == NumVars &&
193
2.54k
           "Number of variables is not the same as the preallocated buffer");
194
2.54k
    std::copy(VL.begin(), VL.end(),
195
2.54k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
2.54k
  }
197
198
public:
199
  using varlist_iterator = MutableArrayRef<Expr *>::iterator;
200
  using varlist_const_iterator = ArrayRef<const Expr *>::iterator;
201
  using varlist_range = llvm::iterator_range<varlist_iterator>;
202
  using varlist_const_range = llvm::iterator_range<varlist_const_iterator>;
203
204
591k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_size() const
Line
Count
Source
204
13.6k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_size() const
Line
Count
Source
204
98.8k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPToClause>::varlist_size() const
Line
Count
Source
204
3.50k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_size() const
Line
Count
Source
204
2.07k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_size() const
Line
Count
Source
204
4.13k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_size() const
Line
Count
Source
204
92.9k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_size() const
Line
Count
Source
204
8.86k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_size() const
Line
Count
Source
204
2.63k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_size() const
Line
Count
Source
204
42.4k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_size() const
Line
Count
Source
204
184k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_size() const
Line
Count
Source
204
85.9k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_size() const
Line
Count
Source
204
1.23k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_size() const
Line
Count
Source
204
28.7k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_size() const
Line
Count
Source
204
18.3k
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_size() const
Line
Count
Source
204
994
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_size() const
Line
Count
Source
204
604
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_size() const
Line
Count
Source
204
36
  unsigned varlist_size() const { return NumVars; }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_size() const
Line
Count
Source
204
1.43k
  unsigned varlist_size() const { return NumVars; }
205
7.75k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_empty() const
Line
Count
Source
205
1.71k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_empty() const
Line
Count
Source
205
648
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_empty() const
Line
Count
Source
205
264
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_empty() const
Line
Count
Source
205
400
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_empty() const
Line
Count
Source
205
908
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_empty() const
Line
Count
Source
205
224
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_empty() const
Line
Count
Source
205
192
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_empty() const
Line
Count
Source
205
100
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_empty() const
Line
Count
Source
205
32
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_empty() const
Line
Count
Source
205
16
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_empty() const
Line
Count
Source
205
404
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_empty() const
Line
Count
Source
205
1.50k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPToClause>::varlist_empty() const
Line
Count
Source
205
16
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_empty() const
Line
Count
Source
205
16
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_empty() const
Line
Count
Source
205
20
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_empty() const
Line
Count
Source
205
1.13k
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_empty() const
Line
Count
Source
205
104
  bool varlist_empty() const { return NumVars == 0; }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_empty() const
Line
Count
Source
205
60
  bool varlist_empty() const { return NumVars == 0; }
206
207
31.3k
  varlist_range varlists() {
208
31.3k
    return varlist_range(varlist_begin(), varlist_end());
209
31.3k
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlists()
Line
Count
Source
207
3.49k
  varlist_range varlists() {
208
3.49k
    return varlist_range(varlist_begin(), varlist_end());
209
3.49k
  }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlists()
Line
Count
Source
207
3.06k
  varlist_range varlists() {
208
3.06k
    return varlist_range(varlist_begin(), varlist_end());
209
3.06k
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlists()
Line
Count
Source
207
3.65k
  varlist_range varlists() {
208
3.65k
    return varlist_range(varlist_begin(), varlist_end());
209
3.65k
  }
clang::OMPVarListClause<clang::OMPSharedClause>::varlists()
Line
Count
Source
207
838
  varlist_range varlists() {
208
838
    return varlist_range(varlist_begin(), varlist_end());
209
838
  }
clang::OMPVarListClause<clang::OMPReductionClause>::varlists()
Line
Count
Source
207
8.22k
  varlist_range varlists() {
208
8.22k
    return varlist_range(varlist_begin(), varlist_end());
209
8.22k
  }
clang::OMPVarListClause<clang::OMPLinearClause>::varlists()
Line
Count
Source
207
1.98k
  varlist_range varlists() {
208
1.98k
    return varlist_range(varlist_begin(), varlist_end());
209
1.98k
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlists()
Line
Count
Source
207
472
  varlist_range varlists() {
208
472
    return varlist_range(varlist_begin(), varlist_end());
209
472
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlists()
Line
Count
Source
207
146
  varlist_range varlists() {
208
146
    return varlist_range(varlist_begin(), varlist_end());
209
146
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlists()
Line
Count
Source
207
74
  varlist_range varlists() {
208
74
    return varlist_range(varlist_begin(), varlist_end());
209
74
  }
clang::OMPVarListClause<clang::OMPFlushClause>::varlists()
Line
Count
Source
207
28
  varlist_range varlists() {
208
28
    return varlist_range(varlist_begin(), varlist_end());
209
28
  }
clang::OMPVarListClause<clang::OMPDependClause>::varlists()
Line
Count
Source
207
906
  varlist_range varlists() {
208
906
    return varlist_range(varlist_begin(), varlist_end());
209
906
  }
clang::OMPVarListClause<clang::OMPMapClause>::varlists()
Line
Count
Source
207
5.00k
  varlist_range varlists() {
208
5.00k
    return varlist_range(varlist_begin(), varlist_end());
209
5.00k
  }
clang::OMPVarListClause<clang::OMPToClause>::varlists()
Line
Count
Source
207
260
  varlist_range varlists() {
208
260
    return varlist_range(varlist_begin(), varlist_end());
209
260
  }
clang::OMPVarListClause<clang::OMPFromClause>::varlists()
Line
Count
Source
207
182
  varlist_range varlists() {
208
182
    return varlist_range(varlist_begin(), varlist_end());
209
182
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlists()
Line
Count
Source
207
254
  varlist_range varlists() {
208
254
    return varlist_range(varlist_begin(), varlist_end());
209
254
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlists()
Line
Count
Source
207
1.20k
  varlist_range varlists() {
208
1.20k
    return varlist_range(varlist_begin(), varlist_end());
209
1.20k
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlists()
Line
Count
Source
207
854
  varlist_range varlists() {
208
854
    return varlist_range(varlist_begin(), varlist_end());
209
854
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlists()
Line
Count
Source
207
692
  varlist_range varlists() {
208
692
    return varlist_range(varlist_begin(), varlist_end());
209
692
  }
210
9.81k
  varlist_const_range varlists() const {
211
9.81k
    return varlist_const_range(varlist_begin(), varlist_end());
212
9.81k
  }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlists() const
Line
Count
Source
210
3.87k
  varlist_const_range varlists() const {
211
3.87k
    return varlist_const_range(varlist_begin(), varlist_end());
212
3.87k
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlists() const
Line
Count
Source
210
318
  varlist_const_range varlists() const {
211
318
    return varlist_const_range(varlist_begin(), varlist_end());
212
318
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlists() const
Line
Count
Source
210
156
  varlist_const_range varlists() const {
211
156
    return varlist_const_range(varlist_begin(), varlist_end());
212
156
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlists() const
Line
Count
Source
210
477
  varlist_const_range varlists() const {
211
477
    return varlist_const_range(varlist_begin(), varlist_end());
212
477
  }
clang::OMPVarListClause<clang::OMPReductionClause>::varlists() const
Line
Count
Source
210
824
  varlist_const_range varlists() const {
211
824
    return varlist_const_range(varlist_begin(), varlist_end());
212
824
  }
clang::OMPVarListClause<clang::OMPLinearClause>::varlists() const
Line
Count
Source
210
494
  varlist_const_range varlists() const {
211
494
    return varlist_const_range(varlist_begin(), varlist_end());
212
494
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlists() const
Line
Count
Source
210
38
  varlist_const_range varlists() const {
211
38
    return varlist_const_range(varlist_begin(), varlist_end());
212
38
  }
clang::OMPVarListClause<clang::OMPDependClause>::varlists() const
Line
Count
Source
210
864
  varlist_const_range varlists() const {
211
864
    return varlist_const_range(varlist_begin(), varlist_end());
212
864
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlists() const
Line
Count
Source
210
12
  varlist_const_range varlists() const {
211
12
    return varlist_const_range(varlist_begin(), varlist_end());
212
12
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlists() const
Line
Count
Source
210
60
  varlist_const_range varlists() const {
211
60
    return varlist_const_range(varlist_begin(), varlist_end());
212
60
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlists() const
Line
Count
Source
210
526
  varlist_const_range varlists() const {
211
526
    return varlist_const_range(varlist_begin(), varlist_end());
212
526
  }
clang::OMPVarListClause<clang::OMPSharedClause>::varlists() const
Line
Count
Source
210
100
  varlist_const_range varlists() const {
211
100
    return varlist_const_range(varlist_begin(), varlist_end());
212
100
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlists() const
Line
Count
Source
210
28
  varlist_const_range varlists() const {
211
28
    return varlist_const_range(varlist_begin(), varlist_end());
212
28
  }
clang::OMPVarListClause<clang::OMPFlushClause>::varlists() const
Line
Count
Source
210
8
  varlist_const_range varlists() const {
211
8
    return varlist_const_range(varlist_begin(), varlist_end());
212
8
  }
clang::OMPVarListClause<clang::OMPMapClause>::varlists() const
Line
Count
Source
210
1.57k
  varlist_const_range varlists() const {
211
1.57k
    return varlist_const_range(varlist_begin(), varlist_end());
212
1.57k
  }
clang::OMPVarListClause<clang::OMPToClause>::varlists() const
Line
Count
Source
210
32
  varlist_const_range varlists() const {
211
32
    return varlist_const_range(varlist_begin(), varlist_end());
212
32
  }
clang::OMPVarListClause<clang::OMPFromClause>::varlists() const
Line
Count
Source
210
32
  varlist_const_range varlists() const {
211
32
    return varlist_const_range(varlist_begin(), varlist_end());
212
32
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlists() const
Line
Count
Source
210
396
  varlist_const_range varlists() const {
211
396
    return varlist_const_range(varlist_begin(), varlist_end());
212
396
  }
213
214
86.1k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_begin()
Line
Count
Source
214
9.96k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_begin()
Line
Count
Source
214
16.4k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_begin()
Line
Count
Source
214
619
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_begin()
Line
Count
Source
214
8.16k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_begin()
Line
Count
Source
214
4.44k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_begin()
Line
Count
Source
214
60
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_begin()
Line
Count
Source
214
294
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_begin()
Line
Count
Source
214
23.1k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_begin()
Line
Count
Source
214
1.12k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_begin()
Line
Count
Source
214
338
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_begin()
Line
Count
Source
214
2.40k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_begin()
Line
Count
Source
214
2.08k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_begin()
Line
Count
Source
214
2.39k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_begin()
Line
Count
Source
214
2.00k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_begin()
Line
Count
Source
214
8.65k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPToClause>::varlist_begin()
Line
Count
Source
214
292
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_begin()
Line
Count
Source
214
214
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_begin()
Line
Count
Source
214
3.46k
  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
215
273k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_end()
Line
Count
Source
215
64.4k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_end()
Line
Count
Source
215
44
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_end()
Line
Count
Source
215
1.46k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_end()
Line
Count
Source
215
22.3k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_end()
Line
Count
Source
215
86.8k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_end()
Line
Count
Source
215
3.01k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_end()
Line
Count
Source
215
33.8k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_end()
Line
Count
Source
215
880
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_end()
Line
Count
Source
215
1.31k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_end()
Line
Count
Source
215
10.5k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_end()
Line
Count
Source
215
10.1k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_end()
Line
Count
Source
215
24.7k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_end()
Line
Count
Source
215
1.99k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_end()
Line
Count
Source
215
1.60k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_end()
Line
Count
Source
215
6.94k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPToClause>::varlist_end()
Line
Count
Source
215
276
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_end()
Line
Count
Source
215
198
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_end()
Line
Count
Source
215
2.33k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
216
15.4k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_begin() const
Line
Count
Source
216
7.51k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_begin() const
Line
Count
Source
216
318
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_begin() const
Line
Count
Source
216
12
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_begin() const
Line
Count
Source
216
1.28k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_begin() const
Line
Count
Source
216
50
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_begin() const
Line
Count
Source
216
1.32k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_begin() const
Line
Count
Source
216
824
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_begin() const
Line
Count
Source
216
824
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_begin() const
Line
Count
Source
216
38
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_begin() const
Line
Count
Source
216
864
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_begin() const
Line
Count
Source
216
12
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_begin() const
Line
Count
Source
216
60
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_begin() const
Line
Count
Source
216
224
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_begin() const
Line
Count
Source
216
100
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_begin() const
Line
Count
Source
216
1.57k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPToClause>::varlist_begin() const
Line
Count
Source
216
32
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_begin() const
Line
Count
Source
216
32
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_begin() const
Line
Count
Source
216
396
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
217
60.8k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_end() const
Line
Count
Source
217
26.5k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_end() const
Line
Count
Source
217
3.10k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_end() const
Line
Count
Source
217
328
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_end() const
Line
Count
Source
217
5.72k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_end() const
Line
Count
Source
217
15.0k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_end() const
Line
Count
Source
217
5.09k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_end() const
Line
Count
Source
217
688
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_end() const
Line
Count
Source
217
266
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_end() const
Line
Count
Source
217
12
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_end() const
Line
Count
Source
217
428
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPDependClause>::varlist_end() const
Line
Count
Source
217
864
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_end() const
Line
Count
Source
217
84
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_end() const
Line
Count
Source
217
540
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_end() const
Line
Count
Source
217
100
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPMapClause>::varlist_end() const
Line
Count
Source
217
1.57k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPToClause>::varlist_end() const
Line
Count
Source
217
32
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPFromClause>::varlist_end() const
Line
Count
Source
217
32
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_end() const
Line
Count
Source
217
396
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
218
219
  /// Sets the location of '('.
220
7.26k
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPPrivateClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
906
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
2.22k
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPLastprivateClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
270
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPSharedClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
156
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPReductionClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
574
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
50
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPInReductionClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
28
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPLinearClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
216
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPAlignedClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
132
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPCopyinClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
56
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
18
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPFlushClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
8
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPDependClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
526
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPMapClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
1.55k
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPToClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
32
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPFromClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
32
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
84
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::setLParenLoc(clang::SourceLocation)
Line
Count
Source
220
396
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
221
222
  /// Returns the location of '('.
223
27.1k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPPrivateClause>::getLParenLoc() const
Line
Count
Source
223
3.49k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::getLParenLoc() const
Line
Count
Source
223
3.06k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPLastprivateClause>::getLParenLoc() const
Line
Count
Source
223
943
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPSharedClause>::getLParenLoc() const
Line
Count
Source
223
838
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPReductionClause>::getLParenLoc() const
Line
Count
Source
223
8.22k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::getLParenLoc() const
Line
Count
Source
223
854
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPInReductionClause>::getLParenLoc() const
Line
Count
Source
223
692
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPLinearClause>::getLParenLoc() const
Line
Count
Source
223
642
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPAlignedClause>::getLParenLoc() const
Line
Count
Source
223
472
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPCopyinClause>::getLParenLoc() const
Line
Count
Source
223
146
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::getLParenLoc() const
Line
Count
Source
223
74
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPFlushClause>::getLParenLoc() const
Line
Count
Source
223
28
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPDependClause>::getLParenLoc() const
Line
Count
Source
223
870
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPMapClause>::getLParenLoc() const
Line
Count
Source
223
4.92k
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPToClause>::getLParenLoc() const
Line
Count
Source
223
260
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPFromClause>::getLParenLoc() const
Line
Count
Source
223
182
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::getLParenLoc() const
Line
Count
Source
223
254
  SourceLocation getLParenLoc() const { return LParenLoc; }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::getLParenLoc() const
Line
Count
Source
223
1.20k
  SourceLocation getLParenLoc() const { return LParenLoc; }
224
225
  /// Fetches list of all variables in the clause.
226
76.3k
  ArrayRef<const Expr *> getVarRefs() const {
227
76.3k
    return llvm::makeArrayRef(
228
76.3k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
76.3k
        NumVars);
230
76.3k
  }
clang::OMPVarListClause<clang::OMPFirstprivateClause>::getVarRefs() const
Line
Count
Source
226
34.0k
  ArrayRef<const Expr *> getVarRefs() const {
227
34.0k
    return llvm::makeArrayRef(
228
34.0k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
34.0k
        NumVars);
230
34.0k
  }
clang::OMPVarListClause<clang::OMPLastprivateClause>::getVarRefs() const
Line
Count
Source
226
7.07k
  ArrayRef<const Expr *> getVarRefs() const {
227
7.07k
    return llvm::makeArrayRef(
228
7.07k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
7.07k
        NumVars);
230
7.07k
  }
clang::OMPVarListClause<clang::OMPPrivateClause>::getVarRefs() const
Line
Count
Source
226
4.38k
  ArrayRef<const Expr *> getVarRefs() const {
227
4.38k
    return llvm::makeArrayRef(
228
4.38k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
4.38k
        NumVars);
230
4.38k
  }
clang::OMPVarListClause<clang::OMPCopyinClause>::getVarRefs() const
Line
Count
Source
226
378
  ArrayRef<const Expr *> getVarRefs() const {
227
378
    return llvm::makeArrayRef(
228
378
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
378
        NumVars);
230
378
  }
clang::OMPVarListClause<clang::OMPReductionClause>::getVarRefs() const
Line
Count
Source
226
15.8k
  ArrayRef<const Expr *> getVarRefs() const {
227
15.8k
    return llvm::makeArrayRef(
228
15.8k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
15.8k
        NumVars);
230
15.8k
  }
clang::OMPVarListClause<clang::OMPLinearClause>::getVarRefs() const
Line
Count
Source
226
5.92k
  ArrayRef<const Expr *> getVarRefs() const {
227
5.92k
    return llvm::makeArrayRef(
228
5.92k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
5.92k
        NumVars);
230
5.92k
  }
clang::OMPVarListClause<clang::OMPAlignedClause>::getVarRefs() const
Line
Count
Source
226
1.00k
  ArrayRef<const Expr *> getVarRefs() const {
227
1.00k
    return llvm::makeArrayRef(
228
1.00k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
1.00k
        NumVars);
230
1.00k
  }
clang::OMPVarListClause<clang::OMPCopyprivateClause>::getVarRefs() const
Line
Count
Source
226
304
  ArrayRef<const Expr *> getVarRefs() const {
227
304
    return llvm::makeArrayRef(
228
304
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
304
        NumVars);
230
304
  }
clang::OMPVarListClause<clang::OMPFlushClause>::getVarRefs() const
Line
Count
Source
226
24
  ArrayRef<const Expr *> getVarRefs() const {
227
24
    return llvm::makeArrayRef(
228
24
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
24
        NumVars);
230
24
  }
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::getVarRefs() const
Line
Count
Source
226
652
  ArrayRef<const Expr *> getVarRefs() const {
227
652
    return llvm::makeArrayRef(
228
652
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
652
        NumVars);
230
652
  }
clang::OMPVarListClause<clang::OMPDependClause>::getVarRefs() const
Line
Count
Source
226
1.74k
  ArrayRef<const Expr *> getVarRefs() const {
227
1.74k
    return llvm::makeArrayRef(
228
1.74k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
1.74k
        NumVars);
230
1.74k
  }
clang::OMPVarListClause<clang::OMPInReductionClause>::getVarRefs() const
Line
Count
Source
226
96
  ArrayRef<const Expr *> getVarRefs() const {
227
96
    return llvm::makeArrayRef(
228
96
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
96
        NumVars);
230
96
  }
clang::OMPVarListClause<clang::OMPTaskReductionClause>::getVarRefs() const
Line
Count
Source
226
600
  ArrayRef<const Expr *> getVarRefs() const {
227
600
    return llvm::makeArrayRef(
228
600
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
600
        NumVars);
230
600
  }
clang::OMPVarListClause<clang::OMPSharedClause>::getVarRefs() const
Line
Count
Source
226
200
  ArrayRef<const Expr *> getVarRefs() const {
227
200
    return llvm::makeArrayRef(
228
200
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
200
        NumVars);
230
200
  }
clang::OMPVarListClause<clang::OMPMapClause>::getVarRefs() const
Line
Count
Source
226
3.15k
  ArrayRef<const Expr *> getVarRefs() const {
227
3.15k
    return llvm::makeArrayRef(
228
3.15k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
3.15k
        NumVars);
230
3.15k
  }
clang::OMPVarListClause<clang::OMPToClause>::getVarRefs() const
Line
Count
Source
226
64
  ArrayRef<const Expr *> getVarRefs() const {
227
64
    return llvm::makeArrayRef(
228
64
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
64
        NumVars);
230
64
  }
clang::OMPVarListClause<clang::OMPFromClause>::getVarRefs() const
Line
Count
Source
226
64
  ArrayRef<const Expr *> getVarRefs() const {
227
64
    return llvm::makeArrayRef(
228
64
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
64
        NumVars);
230
64
  }
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::getVarRefs() const
Line
Count
Source
226
792
  ArrayRef<const Expr *> getVarRefs() const {
227
792
    return llvm::makeArrayRef(
228
792
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
792
        NumVars);
230
792
  }
231
};
232
233
/// This represents 'if' clause in the '#pragma omp ...' directive.
234
///
235
/// \code
236
/// #pragma omp parallel if(parallel:a > 5)
237
/// \endcode
238
/// In this example directive '#pragma omp parallel' has simple 'if' clause with
239
/// condition 'a > 5' and directive name modifier 'parallel'.
240
class OMPIfClause : public OMPClause, public OMPClauseWithPreInit {
241
  friend class OMPClauseReader;
242
243
  /// Location of '('.
244
  SourceLocation LParenLoc;
245
246
  /// Condition of the 'if' clause.
247
  Stmt *Condition = nullptr;
248
249
  /// Location of ':' (if any).
250
  SourceLocation ColonLoc;
251
252
  /// Directive name modifier for the clause.
253
  OpenMPDirectiveKind NameModifier = OMPD_unknown;
254
255
  /// Name modifier location.
256
  SourceLocation NameModifierLoc;
257
258
  /// Set condition.
259
1.28k
  void setCondition(Expr *Cond) { Condition = Cond; }
260
261
  /// Set directive name modifier for the clause.
262
1.28k
  void setNameModifier(OpenMPDirectiveKind NM) { NameModifier = NM; }
263
264
  /// Set location of directive name modifier for the clause.
265
1.28k
  void setNameModifierLoc(SourceLocation Loc) { NameModifierLoc = Loc; }
266
267
  /// Set location of ':'.
268
1.28k
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
269
270
public:
271
  /// Build 'if' clause with condition \a Cond.
272
  ///
273
  /// \param NameModifier [OpenMP 4.1] Directive name modifier of clause.
274
  /// \param Cond Condition of the clause.
275
  /// \param HelperCond Helper condition for the clause.
276
  /// \param CaptureRegion Innermost OpenMP region where expressions in this
277
  /// clause must be captured.
278
  /// \param StartLoc Starting location of the clause.
279
  /// \param LParenLoc Location of '('.
280
  /// \param NameModifierLoc Location of directive name modifier.
281
  /// \param ColonLoc [OpenMP 4.1] Location of ':'.
282
  /// \param EndLoc Ending location of the clause.
283
  OMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Cond, Stmt *HelperCond,
284
              OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc,
285
              SourceLocation LParenLoc, SourceLocation NameModifierLoc,
286
              SourceLocation ColonLoc, SourceLocation EndLoc)
287
      : OMPClause(OMPC_if, StartLoc, EndLoc), OMPClauseWithPreInit(this),
288
        LParenLoc(LParenLoc), Condition(Cond), ColonLoc(ColonLoc),
289
5.93k
        NameModifier(NameModifier), NameModifierLoc(NameModifierLoc) {
290
5.93k
    setPreInitStmt(HelperCond, CaptureRegion);
291
5.93k
  }
292
293
  /// Build an empty clause.
294
  OMPIfClause()
295
      : OMPClause(OMPC_if, SourceLocation(), SourceLocation()),
296
1.28k
        OMPClauseWithPreInit(this) {}
297
298
  /// Sets the location of '('.
299
1.28k
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
300
301
  /// Returns the location of '('.
302
2.51k
  SourceLocation getLParenLoc() const { return LParenLoc; }
303
304
  /// Return the location of ':'.
305
2.51k
  SourceLocation getColonLoc() const { return ColonLoc; }
306
307
  /// Returns condition.
308
6.80k
  Expr *getCondition() const { return cast_or_null<Expr>(Condition); }
309
310
  /// Return directive name modifier associated with the clause.
311
11.8k
  OpenMPDirectiveKind getNameModifier() const { return NameModifier; }
312
313
  /// Return the location of directive name modifier.
314
5.61k
  SourceLocation getNameModifierLoc() const { return NameModifierLoc; }
315
316
345
  child_range children() { return child_range(&Condition, &Condition + 1); }
317
318
68.0k
  static bool classof(const OMPClause *T) {
319
68.0k
    return T->getClauseKind() == OMPC_if;
320
68.0k
  }
321
};
322
323
/// This represents 'final' clause in the '#pragma omp ...' directive.
324
///
325
/// \code
326
/// #pragma omp task final(a > 5)
327
/// \endcode
328
/// In this example directive '#pragma omp task' has simple 'final'
329
/// clause with condition 'a > 5'.
330
class OMPFinalClause : public OMPClause {
331
  friend class OMPClauseReader;
332
333
  /// Location of '('.
334
  SourceLocation LParenLoc;
335
336
  /// Condition of the 'if' clause.
337
  Stmt *Condition = nullptr;
338
339
  /// Set condition.
340
20
  void setCondition(Expr *Cond) { Condition = Cond; }
341
342
public:
343
  /// Build 'final' clause with condition \a Cond.
344
  ///
345
  /// \param StartLoc Starting location of the clause.
346
  /// \param LParenLoc Location of '('.
347
  /// \param Cond Condition of the clause.
348
  /// \param EndLoc Ending location of the clause.
349
  OMPFinalClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc,
350
                 SourceLocation EndLoc)
351
      : OMPClause(OMPC_final, StartLoc, EndLoc), LParenLoc(LParenLoc),
352
202
        Condition(Cond) {}
353
354
  /// Build an empty clause.
355
  OMPFinalClause()
356
20
      : OMPClause(OMPC_final, SourceLocation(), SourceLocation()) {}
357
358
  /// Sets the location of '('.
359
20
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
360
361
  /// Returns the location of '('.
362
86
  SourceLocation getLParenLoc() const { return LParenLoc; }
363
364
  /// Returns condition.
365
162
  Expr *getCondition() const { return cast_or_null<Expr>(Condition); }
366
367
56
  child_range children() { return child_range(&Condition, &Condition + 1); }
368
369
183
  static bool classof(const OMPClause *T) {
370
183
    return T->getClauseKind() == OMPC_final;
371
183
  }
372
};
373
374
/// This represents 'num_threads' clause in the '#pragma omp ...'
375
/// directive.
376
///
377
/// \code
378
/// #pragma omp parallel num_threads(6)
379
/// \endcode
380
/// In this example directive '#pragma omp parallel' has simple 'num_threads'
381
/// clause with number of threads '6'.
382
class OMPNumThreadsClause : public OMPClause, public OMPClauseWithPreInit {
383
  friend class OMPClauseReader;
384
385
  /// Location of '('.
386
  SourceLocation LParenLoc;
387
388
  /// Condition of the 'num_threads' clause.
389
  Stmt *NumThreads = nullptr;
390
391
  /// Set condition.
392
144
  void setNumThreads(Expr *NThreads) { NumThreads = NThreads; }
393
394
public:
395
  /// Build 'num_threads' clause with condition \a NumThreads.
396
  ///
397
  /// \param NumThreads Number of threads for the construct.
398
  /// \param HelperNumThreads Helper Number of threads for the construct.
399
  /// \param CaptureRegion Innermost OpenMP region where expressions in this
400
  /// clause must be captured.
401
  /// \param StartLoc Starting location of the clause.
402
  /// \param LParenLoc Location of '('.
403
  /// \param EndLoc Ending location of the clause.
404
  OMPNumThreadsClause(Expr *NumThreads, Stmt *HelperNumThreads,
405
                      OpenMPDirectiveKind CaptureRegion,
406
                      SourceLocation StartLoc, SourceLocation LParenLoc,
407
                      SourceLocation EndLoc)
408
      : OMPClause(OMPC_num_threads, StartLoc, EndLoc),
409
        OMPClauseWithPreInit(this), LParenLoc(LParenLoc),
410
1.22k
        NumThreads(NumThreads) {
411
1.22k
    setPreInitStmt(HelperNumThreads, CaptureRegion);
412
1.22k
  }
413
414
  /// Build an empty clause.
415
  OMPNumThreadsClause()
416
      : OMPClause(OMPC_num_threads, SourceLocation(), SourceLocation()),
417
144
        OMPClauseWithPreInit(this) {}
418
419
  /// Sets the location of '('.
420
144
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
421
422
  /// Returns the location of '('.
423
726
  SourceLocation getLParenLoc() const { return LParenLoc; }
424
425
  /// Returns number of threads.
426
1.32k
  Expr *getNumThreads() const { return cast_or_null<Expr>(NumThreads); }
427
428
260
  child_range children() { return child_range(&NumThreads, &NumThreads + 1); }
429
430
8.45k
  static bool classof(const OMPClause *T) {
431
8.45k
    return T->getClauseKind() == OMPC_num_threads;
432
8.45k
  }
433
};
434
435
/// This represents 'safelen' clause in the '#pragma omp ...'
436
/// directive.
437
///
438
/// \code
439
/// #pragma omp simd safelen(4)
440
/// \endcode
441
/// In this example directive '#pragma omp simd' has clause 'safelen'
442
/// with single expression '4'.
443
/// If the safelen clause is used then no two iterations executed
444
/// concurrently with SIMD instructions can have a greater distance
445
/// in the logical iteration space than its value. The parameter of
446
/// the safelen clause must be a constant positive integer expression.
447
class OMPSafelenClause : public OMPClause {
448
  friend class OMPClauseReader;
449
450
  /// Location of '('.
451
  SourceLocation LParenLoc;
452
453
  /// Safe iteration space distance.
454
  Stmt *Safelen = nullptr;
455
456
  /// Set safelen.
457
120
  void setSafelen(Expr *Len) { Safelen = Len; }
458
459
public:
460
  /// Build 'safelen' clause.
461
  ///
462
  /// \param Len Expression associated with this clause.
463
  /// \param StartLoc Starting location of the clause.
464
  /// \param EndLoc Ending location of the clause.
465
  OMPSafelenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc,
466
                   SourceLocation EndLoc)
467
      : OMPClause(OMPC_safelen, StartLoc, EndLoc), LParenLoc(LParenLoc),
468
2.44k
        Safelen(Len) {}
469
470
  /// Build an empty clause.
471
  explicit OMPSafelenClause()
472
120
      : OMPClause(OMPC_safelen, SourceLocation(), SourceLocation()) {}
473
474
  /// Sets the location of '('.
475
120
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
476
477
  /// Returns the location of '('.
478
1.83k
  SourceLocation getLParenLoc() const { return LParenLoc; }
479
480
  /// Return safe iteration space distance.
481
2.55k
  Expr *getSafelen() const { return cast_or_null<Expr>(Safelen); }
482
483
546
  child_range children() { return child_range(&Safelen, &Safelen + 1); }
484
485
7.44k
  static bool classof(const OMPClause *T) {
486
7.44k
    return T->getClauseKind() == OMPC_safelen;
487
7.44k
  }
488
};
489
490
/// This represents 'simdlen' clause in the '#pragma omp ...'
491
/// directive.
492
///
493
/// \code
494
/// #pragma omp simd simdlen(4)
495
/// \endcode
496
/// In this example directive '#pragma omp simd' has clause 'simdlen'
497
/// with single expression '4'.
498
/// If the 'simdlen' clause is used then it specifies the preferred number of
499
/// iterations to be executed concurrently. The parameter of the 'simdlen'
500
/// clause must be a constant positive integer expression.
501
class OMPSimdlenClause : public OMPClause {
502
  friend class OMPClauseReader;
503
504
  /// Location of '('.
505
  SourceLocation LParenLoc;
506
507
  /// Safe iteration space distance.
508
  Stmt *Simdlen = nullptr;
509
510
  /// Set simdlen.
511
120
  void setSimdlen(Expr *Len) { Simdlen = Len; }
512
513
public:
514
  /// Build 'simdlen' clause.
515
  ///
516
  /// \param Len Expression associated with this clause.
517
  /// \param StartLoc Starting location of the clause.
518
  /// \param EndLoc Ending location of the clause.
519
  OMPSimdlenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc,
520
                   SourceLocation EndLoc)
521
      : OMPClause(OMPC_simdlen, StartLoc, EndLoc), LParenLoc(LParenLoc),
522
1.32k
        Simdlen(Len) {}
523
524
  /// Build an empty clause.
525
  explicit OMPSimdlenClause()
526
120
      : OMPClause(OMPC_simdlen, SourceLocation(), SourceLocation()) {}
527
528
  /// Sets the location of '('.
529
120
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
530
531
  /// Returns the location of '('.
532
860
  SourceLocation getLParenLoc() const { return LParenLoc; }
533
534
  /// Return safe iteration space distance.
535
1.65k
  Expr *getSimdlen() const { return cast_or_null<Expr>(Simdlen); }
536
537
162
  child_range children() { return child_range(&Simdlen, &Simdlen + 1); }
538
539
7.88k
  static bool classof(const OMPClause *T) {
540
7.88k
    return T->getClauseKind() == OMPC_simdlen;
541
7.88k
  }
542
};
543
544
/// This represents 'collapse' clause in the '#pragma omp ...'
545
/// directive.
546
///
547
/// \code
548
/// #pragma omp simd collapse(3)
549
/// \endcode
550
/// In this example directive '#pragma omp simd' has clause 'collapse'
551
/// with single expression '3'.
552
/// The parameter must be a constant positive integer expression, it specifies
553
/// the number of nested loops that should be collapsed into a single iteration
554
/// space.
555
class OMPCollapseClause : public OMPClause {
556
  friend class OMPClauseReader;
557
558
  /// Location of '('.
559
  SourceLocation LParenLoc;
560
561
  /// Number of for-loops.
562
  Stmt *NumForLoops = nullptr;
563
564
  /// Set the number of associated for-loops.
565
236
  void setNumForLoops(Expr *Num) { NumForLoops = Num; }
566
567
public:
568
  /// Build 'collapse' clause.
569
  ///
570
  /// \param Num Expression associated with this clause.
571
  /// \param StartLoc Starting location of the clause.
572
  /// \param LParenLoc Location of '('.
573
  /// \param EndLoc Ending location of the clause.
574
  OMPCollapseClause(Expr *Num, SourceLocation StartLoc,
575
                    SourceLocation LParenLoc, SourceLocation EndLoc)
576
      : OMPClause(OMPC_collapse, StartLoc, EndLoc), LParenLoc(LParenLoc),
577
3.56k
        NumForLoops(Num) {}
578
579
  /// Build an empty clause.
580
  explicit OMPCollapseClause()
581
236
      : OMPClause(OMPC_collapse, SourceLocation(), SourceLocation()) {}
582
583
  /// Sets the location of '('.
584
236
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
585
586
  /// Returns the location of '('.
587
2.54k
  SourceLocation getLParenLoc() const { return LParenLoc; }
588
589
  /// Return the number of associated for-loops.
590
6.60k
  Expr *getNumForLoops() const { return cast_or_null<Expr>(NumForLoops); }
591
592
438
  child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); }
593
594
58.9k
  static bool classof(const OMPClause *T) {
595
58.9k
    return T->getClauseKind() == OMPC_collapse;
596
58.9k
  }
597
};
598
599
/// This represents 'default' clause in the '#pragma omp ...' directive.
600
///
601
/// \code
602
/// #pragma omp parallel default(shared)
603
/// \endcode
604
/// In this example directive '#pragma omp parallel' has simple 'default'
605
/// clause with kind 'shared'.
606
class OMPDefaultClause : public OMPClause {
607
  friend class OMPClauseReader;
608
609
  /// Location of '('.
610
  SourceLocation LParenLoc;
611
612
  /// A kind of the 'default' clause.
613
  OpenMPDefaultClauseKind Kind = OMPC_DEFAULT_unknown;
614
615
  /// Start location of the kind in source code.
616
  SourceLocation KindKwLoc;
617
618
  /// Set kind of the clauses.
619
  ///
620
  /// \param K Argument of clause.
621
140
  void setDefaultKind(OpenMPDefaultClauseKind K) { Kind = K; }
622
623
  /// Set argument location.
624
  ///
625
  /// \param KLoc Argument location.
626
140
  void setDefaultKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
627
628
public:
629
  /// Build 'default' clause with argument \a A ('none' or 'shared').
630
  ///
631
  /// \param A Argument of the clause ('none' or 'shared').
632
  /// \param ALoc Starting location of the argument.
633
  /// \param StartLoc Starting location of the clause.
634
  /// \param LParenLoc Location of '('.
635
  /// \param EndLoc Ending location of the clause.
636
  OMPDefaultClause(OpenMPDefaultClauseKind A, SourceLocation ALoc,
637
                   SourceLocation StartLoc, SourceLocation LParenLoc,
638
                   SourceLocation EndLoc)
639
      : OMPClause(OMPC_default, StartLoc, EndLoc), LParenLoc(LParenLoc),
640
803
        Kind(A), KindKwLoc(ALoc) {}
641
642
  /// Build an empty clause.
643
  OMPDefaultClause()
644
140
      : OMPClause(OMPC_default, SourceLocation(), SourceLocation()) {}
645
646
  /// Sets the location of '('.
647
140
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
648
649
  /// Returns the location of '('.
650
356
  SourceLocation getLParenLoc() const { return LParenLoc; }
651
652
  /// Returns kind of the clause.
653
780
  OpenMPDefaultClauseKind getDefaultKind() const { return Kind; }
654
655
  /// Returns location of clause kind.
656
356
  SourceLocation getDefaultKindKwLoc() const { return KindKwLoc; }
657
658
212
  child_range children() {
659
212
    return child_range(child_iterator(), child_iterator());
660
212
  }
661
662
  static bool classof(const OMPClause *T) {
663
    return T->getClauseKind() == OMPC_default;
664
  }
665
};
666
667
/// This represents 'proc_bind' clause in the '#pragma omp ...'
668
/// directive.
669
///
670
/// \code
671
/// #pragma omp parallel proc_bind(master)
672
/// \endcode
673
/// In this example directive '#pragma omp parallel' has simple 'proc_bind'
674
/// clause with kind 'master'.
675
class OMPProcBindClause : public OMPClause {
676
  friend class OMPClauseReader;
677
678
  /// Location of '('.
679
  SourceLocation LParenLoc;
680
681
  /// A kind of the 'proc_bind' clause.
682
  OpenMPProcBindClauseKind Kind = OMPC_PROC_BIND_unknown;
683
684
  /// Start location of the kind in source code.
685
  SourceLocation KindKwLoc;
686
687
  /// Set kind of the clause.
688
  ///
689
  /// \param K Kind of clause.
690
76
  void setProcBindKind(OpenMPProcBindClauseKind K) { Kind = K; }
691
692
  /// Set clause kind location.
693
  ///
694
  /// \param KLoc Kind location.
695
76
  void setProcBindKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
696
697
public:
698
  /// Build 'proc_bind' clause with argument \a A ('master', 'close' or
699
  ///        'spread').
700
  ///
701
  /// \param A Argument of the clause ('master', 'close' or 'spread').
702
  /// \param ALoc Starting location of the argument.
703
  /// \param StartLoc Starting location of the clause.
704
  /// \param LParenLoc Location of '('.
705
  /// \param EndLoc Ending location of the clause.
706
  OMPProcBindClause(OpenMPProcBindClauseKind A, SourceLocation ALoc,
707
                    SourceLocation StartLoc, SourceLocation LParenLoc,
708
                    SourceLocation EndLoc)
709
      : OMPClause(OMPC_proc_bind, StartLoc, EndLoc), LParenLoc(LParenLoc),
710
590
        Kind(A), KindKwLoc(ALoc) {}
711
712
  /// Build an empty clause.
713
  OMPProcBindClause()
714
76
      : OMPClause(OMPC_proc_bind, SourceLocation(), SourceLocation()) {}
715
716
  /// Sets the location of '('.
717
76
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
718
719
  /// Returns the location of '('.
720
261
  SourceLocation getLParenLoc() const { return LParenLoc; }
721
722
  /// Returns kind of the clause.
723
468
  OpenMPProcBindClauseKind getProcBindKind() const { return Kind; }
724
725
  /// Returns location of clause kind.
726
261
  SourceLocation getProcBindKindKwLoc() const { return KindKwLoc; }
727
728
134
  child_range children() {
729
134
    return child_range(child_iterator(), child_iterator());
730
134
  }
731
732
4.61k
  static bool classof(const OMPClause *T) {
733
4.61k
    return T->getClauseKind() == OMPC_proc_bind;
734
4.61k
  }
735
};
736
737
/// This represents 'schedule' clause in the '#pragma omp ...' directive.
738
///
739
/// \code
740
/// #pragma omp for schedule(static, 3)
741
/// \endcode
742
/// In this example directive '#pragma omp for' has 'schedule' clause with
743
/// arguments 'static' and '3'.
744
class OMPScheduleClause : public OMPClause, public OMPClauseWithPreInit {
745
  friend class OMPClauseReader;
746
747
  /// Location of '('.
748
  SourceLocation LParenLoc;
749
750
  /// A kind of the 'schedule' clause.
751
  OpenMPScheduleClauseKind Kind = OMPC_SCHEDULE_unknown;
752
753
  /// Modifiers for 'schedule' clause.
754
  enum {FIRST, SECOND, NUM_MODIFIERS};
755
  OpenMPScheduleClauseModifier Modifiers[NUM_MODIFIERS];
756
757
  /// Locations of modifiers.
758
  SourceLocation ModifiersLoc[NUM_MODIFIERS];
759
760
  /// Start location of the schedule ind in source code.
761
  SourceLocation KindLoc;
762
763
  /// Location of ',' (if any).
764
  SourceLocation CommaLoc;
765
766
  /// Chunk size.
767
  Expr *ChunkSize = nullptr;
768
769
  /// Set schedule kind.
770
  ///
771
  /// \param K Schedule kind.
772
388
  void setScheduleKind(OpenMPScheduleClauseKind K) { Kind = K; }
773
774
  /// Set the first schedule modifier.
775
  ///
776
  /// \param M Schedule modifier.
777
388
  void setFirstScheduleModifier(OpenMPScheduleClauseModifier M) {
778
388
    Modifiers[FIRST] = M;
779
388
  }
780
781
  /// Set the second schedule modifier.
782
  ///
783
  /// \param M Schedule modifier.
784
388
  void setSecondScheduleModifier(OpenMPScheduleClauseModifier M) {
785
388
    Modifiers[SECOND] = M;
786
388
  }
787
788
  /// Set location of the first schedule modifier.
789
388
  void setFirstScheduleModifierLoc(SourceLocation Loc) {
790
388
    ModifiersLoc[FIRST] = Loc;
791
388
  }
792
793
  /// Set location of the second schedule modifier.
794
388
  void setSecondScheduleModifierLoc(SourceLocation Loc) {
795
388
    ModifiersLoc[SECOND] = Loc;
796
388
  }
797
798
  /// Set schedule modifier location.
799
  ///
800
  /// \param M Schedule modifier location.
801
  void setScheduleModifer(OpenMPScheduleClauseModifier M) {
802
    if (Modifiers[FIRST] == OMPC_SCHEDULE_MODIFIER_unknown)
803
      Modifiers[FIRST] = M;
804
    else {
805
      assert(Modifiers[SECOND] == OMPC_SCHEDULE_MODIFIER_unknown);
806
      Modifiers[SECOND] = M;
807
    }
808
  }
809
810
  /// Sets the location of '('.
811
  ///
812
  /// \param Loc Location of '('.
813
388
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
814
815
  /// Set schedule kind start location.
816
  ///
817
  /// \param KLoc Schedule kind location.
818
388
  void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
819
820
  /// Set location of ','.
821
  ///
822
  /// \param Loc Location of ','.
823
388
  void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
824
825
  /// Set chunk size.
826
  ///
827
  /// \param E Chunk size.
828
388
  void setChunkSize(Expr *E) { ChunkSize = E; }
829
830
public:
831
  /// Build 'schedule' clause with schedule kind \a Kind and chunk size
832
  /// expression \a ChunkSize.
833
  ///
834
  /// \param StartLoc Starting location of the clause.
835
  /// \param LParenLoc Location of '('.
836
  /// \param KLoc Starting location of the argument.
837
  /// \param CommaLoc Location of ','.
838
  /// \param EndLoc Ending location of the clause.
839
  /// \param Kind Schedule kind.
840
  /// \param ChunkSize Chunk size.
841
  /// \param HelperChunkSize Helper chunk size for combined directives.
842
  /// \param M1 The first modifier applied to 'schedule' clause.
843
  /// \param M1Loc Location of the first modifier
844
  /// \param M2 The second modifier applied to 'schedule' clause.
845
  /// \param M2Loc Location of the second modifier
846
  OMPScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc,
847
                    SourceLocation KLoc, SourceLocation CommaLoc,
848
                    SourceLocation EndLoc, OpenMPScheduleClauseKind Kind,
849
                    Expr *ChunkSize, Stmt *HelperChunkSize,
850
                    OpenMPScheduleClauseModifier M1, SourceLocation M1Loc,
851
                    OpenMPScheduleClauseModifier M2, SourceLocation M2Loc)
852
      : OMPClause(OMPC_schedule, StartLoc, EndLoc), OMPClauseWithPreInit(this),
853
        LParenLoc(LParenLoc), Kind(Kind), KindLoc(KLoc), CommaLoc(CommaLoc),
854
2.86k
        ChunkSize(ChunkSize) {
855
2.86k
    setPreInitStmt(HelperChunkSize);
856
2.86k
    Modifiers[FIRST] = M1;
857
2.86k
    Modifiers[SECOND] = M2;
858
2.86k
    ModifiersLoc[FIRST] = M1Loc;
859
2.86k
    ModifiersLoc[SECOND] = M2Loc;
860
2.86k
  }
861
862
  /// Build an empty clause.
863
  explicit OMPScheduleClause()
864
      : OMPClause(OMPC_schedule, SourceLocation(), SourceLocation()),
865
388
        OMPClauseWithPreInit(this) {
866
388
    Modifiers[FIRST] = OMPC_SCHEDULE_MODIFIER_unknown;
867
388
    Modifiers[SECOND] = OMPC_SCHEDULE_MODIFIER_unknown;
868
388
  }
869
870
  /// Get kind of the clause.
871
2.65k
  OpenMPScheduleClauseKind getScheduleKind() const { return Kind; }
872
873
  /// Get the first modifier of the clause.
874
5.30k
  OpenMPScheduleClauseModifier getFirstScheduleModifier() const {
875
5.30k
    return Modifiers[FIRST];
876
5.30k
  }
877
878
  /// Get the second modifier of the clause.
879
5.09k
  OpenMPScheduleClauseModifier getSecondScheduleModifier() const {
880
5.09k
    return Modifiers[SECOND];
881
5.09k
  }
882
883
  /// Get location of '('.
884
1.33k
  SourceLocation getLParenLoc() { return LParenLoc; }
885
886
  /// Get kind location.
887
1.33k
  SourceLocation getScheduleKindLoc() { return KindLoc; }
888
889
  /// Get the first modifier location.
890
1.33k
  SourceLocation getFirstScheduleModifierLoc() const {
891
1.33k
    return ModifiersLoc[FIRST];
892
1.33k
  }
893
894
  /// Get the second modifier location.
895
1.33k
  SourceLocation getSecondScheduleModifierLoc() const {
896
1.33k
    return ModifiersLoc[SECOND];
897
1.33k
  }
898
899
  /// Get location of ','.
900
1.33k
  SourceLocation getCommaLoc() { return CommaLoc; }
901
902
  /// Get chunk size.
903
1.53k
  Expr *getChunkSize() { return ChunkSize; }
904
905
  /// Get chunk size.
906
1.14k
  const Expr *getChunkSize() const { return ChunkSize; }
907
908
950
  child_range children() {
909
950
    return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
910
950
                       reinterpret_cast<Stmt **>(&ChunkSize) + 1);
911
950
  }
912
913
4.22k
  static bool classof(const OMPClause *T) {
914
4.22k
    return T->getClauseKind() == OMPC_schedule;
915
4.22k
  }
916
};
917
918
/// This represents 'ordered' clause in the '#pragma omp ...' directive.
919
///
920
/// \code
921
/// #pragma omp for ordered (2)
922
/// \endcode
923
/// In this example directive '#pragma omp for' has 'ordered' clause with
924
/// parameter 2.
925
class OMPOrderedClause final
926
    : public OMPClause,
927
      private llvm::TrailingObjects<OMPOrderedClause, Expr *> {
928
  friend class OMPClauseReader;
929
  friend TrailingObjects;
930
931
  /// Location of '('.
932
  SourceLocation LParenLoc;
933
934
  /// Number of for-loops.
935
  Stmt *NumForLoops = nullptr;
936
937
  /// Real number of loops.
938
  unsigned NumberOfLoops = 0;
939
940
  /// Build 'ordered' clause.
941
  ///
942
  /// \param Num Expression, possibly associated with this clause.
943
  /// \param NumLoops Number of loops, associated with this clause.
944
  /// \param StartLoc Starting location of the clause.
945
  /// \param LParenLoc Location of '('.
946
  /// \param EndLoc Ending location of the clause.
947
  OMPOrderedClause(Expr *Num, unsigned NumLoops, SourceLocation StartLoc,
948
                   SourceLocation LParenLoc, SourceLocation EndLoc)
949
      : OMPClause(OMPC_ordered, StartLoc, EndLoc), LParenLoc(LParenLoc),
950
924
        NumForLoops(Num), NumberOfLoops(NumLoops) {}
951
952
  /// Build an empty clause.
953
  explicit OMPOrderedClause(unsigned NumLoops)
954
      : OMPClause(OMPC_ordered, SourceLocation(), SourceLocation()),
955
52
        NumberOfLoops(NumLoops) {}
956
957
  /// Set the number of associated for-loops.
958
52
  void setNumForLoops(Expr *Num) { NumForLoops = Num; }
959
960
public:
961
  /// Build 'ordered' clause.
962
  ///
963
  /// \param Num Expression, possibly associated with this clause.
964
  /// \param NumLoops Number of loops, associated with this clause.
965
  /// \param StartLoc Starting location of the clause.
966
  /// \param LParenLoc Location of '('.
967
  /// \param EndLoc Ending location of the clause.
968
  static OMPOrderedClause *Create(const ASTContext &C, Expr *Num,
969
                                  unsigned NumLoops, SourceLocation StartLoc,
970
                                  SourceLocation LParenLoc,
971
                                  SourceLocation EndLoc);
972
973
  /// Build an empty clause.
974
  static OMPOrderedClause* CreateEmpty(const ASTContext &C, unsigned NumLoops);
975
976
  /// Sets the location of '('.
977
52
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
978
979
  /// Returns the location of '('.
980
512
  SourceLocation getLParenLoc() const { return LParenLoc; }
981
982
  /// Return the number of associated for-loops.
983
2.44k
  Expr *getNumForLoops() const { return cast_or_null<Expr>(NumForLoops); }
984
985
  /// Set number of iterations for the specified loop.
986
  void setLoopNumIterations(unsigned NumLoop, Expr *NumIterations);
987
  /// Get number of iterations for all the loops.
988
  ArrayRef<Expr *> getLoopNumIterations() const;
989
990
  /// Set loop counter for the specified loop.
991
  void setLoopCounter(unsigned NumLoop, Expr *Counter);
992
  /// Get loops counter for the specified loop.
993
  Expr *getLoopCounter(unsigned NumLoop);
994
  const Expr *getLoopCounter(unsigned NumLoop) const;
995
996
28
  child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); }
997
998
46.5k
  static bool classof(const OMPClause *T) {
999
46.5k
    return T->getClauseKind() == OMPC_ordered;
1000
46.5k
  }
1001
};
1002
1003
/// This represents 'nowait' clause in the '#pragma omp ...' directive.
1004
///
1005
/// \code
1006
/// #pragma omp for nowait
1007
/// \endcode
1008
/// In this example directive '#pragma omp for' has 'nowait' clause.
1009
class OMPNowaitClause : public OMPClause {
1010
public:
1011
  /// Build 'nowait' clause.
1012
  ///
1013
  /// \param StartLoc Starting location of the clause.
1014
  /// \param EndLoc Ending location of the clause.
1015
  OMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc)
1016
958
      : OMPClause(OMPC_nowait, StartLoc, EndLoc) {}
1017
1018
  /// Build an empty clause.
1019
  OMPNowaitClause()
1020
352
      : OMPClause(OMPC_nowait, SourceLocation(), SourceLocation()) {}
1021
1022
54
  child_range children() {
1023
54
    return child_range(child_iterator(), child_iterator());
1024
54
  }
1025
1026
6.81k
  static bool classof(const OMPClause *T) {
1027
6.81k
    return T->getClauseKind() == OMPC_nowait;
1028
6.81k
  }
1029
};
1030
1031
/// This represents 'untied' clause in the '#pragma omp ...' directive.
1032
///
1033
/// \code
1034
/// #pragma omp task untied
1035
/// \endcode
1036
/// In this example directive '#pragma omp task' has 'untied' clause.
1037
class OMPUntiedClause : public OMPClause {
1038
public:
1039
  /// Build 'untied' clause.
1040
  ///
1041
  /// \param StartLoc Starting location of the clause.
1042
  /// \param EndLoc Ending location of the clause.
1043
  OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
1044
36
      : OMPClause(OMPC_untied, StartLoc, EndLoc) {}
1045
1046
  /// Build an empty clause.
1047
  OMPUntiedClause()
1048
14
      : OMPClause(OMPC_untied, SourceLocation(), SourceLocation()) {}
1049
1050
16
  child_range children() {
1051
16
    return child_range(child_iterator(), child_iterator());
1052
16
  }
1053
1054
83
  static bool classof(const OMPClause *T) {
1055
83
    return T->getClauseKind() == OMPC_untied;
1056
83
  }
1057
};
1058
1059
/// This represents 'mergeable' clause in the '#pragma omp ...'
1060
/// directive.
1061
///
1062
/// \code
1063
/// #pragma omp task mergeable
1064
/// \endcode
1065
/// In this example directive '#pragma omp task' has 'mergeable' clause.
1066
class OMPMergeableClause : public OMPClause {
1067
public:
1068
  /// Build 'mergeable' clause.
1069
  ///
1070
  /// \param StartLoc Starting location of the clause.
1071
  /// \param EndLoc Ending location of the clause.
1072
  OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
1073
32
      : OMPClause(OMPC_mergeable, StartLoc, EndLoc) {}
1074
1075
  /// Build an empty clause.
1076
  OMPMergeableClause()
1077
12
      : OMPClause(OMPC_mergeable, SourceLocation(), SourceLocation()) {}
1078
1079
32
  child_range children() {
1080
32
    return child_range(child_iterator(), child_iterator());
1081
32
  }
1082
1083
  static bool classof(const OMPClause *T) {
1084
    return T->getClauseKind() == OMPC_mergeable;
1085
  }
1086
};
1087
1088
/// This represents 'read' clause in the '#pragma omp atomic' directive.
1089
///
1090
/// \code
1091
/// #pragma omp atomic read
1092
/// \endcode
1093
/// In this example directive '#pragma omp atomic' has 'read' clause.
1094
class OMPReadClause : public OMPClause {
1095
public:
1096
  /// Build 'read' clause.
1097
  ///
1098
  /// \param StartLoc Starting location of the clause.
1099
  /// \param EndLoc Ending location of the clause.
1100
  OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
1101
278
      : OMPClause(OMPC_read, StartLoc, EndLoc) {}
1102
1103
  /// Build an empty clause.
1104
102
  OMPReadClause() : OMPClause(OMPC_read, SourceLocation(), SourceLocation()) {}
1105
1106
0
  child_range children() {
1107
0
    return child_range(child_iterator(), child_iterator());
1108
0
  }
1109
1110
  static bool classof(const OMPClause *T) {
1111
    return T->getClauseKind() == OMPC_read;
1112
  }
1113
};
1114
1115
/// This represents 'write' clause in the '#pragma omp atomic' directive.
1116
///
1117
/// \code
1118
/// #pragma omp atomic write
1119
/// \endcode
1120
/// In this example directive '#pragma omp atomic' has 'write' clause.
1121
class OMPWriteClause : public OMPClause {
1122
public:
1123
  /// Build 'write' clause.
1124
  ///
1125
  /// \param StartLoc Starting location of the clause.
1126
  /// \param EndLoc Ending location of the clause.
1127
  OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
1128
282
      : OMPClause(OMPC_write, StartLoc, EndLoc) {}
1129
1130
  /// Build an empty clause.
1131
  OMPWriteClause()
1132
104
      : OMPClause(OMPC_write, SourceLocation(), SourceLocation()) {}
1133
1134
0
  child_range children() {
1135
0
    return child_range(child_iterator(), child_iterator());
1136
0
  }
1137
1138
  static bool classof(const OMPClause *T) {
1139
    return T->getClauseKind() == OMPC_write;
1140
  }
1141
};
1142
1143
/// This represents 'update' clause in the '#pragma omp atomic'
1144
/// directive.
1145
///
1146
/// \code
1147
/// #pragma omp atomic update
1148
/// \endcode
1149
/// In this example directive '#pragma omp atomic' has 'update' clause.
1150
class OMPUpdateClause : public OMPClause {
1151
public:
1152
  /// Build 'update' clause.
1153
  ///
1154
  /// \param StartLoc Starting location of the clause.
1155
  /// \param EndLoc Ending location of the clause.
1156
  OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc)
1157
228
      : OMPClause(OMPC_update, StartLoc, EndLoc) {}
1158
1159
  /// Build an empty clause.
1160
  OMPUpdateClause()
1161
54
      : OMPClause(OMPC_update, SourceLocation(), SourceLocation()) {}
1162
1163
0
  child_range children() {
1164
0
    return child_range(child_iterator(), child_iterator());
1165
0
  }
1166
1167
  static bool classof(const OMPClause *T) {
1168
    return T->getClauseKind() == OMPC_update;
1169
  }
1170
};
1171
1172
/// This represents 'capture' clause in the '#pragma omp atomic'
1173
/// directive.
1174
///
1175
/// \code
1176
/// #pragma omp atomic capture
1177
/// \endcode
1178
/// In this example directive '#pragma omp atomic' has 'capture' clause.
1179
class OMPCaptureClause : public OMPClause {
1180
public:
1181
  /// Build 'capture' clause.
1182
  ///
1183
  /// \param StartLoc Starting location of the clause.
1184
  /// \param EndLoc Ending location of the clause.
1185
  OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
1186
660
      : OMPClause(OMPC_capture, StartLoc, EndLoc) {}
1187
1188
  /// Build an empty clause.
1189
  OMPCaptureClause()
1190
112
      : OMPClause(OMPC_capture, SourceLocation(), SourceLocation()) {}
1191
1192
0
  child_range children() {
1193
0
    return child_range(child_iterator(), child_iterator());
1194
0
  }
1195
1196
  static bool classof(const OMPClause *T) {
1197
    return T->getClauseKind() == OMPC_capture;
1198
  }
1199
};
1200
1201
/// This represents 'seq_cst' clause in the '#pragma omp atomic'
1202
/// directive.
1203
///
1204
/// \code
1205
/// #pragma omp atomic seq_cst
1206
/// \endcode
1207
/// In this example directive '#pragma omp atomic' has 'seq_cst' clause.
1208
class OMPSeqCstClause : public OMPClause {
1209
public:
1210
  /// Build 'seq_cst' clause.
1211
  ///
1212
  /// \param StartLoc Starting location of the clause.
1213
  /// \param EndLoc Ending location of the clause.
1214
  OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
1215
128
      : OMPClause(OMPC_seq_cst, StartLoc, EndLoc) {}
1216
1217
  /// Build an empty clause.
1218
  OMPSeqCstClause()
1219
56
      : OMPClause(OMPC_seq_cst, SourceLocation(), SourceLocation()) {}
1220
1221
0
  child_range children() {
1222
0
    return child_range(child_iterator(), child_iterator());
1223
0
  }
1224
1225
380
  static bool classof(const OMPClause *T) {
1226
380
    return T->getClauseKind() == OMPC_seq_cst;
1227
380
  }
1228
};
1229
1230
/// This represents clause 'private' in the '#pragma omp ...' directives.
1231
///
1232
/// \code
1233
/// #pragma omp parallel private(a,b)
1234
/// \endcode
1235
/// In this example directive '#pragma omp parallel' has clause 'private'
1236
/// with the variables 'a' and 'b'.
1237
class OMPPrivateClause final
1238
    : public OMPVarListClause<OMPPrivateClause>,
1239
      private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
1240
  friend class OMPClauseReader;
1241
  friend OMPVarListClause;
1242
  friend TrailingObjects;
1243
1244
  /// Build clause with number of variables \a N.
1245
  ///
1246
  /// \param StartLoc Starting location of the clause.
1247
  /// \param LParenLoc Location of '('.
1248
  /// \param EndLoc Ending location of the clause.
1249
  /// \param N Number of the variables in the clause.
1250
  OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1251
                   SourceLocation EndLoc, unsigned N)
1252
      : OMPVarListClause<OMPPrivateClause>(OMPC_private, StartLoc, LParenLoc,
1253
7.62k
                                           EndLoc, N) {}
1254
1255
  /// Build an empty clause.
1256
  ///
1257
  /// \param N Number of variables.
1258
  explicit OMPPrivateClause(unsigned N)
1259
      : OMPVarListClause<OMPPrivateClause>(OMPC_private, SourceLocation(),
1260
                                           SourceLocation(), SourceLocation(),
1261
906
                                           N) {}
1262
1263
  /// Sets the list of references to private copies with initializers for
1264
  /// new private variables.
1265
  /// \param VL List of references.
1266
  void setPrivateCopies(ArrayRef<Expr *> VL);
1267
1268
  /// Gets the list of references to private copies with initializers for
1269
  /// new private variables.
1270
1.89k
  MutableArrayRef<Expr *> getPrivateCopies() {
1271
1.89k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1272
1.89k
  }
1273
2.57k
  ArrayRef<const Expr *> getPrivateCopies() const {
1274
2.57k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
1275
2.57k
  }
1276
1277
public:
1278
  /// Creates clause with a list of variables \a VL.
1279
  ///
1280
  /// \param C AST context.
1281
  /// \param StartLoc Starting location of the clause.
1282
  /// \param LParenLoc Location of '('.
1283
  /// \param EndLoc Ending location of the clause.
1284
  /// \param VL List of references to the variables.
1285
  /// \param PrivateVL List of references to private copies with initializers.
1286
  static OMPPrivateClause *Create(const ASTContext &C, SourceLocation StartLoc,
1287
                                  SourceLocation LParenLoc,
1288
                                  SourceLocation EndLoc, ArrayRef<Expr *> VL,
1289
                                  ArrayRef<Expr *> PrivateVL);
1290
1291
  /// Creates an empty clause with the place for \a N variables.
1292
  ///
1293
  /// \param C AST context.
1294
  /// \param N The number of variables.
1295
  static OMPPrivateClause *CreateEmpty(const ASTContext &C, unsigned N);
1296
1297
  using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
1298
  using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
1299
  using private_copies_range = llvm::iterator_range<private_copies_iterator>;
1300
  using private_copies_const_range =
1301
      llvm::iterator_range<private_copies_const_iterator>;
1302
1303
946
  private_copies_range private_copies() {
1304
946
    return private_copies_range(getPrivateCopies().begin(),
1305
946
                                getPrivateCopies().end());
1306
946
  }
1307
1308
1.28k
  private_copies_const_range private_copies() const {
1309
1.28k
    return private_copies_const_range(getPrivateCopies().begin(),
1310
1.28k
                                      getPrivateCopies().end());
1311
1.28k
  }
1312
1313
9.13k
  child_range children() {
1314
9.13k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1315
9.13k
                       reinterpret_cast<Stmt **>(varlist_end()));
1316
9.13k
  }
1317
1318
23.4k
  static bool classof(const OMPClause *T) {
1319
23.4k
    return T->getClauseKind() == OMPC_private;
1320
23.4k
  }
1321
};
1322
1323
/// This represents clause 'firstprivate' in the '#pragma omp ...'
1324
/// directives.
1325
///
1326
/// \code
1327
/// #pragma omp parallel firstprivate(a,b)
1328
/// \endcode
1329
/// In this example directive '#pragma omp parallel' has clause 'firstprivate'
1330
/// with the variables 'a' and 'b'.
1331
class OMPFirstprivateClause final
1332
    : public OMPVarListClause<OMPFirstprivateClause>,
1333
      public OMPClauseWithPreInit,
1334
      private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
1335
  friend class OMPClauseReader;
1336
  friend OMPVarListClause;
1337
  friend TrailingObjects;
1338
1339
  /// Build clause with number of variables \a N.
1340
  ///
1341
  /// \param StartLoc Starting location of the clause.
1342
  /// \param LParenLoc Location of '('.
1343
  /// \param EndLoc Ending location of the clause.
1344
  /// \param N Number of the variables in the clause.
1345
  OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1346
                        SourceLocation EndLoc, unsigned N)
1347
      : OMPVarListClause<OMPFirstprivateClause>(OMPC_firstprivate, StartLoc,
1348
                                                LParenLoc, EndLoc, N),
1349
20.9k
        OMPClauseWithPreInit(this) {}
1350
1351
  /// Build an empty clause.
1352
  ///
1353
  /// \param N Number of variables.
1354
  explicit OMPFirstprivateClause(unsigned N)
1355
      : OMPVarListClause<OMPFirstprivateClause>(
1356
            OMPC_firstprivate, SourceLocation(), SourceLocation(),
1357
            SourceLocation(), N),
1358
2.22k
        OMPClauseWithPreInit(this) {}
1359
1360
  /// Sets the list of references to private copies with initializers for
1361
  /// new private variables.
1362
  /// \param VL List of references.
1363
  void setPrivateCopies(ArrayRef<Expr *> VL);
1364
1365
  /// Gets the list of references to private copies with initializers for
1366
  /// new private variables.
1367
32.2k
  MutableArrayRef<Expr *> getPrivateCopies() {
1368
32.2k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1369
32.2k
  }
1370
22.6k
  ArrayRef<const Expr *> getPrivateCopies() const {
1371
22.6k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
1372
22.6k
  }
1373
1374
  /// Sets the list of references to initializer variables for new
1375
  /// private variables.
1376
  /// \param VL List of references.
1377
  void setInits(ArrayRef<Expr *> VL);
1378
1379
  /// Gets the list of references to initializer variables for new
1380
  /// private variables.
1381
4.53k
  MutableArrayRef<Expr *> getInits() {
1382
4.53k
    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
1383
4.53k
  }
1384
11.3k
  ArrayRef<const Expr *> getInits() const {
1385
11.3k
    return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1386
11.3k
  }
1387
1388
public:
1389
  /// Creates clause with a list of variables \a VL.
1390
  ///
1391
  /// \param C AST context.
1392
  /// \param StartLoc Starting location of the clause.
1393
  /// \param LParenLoc Location of '('.
1394
  /// \param EndLoc Ending location of the clause.
1395
  /// \param VL List of references to the original variables.
1396
  /// \param PrivateVL List of references to private copies with initializers.
1397
  /// \param InitVL List of references to auto generated variables used for
1398
  /// initialization of a single array element. Used if firstprivate variable is
1399
  /// of array type.
1400
  /// \param PreInit Statement that must be executed before entering the OpenMP
1401
  /// region with this clause.
1402
  static OMPFirstprivateClause *
1403
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
1404
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
1405
         ArrayRef<Expr *> InitVL, Stmt *PreInit);
1406
1407
  /// Creates an empty clause with the place for \a N variables.
1408
  ///
1409
  /// \param C AST context.
1410
  /// \param N The number of variables.
1411
  static OMPFirstprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
1412
1413
  using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
1414
  using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
1415
  using private_copies_range = llvm::iterator_range<private_copies_iterator>;
1416
  using private_copies_const_range =
1417
      llvm::iterator_range<private_copies_const_iterator>;
1418
1419
2.26k
  private_copies_range private_copies() {
1420
2.26k
    return private_copies_range(getPrivateCopies().begin(),
1421
2.26k
                                getPrivateCopies().end());
1422
2.26k
  }
1423
5.66k
  private_copies_const_range private_copies() const {
1424
5.66k
    return private_copies_const_range(getPrivateCopies().begin(),
1425
5.66k
                                      getPrivateCopies().end());
1426
5.66k
  }
1427
1428
  using inits_iterator = MutableArrayRef<Expr *>::iterator;
1429
  using inits_const_iterator = ArrayRef<const Expr *>::iterator;
1430
  using inits_range = llvm::iterator_range<inits_iterator>;
1431
  using inits_const_range = llvm::iterator_range<inits_const_iterator>;
1432
1433
2.26k
  inits_range inits() {
1434
2.26k
    return inits_range(getInits().begin(), getInits().end());
1435
2.26k
  }
1436
5.66k
  inits_const_range inits() const {
1437
5.66k
    return inits_const_range(getInits().begin(), getInits().end());
1438
5.66k
  }
1439
1440
5.32k
  child_range children() {
1441
5.32k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1442
5.32k
                       reinterpret_cast<Stmt **>(varlist_end()));
1443
5.32k
  }
1444
1445
32.5k
  static bool classof(const OMPClause *T) {
1446
32.5k
    return T->getClauseKind() == OMPC_firstprivate;
1447
32.5k
  }
1448
};
1449
1450
/// This represents clause 'lastprivate' in the '#pragma omp ...'
1451
/// directives.
1452
///
1453
/// \code
1454
/// #pragma omp simd lastprivate(a,b)
1455
/// \endcode
1456
/// In this example directive '#pragma omp simd' has clause 'lastprivate'
1457
/// with the variables 'a' and 'b'.
1458
class OMPLastprivateClause final
1459
    : public OMPVarListClause<OMPLastprivateClause>,
1460
      public OMPClauseWithPostUpdate,
1461
      private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
1462
  // There are 4 additional tail-allocated arrays at the end of the class:
1463
  // 1. Contains list of pseudo variables with the default initialization for
1464
  // each non-firstprivate variables. Used in codegen for initialization of
1465
  // lastprivate copies.
1466
  // 2. List of helper expressions for proper generation of assignment operation
1467
  // required for lastprivate clause. This list represents private variables
1468
  // (for arrays, single array element).
1469
  // 3. List of helper expressions for proper generation of assignment operation
1470
  // required for lastprivate clause. This list represents original variables
1471
  // (for arrays, single array element).
1472
  // 4. List of helper expressions that represents assignment operation:
1473
  // \code
1474
  // DstExprs = SrcExprs;
1475
  // \endcode
1476
  // Required for proper codegen of final assignment performed by the
1477
  // lastprivate clause.
1478
  friend class OMPClauseReader;
1479
  friend OMPVarListClause;
1480
  friend TrailingObjects;
1481
1482
  /// Build clause with number of variables \a N.
1483
  ///
1484
  /// \param StartLoc Starting location of the clause.
1485
  /// \param LParenLoc Location of '('.
1486
  /// \param EndLoc Ending location of the clause.
1487
  /// \param N Number of the variables in the clause.
1488
  OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1489
                       SourceLocation EndLoc, unsigned N)
1490
      : OMPVarListClause<OMPLastprivateClause>(OMPC_lastprivate, StartLoc,
1491
                                               LParenLoc, EndLoc, N),
1492
2.75k
        OMPClauseWithPostUpdate(this) {}
1493
1494
  /// Build an empty clause.
1495
  ///
1496
  /// \param N Number of variables.
1497
  explicit OMPLastprivateClause(unsigned N)
1498
      : OMPVarListClause<OMPLastprivateClause>(
1499
            OMPC_lastprivate, SourceLocation(), SourceLocation(),
1500
            SourceLocation(), N),
1501
270
        OMPClauseWithPostUpdate(this) {}
1502
1503
  /// Get the list of helper expressions for initialization of private
1504
  /// copies for lastprivate variables.
1505
11.6k
  MutableArrayRef<Expr *> getPrivateCopies() {
1506
11.6k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1507
11.6k
  }
1508
5.24k
  ArrayRef<const Expr *> getPrivateCopies() const {
1509
5.24k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
1510
5.24k
  }
1511
1512
  /// Set list of helper expressions, required for proper codegen of the
1513
  /// clause. These expressions represent private variables (for arrays, single
1514
  /// array element) in the final assignment statement performed by the
1515
  /// lastprivate clause.
1516
  void setSourceExprs(ArrayRef<Expr *> SrcExprs);
1517
1518
  /// Get the list of helper source expressions.
1519
7.95k
  MutableArrayRef<Expr *> getSourceExprs() {
1520
7.95k
    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
1521
7.95k
  }
1522
4.39k
  ArrayRef<const Expr *> getSourceExprs() const {
1523
4.39k
    return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1524
4.39k
  }
1525
1526
  /// Set list of helper expressions, required for proper codegen of the
1527
  /// clause. These expressions represent original variables (for arrays, single
1528
  /// array element) in the final assignment statement performed by the
1529
  /// lastprivate clause.
1530
  void setDestinationExprs(ArrayRef<Expr *> DstExprs);
1531
1532
  /// Get the list of helper destination expressions.
1533
4.29k
  MutableArrayRef<Expr *> getDestinationExprs() {
1534
4.29k
    return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
1535
4.29k
  }
1536
3.21k
  ArrayRef<const Expr *> getDestinationExprs() const {
1537
3.21k
    return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
1538
3.21k
  }
1539
1540
  /// Set list of helper assignment expressions, required for proper
1541
  /// codegen of the clause. These expressions are assignment expressions that
1542
  /// assign private copy of the variable to original variable.
1543
  void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
1544
1545
  /// Get the list of helper assignment expressions.
1546
636
  MutableArrayRef<Expr *> getAssignmentOps() {
1547
636
    return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
1548
636
  }
1549
1.18k
  ArrayRef<const Expr *> getAssignmentOps() const {
1550
1.18k
    return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
1551
1.18k
  }
1552
1553
public:
1554
  /// Creates clause with a list of variables \a VL.
1555
  ///
1556
  /// \param C AST context.
1557
  /// \param StartLoc Starting location of the clause.
1558
  /// \param LParenLoc Location of '('.
1559
  /// \param EndLoc Ending location of the clause.
1560
  /// \param VL List of references to the variables.
1561
  /// \param SrcExprs List of helper expressions for proper generation of
1562
  /// assignment operation required for lastprivate clause. This list represents
1563
  /// private variables (for arrays, single array element).
1564
  /// \param DstExprs List of helper expressions for proper generation of
1565
  /// assignment operation required for lastprivate clause. This list represents
1566
  /// original variables (for arrays, single array element).
1567
  /// \param AssignmentOps List of helper expressions that represents assignment
1568
  /// operation:
1569
  /// \code
1570
  /// DstExprs = SrcExprs;
1571
  /// \endcode
1572
  /// Required for proper codegen of final assignment performed by the
1573
  /// lastprivate clause.
1574
  /// \param PreInit Statement that must be executed before entering the OpenMP
1575
  /// region with this clause.
1576
  /// \param PostUpdate Expression that must be executed after exit from the
1577
  /// OpenMP region with this clause.
1578
  static OMPLastprivateClause *
1579
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
1580
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
1581
         ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
1582
         Stmt *PreInit, Expr *PostUpdate);
1583
1584
  /// Creates an empty clause with the place for \a N variables.
1585
  ///
1586
  /// \param C AST context.
1587
  /// \param N The number of variables.
1588
  static OMPLastprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
1589
1590
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
1591
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
1592
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
1593
  using helper_expr_const_range =
1594
      llvm::iterator_range<helper_expr_const_iterator>;
1595
1596
  /// Set list of helper expressions, required for generation of private
1597
  /// copies of original lastprivate variables.
1598
  void setPrivateCopies(ArrayRef<Expr *> PrivateCopies);
1599
1600
426
  helper_expr_const_range private_copies() const {
1601
426
    return helper_expr_const_range(getPrivateCopies().begin(),
1602
426
                                   getPrivateCopies().end());
1603
426
  }
1604
1605
318
  helper_expr_range private_copies() {
1606
318
    return helper_expr_range(getPrivateCopies().begin(),
1607
318
                             getPrivateCopies().end());
1608
318
  }
1609
1610
590
  helper_expr_const_range source_exprs() const {
1611
590
    return helper_expr_const_range(getSourceExprs().begin(),
1612
590
                                   getSourceExprs().end());
1613
590
  }
1614
1615
318
  helper_expr_range source_exprs() {
1616
318
    return helper_expr_range(getSourceExprs().begin(), getSourceExprs().end());
1617
318
  }
1618
1619
1.01k
  helper_expr_const_range destination_exprs() const {
1620
1.01k
    return helper_expr_const_range(getDestinationExprs().begin(),
1621
1.01k
                                   getDestinationExprs().end());
1622
1.01k
  }
1623
1624
318
  helper_expr_range destination_exprs() {
1625
318
    return helper_expr_range(getDestinationExprs().begin(),
1626
318
                             getDestinationExprs().end());
1627
318
  }
1628
1629
590
  helper_expr_const_range assignment_ops() const {
1630
590
    return helper_expr_const_range(getAssignmentOps().begin(),
1631
590
                                   getAssignmentOps().end());
1632
590
  }
1633
1634
318
  helper_expr_range assignment_ops() {
1635
318
    return helper_expr_range(getAssignmentOps().begin(),
1636
318
                             getAssignmentOps().end());
1637
318
  }
1638
1639
3.82k
  child_range children() {
1640
3.82k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1641
3.82k
                       reinterpret_cast<Stmt **>(varlist_end()));
1642
3.82k
  }
1643
1644
114k
  static bool classof(const OMPClause *T) {
1645
114k
    return T->getClauseKind() == OMPC_lastprivate;
1646
114k
  }
1647
};
1648
1649
/// This represents clause 'shared' in the '#pragma omp ...' directives.
1650
///
1651
/// \code
1652
/// #pragma omp parallel shared(a,b)
1653
/// \endcode
1654
/// In this example directive '#pragma omp parallel' has clause 'shared'
1655
/// with the variables 'a' and 'b'.
1656
class OMPSharedClause final
1657
    : public OMPVarListClause<OMPSharedClause>,
1658
      private llvm::TrailingObjects<OMPSharedClause, Expr *> {
1659
  friend OMPVarListClause;
1660
  friend TrailingObjects;
1661
1662
  /// Build clause with number of variables \a N.
1663
  ///
1664
  /// \param StartLoc Starting location of the clause.
1665
  /// \param LParenLoc Location of '('.
1666
  /// \param EndLoc Ending location of the clause.
1667
  /// \param N Number of the variables in the clause.
1668
  OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1669
                  SourceLocation EndLoc, unsigned N)
1670
      : OMPVarListClause<OMPSharedClause>(OMPC_shared, StartLoc, LParenLoc,
1671
2.03k
                                          EndLoc, N) {}
1672
1673
  /// Build an empty clause.
1674
  ///
1675
  /// \param N Number of variables.
1676
  explicit OMPSharedClause(unsigned N)
1677
      : OMPVarListClause<OMPSharedClause>(OMPC_shared, SourceLocation(),
1678
                                          SourceLocation(), SourceLocation(),
1679
156
                                          N) {}
1680
1681
public:
1682
  /// Creates clause with a list of variables \a VL.
1683
  ///
1684
  /// \param C AST context.
1685
  /// \param StartLoc Starting location of the clause.
1686
  /// \param LParenLoc Location of '('.
1687
  /// \param EndLoc Ending location of the clause.
1688
  /// \param VL List of references to the variables.
1689
  static OMPSharedClause *Create(const ASTContext &C, SourceLocation StartLoc,
1690
                                 SourceLocation LParenLoc,
1691
                                 SourceLocation EndLoc, ArrayRef<Expr *> VL);
1692
1693
  /// Creates an empty clause with \a N variables.
1694
  ///
1695
  /// \param C AST context.
1696
  /// \param N The number of variables.
1697
  static OMPSharedClause *CreateEmpty(const ASTContext &C, unsigned N);
1698
1699
366
  child_range children() {
1700
366
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1701
366
                       reinterpret_cast<Stmt **>(varlist_end()));
1702
366
  }
1703
1704
  static bool classof(const OMPClause *T) {
1705
    return T->getClauseKind() == OMPC_shared;
1706
  }
1707
};
1708
1709
/// This represents clause 'reduction' in the '#pragma omp ...'
1710
/// directives.
1711
///
1712
/// \code
1713
/// #pragma omp parallel reduction(+:a,b)
1714
/// \endcode
1715
/// In this example directive '#pragma omp parallel' has clause 'reduction'
1716
/// with operator '+' and the variables 'a' and 'b'.
1717
class OMPReductionClause final
1718
    : public OMPVarListClause<OMPReductionClause>,
1719
      public OMPClauseWithPostUpdate,
1720
      private llvm::TrailingObjects<OMPReductionClause, Expr *> {
1721
  friend class OMPClauseReader;
1722
  friend OMPVarListClause;
1723
  friend TrailingObjects;
1724
1725
  /// Location of ':'.
1726
  SourceLocation ColonLoc;
1727
1728
  /// Nested name specifier for C++.
1729
  NestedNameSpecifierLoc QualifierLoc;
1730
1731
  /// Name of custom operator.
1732
  DeclarationNameInfo NameInfo;
1733
1734
  /// Build clause with number of variables \a N.
1735
  ///
1736
  /// \param StartLoc Starting location of the clause.
1737
  /// \param LParenLoc Location of '('.
1738
  /// \param EndLoc Ending location of the clause.
1739
  /// \param ColonLoc Location of ':'.
1740
  /// \param N Number of the variables in the clause.
1741
  /// \param QualifierLoc The nested-name qualifier with location information
1742
  /// \param NameInfo The full name info for reduction identifier.
1743
  OMPReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1744
                     SourceLocation ColonLoc, SourceLocation EndLoc, unsigned N,
1745
                     NestedNameSpecifierLoc QualifierLoc,
1746
                     const DeclarationNameInfo &NameInfo)
1747
      : OMPVarListClause<OMPReductionClause>(OMPC_reduction, StartLoc,
1748
                                             LParenLoc, EndLoc, N),
1749
        OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
1750
10.6k
        QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1751
1752
  /// Build an empty clause.
1753
  ///
1754
  /// \param N Number of variables.
1755
  explicit OMPReductionClause(unsigned N)
1756
      : OMPVarListClause<OMPReductionClause>(OMPC_reduction, SourceLocation(),
1757
                                             SourceLocation(), SourceLocation(),
1758
                                             N),
1759
574
        OMPClauseWithPostUpdate(this) {}
1760
1761
  /// Sets location of ':' symbol in clause.
1762
574
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
1763
1764
  /// Sets the name info for specified reduction identifier.
1765
574
  void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
1766
1767
  /// Sets the nested name specifier.
1768
574
  void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
1769
1770
  /// Set list of helper expressions, required for proper codegen of the
1771
  /// clause. These expressions represent private copy of the reduction
1772
  /// variable.
1773
  void setPrivates(ArrayRef<Expr *> Privates);
1774
1775
  /// Get the list of helper privates.
1776
53.7k
  MutableArrayRef<Expr *> getPrivates() {
1777
53.7k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1778
53.7k
  }
1779
14.2k
  ArrayRef<const Expr *> getPrivates() const {
1780
14.2k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
1781
14.2k
  }
1782
1783
  /// Set list of helper expressions, required for proper codegen of the
1784
  /// clause. These expressions represent LHS expression in the final
1785
  /// reduction expression performed by the reduction clause.
1786
  void setLHSExprs(ArrayRef<Expr *> LHSExprs);
1787
1788
  /// Get the list of helper LHS expressions.
1789
41.2k
  MutableArrayRef<Expr *> getLHSExprs() {
1790
41.2k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
1791
41.2k
  }
1792
10.6k
  ArrayRef<const Expr *> getLHSExprs() const {
1793
10.6k
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
1794
10.6k
  }
1795
1796
  /// Set list of helper expressions, required for proper codegen of the
1797
  /// clause. These expressions represent RHS expression in the final
1798
  /// reduction expression performed by the reduction clause.
1799
  /// Also, variables in these expressions are used for proper initialization of
1800
  /// reduction copies.
1801
  void setRHSExprs(ArrayRef<Expr *> RHSExprs);
1802
1803
  /// Get the list of helper destination expressions.
1804
28.8k
  MutableArrayRef<Expr *> getRHSExprs() {
1805
28.8k
    return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
1806
28.8k
  }
1807
7.10k
  ArrayRef<const Expr *> getRHSExprs() const {
1808
7.10k
    return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
1809
7.10k
  }
1810
1811
  /// Set list of helper reduction expressions, required for proper
1812
  /// codegen of the clause. These expressions are binary expressions or
1813
  /// operator/custom reduction call that calculates new value from source
1814
  /// helper expressions to destination helper expressions.
1815
  void setReductionOps(ArrayRef<Expr *> ReductionOps);
1816
1817
  /// Get the list of helper reduction expressions.
1818
16.4k
  MutableArrayRef<Expr *> getReductionOps() {
1819
16.4k
    return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
1820
16.4k
  }
1821
3.55k
  ArrayRef<const Expr *> getReductionOps() const {
1822
3.55k
    return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
1823
3.55k
  }
1824
1825
public:
1826
  /// Creates clause with a list of variables \a VL.
1827
  ///
1828
  /// \param StartLoc Starting location of the clause.
1829
  /// \param LParenLoc Location of '('.
1830
  /// \param ColonLoc Location of ':'.
1831
  /// \param EndLoc Ending location of the clause.
1832
  /// \param VL The variables in the clause.
1833
  /// \param QualifierLoc The nested-name qualifier with location information
1834
  /// \param NameInfo The full name info for reduction identifier.
1835
  /// \param Privates List of helper expressions for proper generation of
1836
  /// private copies.
1837
  /// \param LHSExprs List of helper expressions for proper generation of
1838
  /// assignment operation required for copyprivate clause. This list represents
1839
  /// LHSs of the reduction expressions.
1840
  /// \param RHSExprs List of helper expressions for proper generation of
1841
  /// assignment operation required for copyprivate clause. This list represents
1842
  /// RHSs of the reduction expressions.
1843
  /// Also, variables in these expressions are used for proper initialization of
1844
  /// reduction copies.
1845
  /// \param ReductionOps List of helper expressions that represents reduction
1846
  /// expressions:
1847
  /// \code
1848
  /// LHSExprs binop RHSExprs;
1849
  /// operator binop(LHSExpr, RHSExpr);
1850
  /// <CutomReduction>(LHSExpr, RHSExpr);
1851
  /// \endcode
1852
  /// Required for proper codegen of final reduction operation performed by the
1853
  /// reduction clause.
1854
  /// \param PreInit Statement that must be executed before entering the OpenMP
1855
  /// region with this clause.
1856
  /// \param PostUpdate Expression that must be executed after exit from the
1857
  /// OpenMP region with this clause.
1858
  static OMPReductionClause *
1859
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
1860
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
1861
         NestedNameSpecifierLoc QualifierLoc,
1862
         const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
1863
         ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
1864
         ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
1865
1866
  /// Creates an empty clause with the place for \a N variables.
1867
  ///
1868
  /// \param C AST context.
1869
  /// \param N The number of variables.
1870
  static OMPReductionClause *CreateEmpty(const ASTContext &C, unsigned N);
1871
1872
  /// Gets location of ':' symbol in clause.
1873
8.22k
  SourceLocation getColonLoc() const { return ColonLoc; }
1874
1875
  /// Gets the name info for specified reduction identifier.
1876
9.70k
  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
1877
1878
  /// Gets the nested name specifier.
1879
9.47k
  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
1880
1881
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
1882
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
1883
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
1884
  using helper_expr_const_range =
1885
      llvm::iterator_range<helper_expr_const_iterator>;
1886
1887
1.77k
  helper_expr_const_range privates() const {
1888
1.77k
    return helper_expr_const_range(getPrivates().begin(), getPrivates().end());
1889
1.77k
  }
1890
1891
593
  helper_expr_range privates() {
1892
593
    return helper_expr_range(getPrivates().begin(), getPrivates().end());
1893
593
  }
1894
1895
1.77k
  helper_expr_const_range lhs_exprs() const {
1896
1.77k
    return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end());
1897
1.77k
  }
1898
1899
593
  helper_expr_range lhs_exprs() {
1900
593
    return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end());
1901
593
  }
1902
1903
1.77k
  helper_expr_const_range rhs_exprs() const {
1904
1.77k
    return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end());
1905
1.77k
  }
1906
1907
593
  helper_expr_range rhs_exprs() {
1908
593
    return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end());
1909
593
  }
1910
1911
1.77k
  helper_expr_const_range reduction_ops() const {
1912
1.77k
    return helper_expr_const_range(getReductionOps().begin(),
1913
1.77k
                                   getReductionOps().end());
1914
1.77k
  }
1915
1916
8.22k
  helper_expr_range reduction_ops() {
1917
8.22k
    return helper_expr_range(getReductionOps().begin(),
1918
8.22k
                             getReductionOps().end());
1919
8.22k
  }
1920
1921
12.7k
  child_range children() {
1922
12.7k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1923
12.7k
                       reinterpret_cast<Stmt **>(varlist_end()));
1924
12.7k
  }
1925
1926
40.4k
  static bool classof(const OMPClause *T) {
1927
40.4k
    return T->getClauseKind() == OMPC_reduction;
1928
40.4k
  }
1929
};
1930
1931
/// This represents clause 'task_reduction' in the '#pragma omp taskgroup'
1932
/// directives.
1933
///
1934
/// \code
1935
/// #pragma omp taskgroup task_reduction(+:a,b)
1936
/// \endcode
1937
/// In this example directive '#pragma omp taskgroup' has clause
1938
/// 'task_reduction' with operator '+' and the variables 'a' and 'b'.
1939
class OMPTaskReductionClause final
1940
    : public OMPVarListClause<OMPTaskReductionClause>,
1941
      public OMPClauseWithPostUpdate,
1942
      private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
1943
  friend class OMPClauseReader;
1944
  friend OMPVarListClause;
1945
  friend TrailingObjects;
1946
1947
  /// Location of ':'.
1948
  SourceLocation ColonLoc;
1949
1950
  /// Nested name specifier for C++.
1951
  NestedNameSpecifierLoc QualifierLoc;
1952
1953
  /// Name of custom operator.
1954
  DeclarationNameInfo NameInfo;
1955
1956
  /// Build clause with number of variables \a N.
1957
  ///
1958
  /// \param StartLoc Starting location of the clause.
1959
  /// \param LParenLoc Location of '('.
1960
  /// \param EndLoc Ending location of the clause.
1961
  /// \param ColonLoc Location of ':'.
1962
  /// \param N Number of the variables in the clause.
1963
  /// \param QualifierLoc The nested-name qualifier with location information
1964
  /// \param NameInfo The full name info for reduction identifier.
1965
  OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1966
                         SourceLocation ColonLoc, SourceLocation EndLoc,
1967
                         unsigned N, NestedNameSpecifierLoc QualifierLoc,
1968
                         const DeclarationNameInfo &NameInfo)
1969
      : OMPVarListClause<OMPTaskReductionClause>(OMPC_task_reduction, StartLoc,
1970
                                                 LParenLoc, EndLoc, N),
1971
        OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
1972
1.41k
        QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1973
1974
  /// Build an empty clause.
1975
  ///
1976
  /// \param N Number of variables.
1977
  explicit OMPTaskReductionClause(unsigned N)
1978
      : OMPVarListClause<OMPTaskReductionClause>(
1979
            OMPC_task_reduction, SourceLocation(), SourceLocation(),
1980
            SourceLocation(), N),
1981
50
        OMPClauseWithPostUpdate(this) {}
1982
1983
  /// Sets location of ':' symbol in clause.
1984
50
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
1985
1986
  /// Sets the name info for specified reduction identifier.
1987
50
  void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
1988
1989
  /// Sets the nested name specifier.
1990
50
  void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
1991
1992
  /// Set list of helper expressions, required for proper codegen of the clause.
1993
  /// These expressions represent private copy of the reduction variable.
1994
  void setPrivates(ArrayRef<Expr *> Privates);
1995
1996
  /// Get the list of helper privates.
1997
6.41k
  MutableArrayRef<Expr *> getPrivates() {
1998
6.41k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1999
6.41k
  }
2000
480
  ArrayRef<const Expr *> getPrivates() const {
2001
480
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2002
480
  }
2003
2004
  /// Set list of helper expressions, required for proper codegen of the clause.
2005
  /// These expressions represent LHS expression in the final reduction
2006
  /// expression performed by the reduction clause.
2007
  void setLHSExprs(ArrayRef<Expr *> LHSExprs);
2008
2009
  /// Get the list of helper LHS expressions.
2010
4.84k
  MutableArrayRef<Expr *> getLHSExprs() {
2011
4.84k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
2012
4.84k
  }
2013
360
  ArrayRef<const Expr *> getLHSExprs() const {
2014
360
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
2015
360
  }
2016
2017
  /// Set list of helper expressions, required for proper codegen of the clause.
2018
  /// These expressions represent RHS expression in the final reduction
2019
  /// expression performed by the reduction clause. Also, variables in these
2020
  /// expressions are used for proper initialization of reduction copies.
2021
  void setRHSExprs(ArrayRef<Expr *> RHSExprs);
2022
2023
  ///  Get the list of helper destination expressions.
2024
3.27k
  MutableArrayRef<Expr *> getRHSExprs() {
2025
3.27k
    return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
2026
3.27k
  }
2027
240
  ArrayRef<const Expr *> getRHSExprs() const {
2028
240
    return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2029
240
  }
2030
2031
  /// Set list of helper reduction expressions, required for proper
2032
  /// codegen of the clause. These expressions are binary expressions or
2033
  /// operator/custom reduction call that calculates new value from source
2034
  /// helper expressions to destination helper expressions.
2035
  void setReductionOps(ArrayRef<Expr *> ReductionOps);
2036
2037
  ///  Get the list of helper reduction expressions.
2038
1.70k
  MutableArrayRef<Expr *> getReductionOps() {
2039
1.70k
    return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
2040
1.70k
  }
2041
120
  ArrayRef<const Expr *> getReductionOps() const {
2042
120
    return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2043
120
  }
2044
2045
public:
2046
  /// Creates clause with a list of variables \a VL.
2047
  ///
2048
  /// \param StartLoc Starting location of the clause.
2049
  /// \param LParenLoc Location of '('.
2050
  /// \param ColonLoc Location of ':'.
2051
  /// \param EndLoc Ending location of the clause.
2052
  /// \param VL The variables in the clause.
2053
  /// \param QualifierLoc The nested-name qualifier with location information
2054
  /// \param NameInfo The full name info for reduction identifier.
2055
  /// \param Privates List of helper expressions for proper generation of
2056
  /// private copies.
2057
  /// \param LHSExprs List of helper expressions for proper generation of
2058
  /// assignment operation required for copyprivate clause. This list represents
2059
  /// LHSs of the reduction expressions.
2060
  /// \param RHSExprs List of helper expressions for proper generation of
2061
  /// assignment operation required for copyprivate clause. This list represents
2062
  /// RHSs of the reduction expressions.
2063
  /// Also, variables in these expressions are used for proper initialization of
2064
  /// reduction copies.
2065
  /// \param ReductionOps List of helper expressions that represents reduction
2066
  /// expressions:
2067
  /// \code
2068
  /// LHSExprs binop RHSExprs;
2069
  /// operator binop(LHSExpr, RHSExpr);
2070
  /// <CutomReduction>(LHSExpr, RHSExpr);
2071
  /// \endcode
2072
  /// Required for proper codegen of final reduction operation performed by the
2073
  /// reduction clause.
2074
  /// \param PreInit Statement that must be executed before entering the OpenMP
2075
  /// region with this clause.
2076
  /// \param PostUpdate Expression that must be executed after exit from the
2077
  /// OpenMP region with this clause.
2078
  static OMPTaskReductionClause *
2079
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2080
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
2081
         NestedNameSpecifierLoc QualifierLoc,
2082
         const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
2083
         ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
2084
         ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
2085
2086
  /// Creates an empty clause with the place for \a N variables.
2087
  ///
2088
  /// \param C AST context.
2089
  /// \param N The number of variables.
2090
  static OMPTaskReductionClause *CreateEmpty(const ASTContext &C, unsigned N);
2091
2092
  /// Gets location of ':' symbol in clause.
2093
854
  SourceLocation getColonLoc() const { return ColonLoc; }
2094
2095
  /// Gets the name info for specified reduction identifier.
2096
1.01k
  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
2097
2098
  /// Gets the nested name specifier.
2099
1.00k
  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
2100
2101
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
2102
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
2103
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
2104
  using helper_expr_const_range =
2105
      llvm::iterator_range<helper_expr_const_iterator>;
2106
2107
60
  helper_expr_const_range privates() const {
2108
60
    return helper_expr_const_range(getPrivates().begin(), getPrivates().end());
2109
60
  }
2110
2111
50
  helper_expr_range privates() {
2112
50
    return helper_expr_range(getPrivates().begin(), getPrivates().end());
2113
50
  }
2114
2115
60
  helper_expr_const_range lhs_exprs() const {
2116
60
    return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end());
2117
60
  }
2118
2119
50
  helper_expr_range lhs_exprs() {
2120
50
    return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end());
2121
50
  }
2122
2123
60
  helper_expr_const_range rhs_exprs() const {
2124
60
    return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end());
2125
60
  }
2126
2127
50
  helper_expr_range rhs_exprs() {
2128
50
    return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end());
2129
50
  }
2130
2131
60
  helper_expr_const_range reduction_ops() const {
2132
60
    return helper_expr_const_range(getReductionOps().begin(),
2133
60
                                   getReductionOps().end());
2134
60
  }
2135
2136
854
  helper_expr_range reduction_ops() {
2137
854
    return helper_expr_range(getReductionOps().begin(),
2138
854
                             getReductionOps().end());
2139
854
  }
2140
2141
1.33k
  child_range children() {
2142
1.33k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2143
1.33k
                       reinterpret_cast<Stmt **>(varlist_end()));
2144
1.33k
  }
2145
2146
18
  static bool classof(const OMPClause *T) {
2147
18
    return T->getClauseKind() == OMPC_task_reduction;
2148
18
  }
2149
};
2150
2151
/// This represents clause 'in_reduction' in the '#pragma omp task' directives.
2152
///
2153
/// \code
2154
/// #pragma omp task in_reduction(+:a,b)
2155
/// \endcode
2156
/// In this example directive '#pragma omp task' has clause 'in_reduction' with
2157
/// operator '+' and the variables 'a' and 'b'.
2158
class OMPInReductionClause final
2159
    : public OMPVarListClause<OMPInReductionClause>,
2160
      public OMPClauseWithPostUpdate,
2161
      private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
2162
  friend class OMPClauseReader;
2163
  friend OMPVarListClause;
2164
  friend TrailingObjects;
2165
2166
  /// Location of ':'.
2167
  SourceLocation ColonLoc;
2168
2169
  /// Nested name specifier for C++.
2170
  NestedNameSpecifierLoc QualifierLoc;
2171
2172
  /// Name of custom operator.
2173
  DeclarationNameInfo NameInfo;
2174
2175
  /// Build clause with number of variables \a N.
2176
  ///
2177
  /// \param StartLoc Starting location of the clause.
2178
  /// \param LParenLoc Location of '('.
2179
  /// \param EndLoc Ending location of the clause.
2180
  /// \param ColonLoc Location of ':'.
2181
  /// \param N Number of the variables in the clause.
2182
  /// \param QualifierLoc The nested-name qualifier with location information
2183
  /// \param NameInfo The full name info for reduction identifier.
2184
  OMPInReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2185
                       SourceLocation ColonLoc, SourceLocation EndLoc,
2186
                       unsigned N, NestedNameSpecifierLoc QualifierLoc,
2187
                       const DeclarationNameInfo &NameInfo)
2188
      : OMPVarListClause<OMPInReductionClause>(OMPC_in_reduction, StartLoc,
2189
                                               LParenLoc, EndLoc, N),
2190
        OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
2191
834
        QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
2192
2193
  /// Build an empty clause.
2194
  ///
2195
  /// \param N Number of variables.
2196
  explicit OMPInReductionClause(unsigned N)
2197
      : OMPVarListClause<OMPInReductionClause>(
2198
            OMPC_in_reduction, SourceLocation(), SourceLocation(),
2199
            SourceLocation(), N),
2200
28
        OMPClauseWithPostUpdate(this) {}
2201
2202
  /// Sets location of ':' symbol in clause.
2203
28
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
2204
2205
  /// Sets the name info for specified reduction identifier.
2206
28
  void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
2207
2208
  /// Sets the nested name specifier.
2209
28
  void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
2210
2211
  /// Set list of helper expressions, required for proper codegen of the clause.
2212
  /// These expressions represent private copy of the reduction variable.
2213
  void setPrivates(ArrayRef<Expr *> Privates);
2214
2215
  /// Get the list of helper privates.
2216
7.65k
  MutableArrayRef<Expr *> getPrivates() {
2217
7.65k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2218
7.65k
  }
2219
72
  ArrayRef<const Expr *> getPrivates() const {
2220
72
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2221
72
  }
2222
2223
  /// Set list of helper expressions, required for proper codegen of the clause.
2224
  /// These expressions represent LHS expression in the final reduction
2225
  /// expression performed by the reduction clause.
2226
  void setLHSExprs(ArrayRef<Expr *> LHSExprs);
2227
2228
  /// Get the list of helper LHS expressions.
2229
6.73k
  MutableArrayRef<Expr *> getLHSExprs() {
2230
6.73k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
2231
6.73k
  }
2232
48
  ArrayRef<const Expr *> getLHSExprs() const {
2233
48
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
2234
48
  }
2235
2236
  /// Set list of helper expressions, required for proper codegen of the clause.
2237
  /// These expressions represent RHS expression in the final reduction
2238
  /// expression performed by the reduction clause. Also, variables in these
2239
  /// expressions are used for proper initialization of reduction copies.
2240
  void setRHSExprs(ArrayRef<Expr *> RHSExprs);
2241
2242
  ///  Get the list of helper destination expressions.
2243
5.81k
  MutableArrayRef<Expr *> getRHSExprs() {
2244
5.81k
    return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
2245
5.81k
  }
2246
48
  ArrayRef<const Expr *> getRHSExprs() const {
2247
48
    return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2248
48
  }
2249
2250
  /// Set list of helper reduction expressions, required for proper
2251
  /// codegen of the clause. These expressions are binary expressions or
2252
  /// operator/custom reduction call that calculates new value from source
2253
  /// helper expressions to destination helper expressions.
2254
  void setReductionOps(ArrayRef<Expr *> ReductionOps);
2255
2256
  ///  Get the list of helper reduction expressions.
2257
4.89k
  MutableArrayRef<Expr *> getReductionOps() {
2258
4.89k
    return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
2259
4.89k
  }
2260
48
  ArrayRef<const Expr *> getReductionOps() const {
2261
48
    return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2262
48
  }
2263
2264
  /// Set list of helper reduction taskgroup descriptors.
2265
  void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
2266
2267
  ///  Get the list of helper reduction taskgroup descriptors.
2268
2.65k
  MutableArrayRef<Expr *> getTaskgroupDescriptors() {
2269
2.65k
    return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size());
2270
2.65k
  }
2271
24
  ArrayRef<const Expr *> getTaskgroupDescriptors() const {
2272
24
    return llvm::makeArrayRef(getReductionOps().end(), varlist_size());
2273
24
  }
2274
2275
public:
2276
  /// Creates clause with a list of variables \a VL.
2277
  ///
2278
  /// \param StartLoc Starting location of the clause.
2279
  /// \param LParenLoc Location of '('.
2280
  /// \param ColonLoc Location of ':'.
2281
  /// \param EndLoc Ending location of the clause.
2282
  /// \param VL The variables in the clause.
2283
  /// \param QualifierLoc The nested-name qualifier with location information
2284
  /// \param NameInfo The full name info for reduction identifier.
2285
  /// \param Privates List of helper expressions for proper generation of
2286
  /// private copies.
2287
  /// \param LHSExprs List of helper expressions for proper generation of
2288
  /// assignment operation required for copyprivate clause. This list represents
2289
  /// LHSs of the reduction expressions.
2290
  /// \param RHSExprs List of helper expressions for proper generation of
2291
  /// assignment operation required for copyprivate clause. This list represents
2292
  /// RHSs of the reduction expressions.
2293
  /// Also, variables in these expressions are used for proper initialization of
2294
  /// reduction copies.
2295
  /// \param ReductionOps List of helper expressions that represents reduction
2296
  /// expressions:
2297
  /// \code
2298
  /// LHSExprs binop RHSExprs;
2299
  /// operator binop(LHSExpr, RHSExpr);
2300
  /// <CutomReduction>(LHSExpr, RHSExpr);
2301
  /// \endcode
2302
  /// Required for proper codegen of final reduction operation performed by the
2303
  /// reduction clause.
2304
  /// \param TaskgroupDescriptors List of helper taskgroup descriptors for
2305
  /// corresponding items in parent taskgroup task_reduction clause.
2306
  /// \param PreInit Statement that must be executed before entering the OpenMP
2307
  /// region with this clause.
2308
  /// \param PostUpdate Expression that must be executed after exit from the
2309
  /// OpenMP region with this clause.
2310
  static OMPInReductionClause *
2311
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2312
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
2313
         NestedNameSpecifierLoc QualifierLoc,
2314
         const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
2315
         ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
2316
         ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
2317
         Stmt *PreInit, Expr *PostUpdate);
2318
2319
  /// Creates an empty clause with the place for \a N variables.
2320
  ///
2321
  /// \param C AST context.
2322
  /// \param N The number of variables.
2323
  static OMPInReductionClause *CreateEmpty(const ASTContext &C, unsigned N);
2324
2325
  /// Gets location of ':' symbol in clause.
2326
692
  SourceLocation getColonLoc() const { return ColonLoc; }
2327
2328
  /// Gets the name info for specified reduction identifier.
2329
760
  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
2330
2331
  /// Gets the nested name specifier.
2332
752
  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
2333
2334
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
2335
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
2336
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
2337
  using helper_expr_const_range =
2338
      llvm::iterator_range<helper_expr_const_iterator>;
2339
2340
12
  helper_expr_const_range privates() const {
2341
12
    return helper_expr_const_range(getPrivates().begin(), getPrivates().end());
2342
12
  }
2343
2344
28
  helper_expr_range privates() {
2345
28
    return helper_expr_range(getPrivates().begin(), getPrivates().end());
2346
28
  }
2347
2348
0
  helper_expr_const_range lhs_exprs() const {
2349
0
    return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end());
2350
0
  }
2351
2352
28
  helper_expr_range lhs_exprs() {
2353
28
    return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end());
2354
28
  }
2355
2356
0
  helper_expr_const_range rhs_exprs() const {
2357
0
    return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end());
2358
0
  }
2359
2360
28
  helper_expr_range rhs_exprs() {
2361
28
    return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end());
2362
28
  }
2363
2364
12
  helper_expr_const_range reduction_ops() const {
2365
12
    return helper_expr_const_range(getReductionOps().begin(),
2366
12
                                   getReductionOps().end());
2367
12
  }
2368
2369
692
  helper_expr_range reduction_ops() {
2370
692
    return helper_expr_range(getReductionOps().begin(),
2371
692
                             getReductionOps().end());
2372
692
  }
2373
2374
12
  helper_expr_const_range taskgroup_descriptors() const {
2375
12
    return helper_expr_const_range(getTaskgroupDescriptors().begin(),
2376
12
                                   getTaskgroupDescriptors().end());
2377
12
  }
2378
2379
1.32k
  helper_expr_range taskgroup_descriptors() {
2380
1.32k
    return helper_expr_range(getTaskgroupDescriptors().begin(),
2381
1.32k
                             getTaskgroupDescriptors().end());
2382
1.32k
  }
2383
2384
1.26k
  child_range children() {
2385
1.26k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2386
1.26k
                       reinterpret_cast<Stmt **>(varlist_end()));
2387
1.26k
  }
2388
2389
51.5k
  static bool classof(const OMPClause *T) {
2390
51.5k
    return T->getClauseKind() == OMPC_in_reduction;
2391
51.5k
  }
2392
};
2393
2394
/// This represents clause 'linear' in the '#pragma omp ...'
2395
/// directives.
2396
///
2397
/// \code
2398
/// #pragma omp simd linear(a,b : 2)
2399
/// \endcode
2400
/// In this example directive '#pragma omp simd' has clause 'linear'
2401
/// with variables 'a', 'b' and linear step '2'.
2402
class OMPLinearClause final
2403
    : public OMPVarListClause<OMPLinearClause>,
2404
      public OMPClauseWithPostUpdate,
2405
      private llvm::TrailingObjects<OMPLinearClause, Expr *> {
2406
  friend class OMPClauseReader;
2407
  friend OMPVarListClause;
2408
  friend TrailingObjects;
2409
2410
  /// Modifier of 'linear' clause.
2411
  OpenMPLinearClauseKind Modifier = OMPC_LINEAR_val;
2412
2413
  /// Location of linear modifier if any.
2414
  SourceLocation ModifierLoc;
2415
2416
  /// Location of ':'.
2417
  SourceLocation ColonLoc;
2418
2419
  /// Sets the linear step for clause.
2420
2.05k
  void setStep(Expr *Step) { *(getFinals().end()) = Step; }
2421
2422
  /// Sets the expression to calculate linear step for clause.
2423
2.05k
  void setCalcStep(Expr *CalcStep) { *(getFinals().end() + 1) = CalcStep; }
2424
2425
  /// Build 'linear' clause with given number of variables \a NumVars.
2426
  ///
2427
  /// \param StartLoc Starting location of the clause.
2428
  /// \param LParenLoc Location of '('.
2429
  /// \param ColonLoc Location of ':'.
2430
  /// \param EndLoc Ending location of the clause.
2431
  /// \param NumVars Number of variables.
2432
  OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2433
                  OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
2434
                  SourceLocation ColonLoc, SourceLocation EndLoc,
2435
                  unsigned NumVars)
2436
      : OMPVarListClause<OMPLinearClause>(OMPC_linear, StartLoc, LParenLoc,
2437
                                          EndLoc, NumVars),
2438
        OMPClauseWithPostUpdate(this), Modifier(Modifier),
2439
1.84k
        ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {}
2440
2441
  /// Build an empty clause.
2442
  ///
2443
  /// \param NumVars Number of variables.
2444
  explicit OMPLinearClause(unsigned NumVars)
2445
      : OMPVarListClause<OMPLinearClause>(OMPC_linear, SourceLocation(),
2446
                                          SourceLocation(), SourceLocation(),
2447
                                          NumVars),
2448
216
        OMPClauseWithPostUpdate(this) {}
2449
2450
  /// Gets the list of initial values for linear variables.
2451
  ///
2452
  /// There are NumVars expressions with initial values allocated after the
2453
  /// varlist, they are followed by NumVars update expressions (used to update
2454
  /// the linear variable's value on current iteration) and they are followed by
2455
  /// NumVars final expressions (used to calculate the linear variable's
2456
  /// value after the loop body). After these lists, there are 2 helper
2457
  /// expressions - linear step and a helper to calculate it before the
2458
  /// loop body (used when the linear step is not constant):
2459
  ///
2460
  /// { Vars[] /* in OMPVarListClause */; Privates[]; Inits[]; Updates[];
2461
  /// Finals[]; Step; CalcStep; }
2462
27.6k
  MutableArrayRef<Expr *> getPrivates() {
2463
27.6k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2464
27.6k
  }
2465
4.60k
  ArrayRef<const Expr *> getPrivates() const {
2466
4.60k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2467
4.60k
  }
2468
2469
22.4k
  MutableArrayRef<Expr *> getInits() {
2470
22.4k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
2471
22.4k
  }
2472
3.61k
  ArrayRef<const Expr *> getInits() const {
2473
3.61k
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
2474
3.61k
  }
2475
2476
  /// Sets the list of update expressions for linear variables.
2477
14.0k
  MutableArrayRef<Expr *> getUpdates() {
2478
14.0k
    return MutableArrayRef<Expr *>(getInits().end(), varlist_size());
2479
14.0k
  }
2480
2.62k
  ArrayRef<const Expr *> getUpdates() const {
2481
2.62k
    return llvm::makeArrayRef(getInits().end(), varlist_size());
2482
2.62k
  }
2483
2484
  /// Sets the list of final update expressions for linear variables.
2485
8.39k
  MutableArrayRef<Expr *> getFinals() {
2486
8.39k
    return MutableArrayRef<Expr *>(getUpdates().end(), varlist_size());
2487
8.39k
  }
2488
1.79k
  ArrayRef<const Expr *> getFinals() const {
2489
1.79k
    return llvm::makeArrayRef(getUpdates().end(), varlist_size());
2490
1.79k
  }
2491
2492
  /// Sets the list of the copies of original linear variables.
2493
  /// \param PL List of expressions.
2494
  void setPrivates(ArrayRef<Expr *> PL);
2495
2496
  /// Sets the list of the initial values for linear variables.
2497
  /// \param IL List of expressions.
2498
  void setInits(ArrayRef<Expr *> IL);
2499
2500
public:
2501
  /// Creates clause with a list of variables \a VL and a linear step
2502
  /// \a Step.
2503
  ///
2504
  /// \param C AST Context.
2505
  /// \param StartLoc Starting location of the clause.
2506
  /// \param LParenLoc Location of '('.
2507
  /// \param Modifier Modifier of 'linear' clause.
2508
  /// \param ModifierLoc Modifier location.
2509
  /// \param ColonLoc Location of ':'.
2510
  /// \param EndLoc Ending location of the clause.
2511
  /// \param VL List of references to the variables.
2512
  /// \param PL List of private copies of original variables.
2513
  /// \param IL List of initial values for the variables.
2514
  /// \param Step Linear step.
2515
  /// \param CalcStep Calculation of the linear step.
2516
  /// \param PreInit Statement that must be executed before entering the OpenMP
2517
  /// region with this clause.
2518
  /// \param PostUpdate Expression that must be executed after exit from the
2519
  /// OpenMP region with this clause.
2520
  static OMPLinearClause *
2521
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2522
         OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
2523
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
2524
         ArrayRef<Expr *> PL, ArrayRef<Expr *> IL, Expr *Step, Expr *CalcStep,
2525
         Stmt *PreInit, Expr *PostUpdate);
2526
2527
  /// Creates an empty clause with the place for \a NumVars variables.
2528
  ///
2529
  /// \param C AST context.
2530
  /// \param NumVars Number of variables.
2531
  static OMPLinearClause *CreateEmpty(const ASTContext &C, unsigned NumVars);
2532
2533
  /// Set modifier.
2534
216
  void setModifier(OpenMPLinearClauseKind Kind) { Modifier = Kind; }
2535
2536
  /// Return modifier.
2537
2.01k
  OpenMPLinearClauseKind getModifier() const { return Modifier; }
2538
2539
  /// Set modifier location.
2540
216
  void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; }
2541
2542
  /// Return modifier location.
2543
1.09k
  SourceLocation getModifierLoc() const { return ModifierLoc; }
2544
2545
  /// Sets the location of ':'.
2546
216
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
2547
2548
  /// Returns the location of ':'.
2549
642
  SourceLocation getColonLoc() const { return ColonLoc; }
2550
2551
  /// Returns linear step.
2552
2.29k
  Expr *getStep() { return *(getFinals().end()); }
2553
2554
  /// Returns linear step.
2555
272
  const Expr *getStep() const { return *(getFinals().end()); }
2556
2557
  /// Returns expression to calculate linear step.
2558
1.56k
  Expr *getCalcStep() { return *(getFinals().end() + 1); }
2559
2560
  /// Returns expression to calculate linear step.
2561
532
  const Expr *getCalcStep() const { return *(getFinals().end() + 1); }
2562
2563
  /// Sets the list of update expressions for linear variables.
2564
  /// \param UL List of expressions.
2565
  void setUpdates(ArrayRef<Expr *> UL);
2566
2567
  /// Sets the list of final update expressions for linear variables.
2568
  /// \param FL List of expressions.
2569
  void setFinals(ArrayRef<Expr *> FL);
2570
2571
  using privates_iterator = MutableArrayRef<Expr *>::iterator;
2572
  using privates_const_iterator = ArrayRef<const Expr *>::iterator;
2573
  using privates_range = llvm::iterator_range<privates_iterator>;
2574
  using privates_const_range = llvm::iterator_range<privates_const_iterator>;
2575
2576
1.56k
  privates_range privates() {
2577
1.56k
    return privates_range(getPrivates().begin(), getPrivates().end());
2578
1.56k
  }
2579
2580
494
  privates_const_range privates() const {
2581
494
    return privates_const_range(getPrivates().begin(), getPrivates().end());
2582
494
  }
2583
2584
  using inits_iterator = MutableArrayRef<Expr *>::iterator;
2585
  using inits_const_iterator = ArrayRef<const Expr *>::iterator;
2586
  using inits_range = llvm::iterator_range<inits_iterator>;
2587
  using inits_const_range = llvm::iterator_range<inits_const_iterator>;
2588
2589
1.56k
  inits_range inits() {
2590
1.56k
    return inits_range(getInits().begin(), getInits().end());
2591
1.56k
  }
2592
2593
494
  inits_const_range inits() const {
2594
494
    return inits_const_range(getInits().begin(), getInits().end());
2595
494
  }
2596
2597
  using updates_iterator = MutableArrayRef<Expr *>::iterator;
2598
  using updates_const_iterator = ArrayRef<const Expr *>::iterator;
2599
  using updates_range = llvm::iterator_range<updates_iterator>;
2600
  using updates_const_range = llvm::iterator_range<updates_const_iterator>;
2601
2602
216
  updates_range updates() {
2603
216
    return updates_range(getUpdates().begin(), getUpdates().end());
2604
216
  }
2605
2606
418
  updates_const_range updates() const {
2607
418
    return updates_const_range(getUpdates().begin(), getUpdates().end());
2608
418
  }
2609
2610
  using finals_iterator = MutableArrayRef<Expr *>::iterator;
2611
  using finals_const_iterator = ArrayRef<const Expr *>::iterator;
2612
  using finals_range = llvm::iterator_range<finals_iterator>;
2613
  using finals_const_range = llvm::iterator_range<finals_const_iterator>;
2614
2615
216
  finals_range finals() {
2616
216
    return finals_range(getFinals().begin(), getFinals().end());
2617
216
  }
2618
2619
494
  finals_const_range finals() const {
2620
494
    return finals_const_range(getFinals().begin(), getFinals().end());
2621
494
  }
2622
2623
1.99k
  child_range children() {
2624
1.99k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2625
1.99k
                       reinterpret_cast<Stmt **>(varlist_end()));
2626
1.99k
  }
2627
2628
63.5k
  static bool classof(const OMPClause *T) {
2629
63.5k
    return T->getClauseKind() == OMPC_linear;
2630
63.5k
  }
2631
};
2632
2633
/// This represents clause 'aligned' in the '#pragma omp ...'
2634
/// directives.
2635
///
2636
/// \code
2637
/// #pragma omp simd aligned(a,b : 8)
2638
/// \endcode
2639
/// In this example directive '#pragma omp simd' has clause 'aligned'
2640
/// with variables 'a', 'b' and alignment '8'.
2641
class OMPAlignedClause final
2642
    : public OMPVarListClause<OMPAlignedClause>,
2643
      private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
2644
  friend class OMPClauseReader;
2645
  friend OMPVarListClause;
2646
  friend TrailingObjects;
2647
2648
  /// Location of ':'.
2649
  SourceLocation ColonLoc;
2650
2651
  /// Sets the alignment for clause.
2652
1.27k
  void setAlignment(Expr *A) { *varlist_end() = A; }
2653
2654
  /// Build 'aligned' clause with given number of variables \a NumVars.
2655
  ///
2656
  /// \param StartLoc Starting location of the clause.
2657
  /// \param LParenLoc Location of '('.
2658
  /// \param ColonLoc Location of ':'.
2659
  /// \param EndLoc Ending location of the clause.
2660
  /// \param NumVars Number of variables.
2661
  OMPAlignedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2662
                   SourceLocation ColonLoc, SourceLocation EndLoc,
2663
                   unsigned NumVars)
2664
      : OMPVarListClause<OMPAlignedClause>(OMPC_aligned, StartLoc, LParenLoc,
2665
                                           EndLoc, NumVars),
2666
1.14k
        ColonLoc(ColonLoc) {}
2667
2668
  /// Build an empty clause.
2669
  ///
2670
  /// \param NumVars Number of variables.
2671
  explicit OMPAlignedClause(unsigned NumVars)
2672
      : OMPVarListClause<OMPAlignedClause>(OMPC_aligned, SourceLocation(),
2673
                                           SourceLocation(), SourceLocation(),
2674
132
                                           NumVars) {}
2675
2676
public:
2677
  /// Creates clause with a list of variables \a VL and alignment \a A.
2678
  ///
2679
  /// \param C AST Context.
2680
  /// \param StartLoc Starting location of the clause.
2681
  /// \param LParenLoc Location of '('.
2682
  /// \param ColonLoc Location of ':'.
2683
  /// \param EndLoc Ending location of the clause.
2684
  /// \param VL List of references to the variables.
2685
  /// \param A Alignment.
2686
  static OMPAlignedClause *Create(const ASTContext &C, SourceLocation StartLoc,
2687
                                  SourceLocation LParenLoc,
2688
                                  SourceLocation ColonLoc,
2689
                                  SourceLocation EndLoc, ArrayRef<Expr *> VL,
2690
                                  Expr *A);
2691
2692
  /// Creates an empty clause with the place for \a NumVars variables.
2693
  ///
2694
  /// \param C AST context.
2695
  /// \param NumVars Number of variables.
2696
  static OMPAlignedClause *CreateEmpty(const ASTContext &C, unsigned NumVars);
2697
2698
  /// Sets the location of ':'.
2699
132
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
2700
2701
  /// Returns the location of ':'.
2702
472
  SourceLocation getColonLoc() const { return ColonLoc; }
2703
2704
  /// Returns alignment.
2705
816
  Expr *getAlignment() { return *varlist_end(); }
2706
2707
  /// Returns alignment.
2708
370
  const Expr *getAlignment() const { return *varlist_end(); }
2709
2710
264
  child_range children() {
2711
264
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2712
264
                       reinterpret_cast<Stmt **>(varlist_end()));
2713
264
  }
2714
2715
11.9k
  static bool classof(const OMPClause *T) {
2716
11.9k
    return T->getClauseKind() == OMPC_aligned;
2717
11.9k
  }
2718
};
2719
2720
/// This represents clause 'copyin' in the '#pragma omp ...' directives.
2721
///
2722
/// \code
2723
/// #pragma omp parallel copyin(a,b)
2724
/// \endcode
2725
/// In this example directive '#pragma omp parallel' has clause 'copyin'
2726
/// with the variables 'a' and 'b'.
2727
class OMPCopyinClause final
2728
    : public OMPVarListClause<OMPCopyinClause>,
2729
      private llvm::TrailingObjects<OMPCopyinClause, Expr *> {
2730
  // Class has 3 additional tail allocated arrays:
2731
  // 1. List of helper expressions for proper generation of assignment operation
2732
  // required for copyin clause. This list represents sources.
2733
  // 2. List of helper expressions for proper generation of assignment operation
2734
  // required for copyin clause. This list represents destinations.
2735
  // 3. List of helper expressions that represents assignment operation:
2736
  // \code
2737
  // DstExprs = SrcExprs;
2738
  // \endcode
2739
  // Required for proper codegen of propagation of master's thread values of
2740
  // threadprivate variables to local instances of that variables in other
2741
  // implicit threads.
2742
2743
  friend class OMPClauseReader;
2744
  friend OMPVarListClause;
2745
  friend TrailingObjects;
2746
2747
  /// Build clause with number of variables \a N.
2748
  ///
2749
  /// \param StartLoc Starting location of the clause.
2750
  /// \param LParenLoc Location of '('.
2751
  /// \param EndLoc Ending location of the clause.
2752
  /// \param N Number of the variables in the clause.
2753
  OMPCopyinClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2754
                  SourceLocation EndLoc, unsigned N)
2755
      : OMPVarListClause<OMPCopyinClause>(OMPC_copyin, StartLoc, LParenLoc,
2756
324
                                          EndLoc, N) {}
2757
2758
  /// Build an empty clause.
2759
  ///
2760
  /// \param N Number of variables.
2761
  explicit OMPCopyinClause(unsigned N)
2762
      : OMPVarListClause<OMPCopyinClause>(OMPC_copyin, SourceLocation(),
2763
                                          SourceLocation(), SourceLocation(),
2764
56
                                          N) {}
2765
2766
  /// Set list of helper expressions, required for proper codegen of the
2767
  /// clause. These expressions represent source expression in the final
2768
  /// assignment statement performed by the copyin clause.
2769
  void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2770
2771
  /// Get the list of helper source expressions.
2772
1.10k
  MutableArrayRef<Expr *> getSourceExprs() {
2773
1.10k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2774
1.10k
  }
2775
300
  ArrayRef<const Expr *> getSourceExprs() const {
2776
300
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2777
300
  }
2778
2779
  /// Set list of helper expressions, required for proper codegen of the
2780
  /// clause. These expressions represent destination expression in the final
2781
  /// assignment statement performed by the copyin clause.
2782
  void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2783
2784
  /// Get the list of helper destination expressions.
2785
612
  MutableArrayRef<Expr *> getDestinationExprs() {
2786
612
    return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2787
612
  }
2788
200
  ArrayRef<const Expr *> getDestinationExprs() const {
2789
200
    return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2790
200
  }
2791
2792
  /// Set list of helper assignment expressions, required for proper
2793
  /// codegen of the clause. These expressions are assignment expressions that
2794
  /// assign source helper expressions to destination helper expressions
2795
  /// correspondingly.
2796
  void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2797
2798
  /// Get the list of helper assignment expressions.
2799
116
  MutableArrayRef<Expr *> getAssignmentOps() {
2800
116
    return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2801
116
  }
2802
100
  ArrayRef<const Expr *> getAssignmentOps() const {
2803
100
    return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2804
100
  }
2805
2806
public:
2807
  /// Creates clause with a list of variables \a VL.
2808
  ///
2809
  /// \param C AST context.
2810
  /// \param StartLoc Starting location of the clause.
2811
  /// \param LParenLoc Location of '('.
2812
  /// \param EndLoc Ending location of the clause.
2813
  /// \param VL List of references to the variables.
2814
  /// \param SrcExprs List of helper expressions for proper generation of
2815
  /// assignment operation required for copyin clause. This list represents
2816
  /// sources.
2817
  /// \param DstExprs List of helper expressions for proper generation of
2818
  /// assignment operation required for copyin clause. This list represents
2819
  /// destinations.
2820
  /// \param AssignmentOps List of helper expressions that represents assignment
2821
  /// operation:
2822
  /// \code
2823
  /// DstExprs = SrcExprs;
2824
  /// \endcode
2825
  /// Required for proper codegen of propagation of master's thread values of
2826
  /// threadprivate variables to local instances of that variables in other
2827
  /// implicit threads.
2828
  static OMPCopyinClause *
2829
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2830
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2831
         ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2832
2833
  /// Creates an empty clause with \a N variables.
2834
  ///
2835
  /// \param C AST context.
2836
  /// \param N The number of variables.
2837
  static OMPCopyinClause *CreateEmpty(const ASTContext &C, unsigned N);
2838
2839
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
2840
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
2841
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
2842
  using helper_expr_const_range =
2843
      llvm::iterator_range<helper_expr_const_iterator>;
2844
2845
50
  helper_expr_const_range source_exprs() const {
2846
50
    return helper_expr_const_range(getSourceExprs().begin(),
2847
50
                                   getSourceExprs().end());
2848
50
  }
2849
2850
58
  helper_expr_range source_exprs() {
2851
58
    return helper_expr_range(getSourceExprs().begin(), getSourceExprs().end());
2852
58
  }
2853
2854
50
  helper_expr_const_range destination_exprs() const {
2855
50
    return helper_expr_const_range(getDestinationExprs().begin(),
2856
50
                                   getDestinationExprs().end());
2857
50
  }
2858
2859
58
  helper_expr_range destination_exprs() {
2860
58
    return helper_expr_range(getDestinationExprs().begin(),
2861
58
                             getDestinationExprs().end());
2862
58
  }
2863
2864
50
  helper_expr_const_range assignment_ops() const {
2865
50
    return helper_expr_const_range(getAssignmentOps().begin(),
2866
50
                                   getAssignmentOps().end());
2867
50
  }
2868
2869
58
  helper_expr_range assignment_ops() {
2870
58
    return helper_expr_range(getAssignmentOps().begin(),
2871
58
                             getAssignmentOps().end());
2872
58
  }
2873
2874
261
  child_range children() {
2875
261
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2876
261
                       reinterpret_cast<Stmt **>(varlist_end()));
2877
261
  }
2878
2879
243
  static bool classof(const OMPClause *T) {
2880
243
    return T->getClauseKind() == OMPC_copyin;
2881
243
  }
2882
};
2883
2884
/// This represents clause 'copyprivate' in the '#pragma omp ...'
2885
/// directives.
2886
///
2887
/// \code
2888
/// #pragma omp single copyprivate(a,b)
2889
/// \endcode
2890
/// In this example directive '#pragma omp single' has clause 'copyprivate'
2891
/// with the variables 'a' and 'b'.
2892
class OMPCopyprivateClause final
2893
    : public OMPVarListClause<OMPCopyprivateClause>,
2894
      private llvm::TrailingObjects<OMPCopyprivateClause, Expr *> {
2895
  friend class OMPClauseReader;
2896
  friend OMPVarListClause;
2897
  friend TrailingObjects;
2898
2899
  /// Build clause with number of variables \a N.
2900
  ///
2901
  /// \param StartLoc Starting location of the clause.
2902
  /// \param LParenLoc Location of '('.
2903
  /// \param EndLoc Ending location of the clause.
2904
  /// \param N Number of the variables in the clause.
2905
  OMPCopyprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2906
                       SourceLocation EndLoc, unsigned N)
2907
      : OMPVarListClause<OMPCopyprivateClause>(OMPC_copyprivate, StartLoc,
2908
140
                                               LParenLoc, EndLoc, N) {}
2909
2910
  /// Build an empty clause.
2911
  ///
2912
  /// \param N Number of variables.
2913
  explicit OMPCopyprivateClause(unsigned N)
2914
      : OMPVarListClause<OMPCopyprivateClause>(
2915
            OMPC_copyprivate, SourceLocation(), SourceLocation(),
2916
18
            SourceLocation(), N) {}
2917
2918
  /// Set list of helper expressions, required for proper codegen of the
2919
  /// clause. These expressions represent source expression in the final
2920
  /// assignment statement performed by the copyprivate clause.
2921
  void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2922
2923
  /// Get the list of helper source expressions.
2924
424
  MutableArrayRef<Expr *> getSourceExprs() {
2925
424
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2926
424
  }
2927
228
  ArrayRef<const Expr *> getSourceExprs() const {
2928
228
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2929
228
  }
2930
2931
  /// Set list of helper expressions, required for proper codegen of the
2932
  /// clause. These expressions represent destination expression in the final
2933
  /// assignment statement performed by the copyprivate clause.
2934
  void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2935
2936
  /// Get the list of helper destination expressions.
2937
230
  MutableArrayRef<Expr *> getDestinationExprs() {
2938
230
    return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2939
230
  }
2940
152
  ArrayRef<const Expr *> getDestinationExprs() const {
2941
152
    return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2942
152
  }
2943
2944
  /// Set list of helper assignment expressions, required for proper
2945
  /// codegen of the clause. These expressions are assignment expressions that
2946
  /// assign source helper expressions to destination helper expressions
2947
  /// correspondingly.
2948
  void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2949
2950
  /// Get the list of helper assignment expressions.
2951
36
  MutableArrayRef<Expr *> getAssignmentOps() {
2952
36
    return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2953
36
  }
2954
76
  ArrayRef<const Expr *> getAssignmentOps() const {
2955
76
    return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2956
76
  }
2957
2958
public:
2959
  /// Creates clause with a list of variables \a VL.
2960
  ///
2961
  /// \param C AST context.
2962
  /// \param StartLoc Starting location of the clause.
2963
  /// \param LParenLoc Location of '('.
2964
  /// \param EndLoc Ending location of the clause.
2965
  /// \param VL List of references to the variables.
2966
  /// \param SrcExprs List of helper expressions for proper generation of
2967
  /// assignment operation required for copyprivate clause. This list represents
2968
  /// sources.
2969
  /// \param DstExprs List of helper expressions for proper generation of
2970
  /// assignment operation required for copyprivate clause. This list represents
2971
  /// destinations.
2972
  /// \param AssignmentOps List of helper expressions that represents assignment
2973
  /// operation:
2974
  /// \code
2975
  /// DstExprs = SrcExprs;
2976
  /// \endcode
2977
  /// Required for proper codegen of final assignment performed by the
2978
  /// copyprivate clause.
2979
  static OMPCopyprivateClause *
2980
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2981
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2982
         ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2983
2984
  /// Creates an empty clause with \a N variables.
2985
  ///
2986
  /// \param C AST context.
2987
  /// \param N The number of variables.
2988
  static OMPCopyprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
2989
2990
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
2991
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
2992
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
2993
  using helper_expr_const_range =
2994
      llvm::iterator_range<helper_expr_const_iterator>;
2995
2996
38
  helper_expr_const_range source_exprs() const {
2997
38
    return helper_expr_const_range(getSourceExprs().begin(),
2998
38
                                   getSourceExprs().end());
2999
38
  }
3000
3001
18
  helper_expr_range source_exprs() {
3002
18
    return helper_expr_range(getSourceExprs().begin(), getSourceExprs().end());
3003
18
  }
3004
3005
38
  helper_expr_const_range destination_exprs() const {
3006
38
    return helper_expr_const_range(getDestinationExprs().begin(),
3007
38
                                   getDestinationExprs().end());
3008
38
  }
3009
3010
18
  helper_expr_range destination_exprs() {
3011
18
    return helper_expr_range(getDestinationExprs().begin(),
3012
18
                             getDestinationExprs().end());
3013
18
  }
3014
3015
38
  helper_expr_const_range assignment_ops() const {
3016
38
    return helper_expr_const_range(getAssignmentOps().begin(),
3017
38
                                   getAssignmentOps().end());
3018
38
  }
3019
3020
18
  helper_expr_range assignment_ops() {
3021
18
    return helper_expr_range(getAssignmentOps().begin(),
3022
18
                             getAssignmentOps().end());
3023
18
  }
3024
3025
192
  child_range children() {
3026
192
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3027
192
                       reinterpret_cast<Stmt **>(varlist_end()));
3028
192
  }
3029
3030
35
  static bool classof(const OMPClause *T) {
3031
35
    return T->getClauseKind() == OMPC_copyprivate;
3032
35
  }
3033
};
3034
3035
/// This represents implicit clause 'flush' for the '#pragma omp flush'
3036
/// directive.
3037
/// This clause does not exist by itself, it can be only as a part of 'omp
3038
/// flush' directive. This clause is introduced to keep the original structure
3039
/// of \a OMPExecutableDirective class and its derivatives and to use the
3040
/// existing infrastructure of clauses with the list of variables.
3041
///
3042
/// \code
3043
/// #pragma omp flush(a,b)
3044
/// \endcode
3045
/// In this example directive '#pragma omp flush' has implicit clause 'flush'
3046
/// with the variables 'a' and 'b'.
3047
class OMPFlushClause final
3048
    : public OMPVarListClause<OMPFlushClause>,
3049
      private llvm::TrailingObjects<OMPFlushClause, Expr *> {
3050
  friend OMPVarListClause;
3051
  friend TrailingObjects;
3052
3053
  /// Build clause with number of variables \a N.
3054
  ///
3055
  /// \param StartLoc Starting location of the clause.
3056
  /// \param LParenLoc Location of '('.
3057
  /// \param EndLoc Ending location of the clause.
3058
  /// \param N Number of the variables in the clause.
3059
  OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3060
                 SourceLocation EndLoc, unsigned N)
3061
      : OMPVarListClause<OMPFlushClause>(OMPC_flush, StartLoc, LParenLoc,
3062
52
                                         EndLoc, N) {}
3063
3064
  /// Build an empty clause.
3065
  ///
3066
  /// \param N Number of variables.
3067
  explicit OMPFlushClause(unsigned N)
3068
      : OMPVarListClause<OMPFlushClause>(OMPC_flush, SourceLocation(),
3069
                                         SourceLocation(), SourceLocation(),
3070
8
                                         N) {}
3071
3072
public:
3073
  /// Creates clause with a list of variables \a VL.
3074
  ///
3075
  /// \param C AST context.
3076
  /// \param StartLoc Starting location of the clause.
3077
  /// \param LParenLoc Location of '('.
3078
  /// \param EndLoc Ending location of the clause.
3079
  /// \param VL List of references to the variables.
3080
  static OMPFlushClause *Create(const ASTContext &C, SourceLocation StartLoc,
3081
                                SourceLocation LParenLoc, SourceLocation EndLoc,
3082
                                ArrayRef<Expr *> VL);
3083
3084
  /// Creates an empty clause with \a N variables.
3085
  ///
3086
  /// \param C AST context.
3087
  /// \param N The number of variables.
3088
  static OMPFlushClause *CreateEmpty(const ASTContext &C, unsigned N);
3089
3090
0
  child_range children() {
3091
0
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3092
0
                       reinterpret_cast<Stmt **>(varlist_end()));
3093
0
  }
3094
3095
4
  static bool classof(const OMPClause *T) {
3096
4
    return T->getClauseKind() == OMPC_flush;
3097
4
  }
3098
};
3099
3100
/// This represents implicit clause 'depend' for the '#pragma omp task'
3101
/// directive.
3102
///
3103
/// \code
3104
/// #pragma omp task depend(in:a,b)
3105
/// \endcode
3106
/// In this example directive '#pragma omp task' with clause 'depend' with the
3107
/// variables 'a' and 'b' with dependency 'in'.
3108
class OMPDependClause final
3109
    : public OMPVarListClause<OMPDependClause>,
3110
      private llvm::TrailingObjects<OMPDependClause, Expr *> {
3111
  friend class OMPClauseReader;
3112
  friend OMPVarListClause;
3113
  friend TrailingObjects;
3114
3115
  /// Dependency type (one of in, out, inout).
3116
  OpenMPDependClauseKind DepKind = OMPC_DEPEND_unknown;
3117
3118
  /// Dependency type location.
3119
  SourceLocation DepLoc;
3120
3121
  /// Colon location.
3122
  SourceLocation ColonLoc;
3123
3124
  /// Number of loops, associated with the depend clause.
3125
  unsigned NumLoops = 0;
3126
3127
  /// Build clause with number of variables \a N.
3128
  ///
3129
  /// \param StartLoc Starting location of the clause.
3130
  /// \param LParenLoc Location of '('.
3131
  /// \param EndLoc Ending location of the clause.
3132
  /// \param N Number of the variables in the clause.
3133
  /// \param NumLoops Number of loops that is associated with this depend
3134
  /// clause.
3135
  OMPDependClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3136
                  SourceLocation EndLoc, unsigned N, unsigned NumLoops)
3137
      : OMPVarListClause<OMPDependClause>(OMPC_depend, StartLoc, LParenLoc,
3138
2.18k
                                          EndLoc, N), NumLoops(NumLoops) {}
3139
3140
  /// Build an empty clause.
3141
  ///
3142
  /// \param N Number of variables.
3143
  /// \param NumLoops Number of loops that is associated with this depend
3144
  /// clause.
3145
  explicit OMPDependClause(unsigned N, unsigned NumLoops)
3146
      : OMPVarListClause<OMPDependClause>(OMPC_depend, SourceLocation(),
3147
                                          SourceLocation(), SourceLocation(),
3148
                                          N),
3149
526
        NumLoops(NumLoops) {}
3150
3151
  /// Set dependency kind.
3152
2.71k
  void setDependencyKind(OpenMPDependClauseKind K) { DepKind = K; }
3153
3154
  /// Set dependency kind and its location.
3155
2.71k
  void setDependencyLoc(SourceLocation Loc) { DepLoc = Loc; }
3156
3157
  /// Set colon location.
3158
2.71k
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3159
3160
public:
3161
  /// Creates clause with a list of variables \a VL.
3162
  ///
3163
  /// \param C AST context.
3164
  /// \param StartLoc Starting location of the clause.
3165
  /// \param LParenLoc Location of '('.
3166
  /// \param EndLoc Ending location of the clause.
3167
  /// \param DepKind Dependency type.
3168
  /// \param DepLoc Location of the dependency type.
3169
  /// \param ColonLoc Colon location.
3170
  /// \param VL List of references to the variables.
3171
  /// \param NumLoops Number of loops that is associated with this depend
3172
  /// clause.
3173
  static OMPDependClause *Create(const ASTContext &C, SourceLocation StartLoc,
3174
                                 SourceLocation LParenLoc,
3175
                                 SourceLocation EndLoc,
3176
                                 OpenMPDependClauseKind DepKind,
3177
                                 SourceLocation DepLoc, SourceLocation ColonLoc,
3178
                                 ArrayRef<Expr *> VL, unsigned NumLoops);
3179
3180
  /// Creates an empty clause with \a N variables.
3181
  ///
3182
  /// \param C AST context.
3183
  /// \param N The number of variables.
3184
  /// \param NumLoops Number of loops that is associated with this depend
3185
  /// clause.
3186
  static OMPDependClause *CreateEmpty(const ASTContext &C, unsigned N,
3187
                                      unsigned NumLoops);
3188
3189
  /// Get dependency type.
3190
3.72k
  OpenMPDependClauseKind getDependencyKind() const { return DepKind; }
3191
3192
  /// Get dependency type location.
3193
1.26k
  SourceLocation getDependencyLoc() const { return DepLoc; }
3194
3195
  /// Get colon location.
3196
870
  SourceLocation getColonLoc() const { return ColonLoc; }
3197
3198
  /// Get number of loops associated with the clause.
3199
2.09k
  unsigned getNumLoops() const { return NumLoops; }
3200
3201
  /// Set the loop data for the depend clauses with 'sink|source' kind of
3202
  /// dependency.
3203
  void setLoopData(unsigned NumLoop, Expr *Cnt);
3204
3205
  /// Get the loop data.
3206
  Expr *getLoopData(unsigned NumLoop);
3207
  const Expr *getLoopData(unsigned NumLoop) const;
3208
3209
20
  child_range children() {
3210
20
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3211
20
                       reinterpret_cast<Stmt **>(varlist_end()));
3212
20
  }
3213
3214
7.67k
  static bool classof(const OMPClause *T) {
3215
7.67k
    return T->getClauseKind() == OMPC_depend;
3216
7.67k
  }
3217
};
3218
3219
/// This represents 'device' clause in the '#pragma omp ...'
3220
/// directive.
3221
///
3222
/// \code
3223
/// #pragma omp target device(a)
3224
/// \endcode
3225
/// In this example directive '#pragma omp target' has clause 'device'
3226
/// with single expression 'a'.
3227
class OMPDeviceClause : public OMPClause, public OMPClauseWithPreInit {
3228
  friend class OMPClauseReader;
3229
3230
  /// Location of '('.
3231
  SourceLocation LParenLoc;
3232
3233
  /// Device number.
3234
  Stmt *Device = nullptr;
3235
3236
  /// Set the device number.
3237
  ///
3238
  /// \param E Device number.
3239
288
  void setDevice(Expr *E) { Device = E; }
3240
3241
public:
3242
  /// Build 'device' clause.
3243
  ///
3244
  /// \param E Expression associated with this clause.
3245
  /// \param CaptureRegion Innermost OpenMP region where expressions in this
3246
  /// clause must be captured.
3247
  /// \param StartLoc Starting location of the clause.
3248
  /// \param LParenLoc Location of '('.
3249
  /// \param EndLoc Ending location of the clause.
3250
  OMPDeviceClause(Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion,
3251
                  SourceLocation StartLoc, SourceLocation LParenLoc,
3252
                  SourceLocation EndLoc)
3253
      : OMPClause(OMPC_device, StartLoc, EndLoc), OMPClauseWithPreInit(this),
3254
986
        LParenLoc(LParenLoc), Device(E) {
3255
986
    setPreInitStmt(HelperE, CaptureRegion);
3256
986
  }
3257
3258
  /// Build an empty clause.
3259
  OMPDeviceClause()
3260
      : OMPClause(OMPC_device, SourceLocation(), SourceLocation()),
3261
288
        OMPClauseWithPreInit(this) {}
3262
3263
  /// Sets the location of '('.
3264
288
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
3265
3266
  /// Returns the location of '('.
3267
348
  SourceLocation getLParenLoc() const { return LParenLoc; }
3268
3269
  /// Return device number.
3270
380
  Expr *getDevice() { return cast<Expr>(Device); }
3271
3272
  /// Return device number.
3273
792
  Expr *getDevice() const { return cast<Expr>(Device); }
3274
3275
14
  child_range children() { return child_range(&Device, &Device + 1); }
3276
3277
5.62k
  static bool classof(const OMPClause *T) {
3278
5.62k
    return T->getClauseKind() == OMPC_device;
3279
5.62k
  }
3280
};
3281
3282
/// This represents 'threads' clause in the '#pragma omp ...' directive.
3283
///
3284
/// \code
3285
/// #pragma omp ordered threads
3286
/// \endcode
3287
/// In this example directive '#pragma omp ordered' has simple 'threads' clause.
3288
class OMPThreadsClause : public OMPClause {
3289
public:
3290
  /// Build 'threads' clause.
3291
  ///
3292
  /// \param StartLoc Starting location of the clause.
3293
  /// \param EndLoc Ending location of the clause.
3294
  OMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
3295
104
      : OMPClause(OMPC_threads, StartLoc, EndLoc) {}
3296
3297
  /// Build an empty clause.
3298
  OMPThreadsClause()
3299
8
      : OMPClause(OMPC_threads, SourceLocation(), SourceLocation()) {}
3300
3301
0
  child_range children() {
3302
0
    return child_range(child_iterator(), child_iterator());
3303
0
  }
3304
3305
  static bool classof(const OMPClause *T) {
3306
    return T->getClauseKind() == OMPC_threads;
3307
  }
3308
};
3309
3310
/// This represents 'simd' clause in the '#pragma omp ...' directive.
3311
///
3312
/// \code
3313
/// #pragma omp ordered simd
3314
/// \endcode
3315
/// In this example directive '#pragma omp ordered' has simple 'simd' clause.
3316
class OMPSIMDClause : public OMPClause {
3317
public:
3318
  /// Build 'simd' clause.
3319
  ///
3320
  /// \param StartLoc Starting location of the clause.
3321
  /// \param EndLoc Ending location of the clause.
3322
  OMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
3323
74
      : OMPClause(OMPC_simd, StartLoc, EndLoc) {}
3324
3325
  /// Build an empty clause.
3326
16
  OMPSIMDClause() : OMPClause(OMPC_simd, SourceLocation(), SourceLocation()) {}
3327
3328
0
  child_range children() {
3329
0
    return child_range(child_iterator(), child_iterator());
3330
0
  }
3331
3332
8
  static bool classof(const OMPClause *T) {
3333
8
    return T->getClauseKind() == OMPC_simd;
3334
8
  }
3335
};
3336
3337
/// Struct that defines common infrastructure to handle mappable
3338
/// expressions used in OpenMP clauses.
3339
class OMPClauseMappableExprCommon {
3340
public:
3341
  /// Class that represents a component of a mappable expression. E.g.
3342
  /// for an expression S.a, the first component is a declaration reference
3343
  /// expression associated with 'S' and the second is a member expression
3344
  /// associated with the field declaration 'a'. If the expression is an array
3345
  /// subscript it may not have any associated declaration. In that case the
3346
  /// associated declaration is set to nullptr.
3347
  class MappableComponent {
3348
    /// Expression associated with the component.
3349
    Expr *AssociatedExpression = nullptr;
3350
3351
    /// Declaration associated with the declaration. If the component does
3352
    /// not have a declaration (e.g. array subscripts or section), this is set
3353
    /// to nullptr.
3354
    ValueDecl *AssociatedDeclaration = nullptr;
3355
3356
  public:
3357
    explicit MappableComponent() = default;
3358
    explicit MappableComponent(Expr *AssociatedExpression,
3359
                               ValueDecl *AssociatedDeclaration)
3360
        : AssociatedExpression(AssociatedExpression),
3361
          AssociatedDeclaration(
3362
              AssociatedDeclaration
3363
                  ? cast<ValueDecl>(AssociatedDeclaration->getCanonicalDecl())
3364
25.7k
                  : nullptr) {}
3365
3366
44.5k
    Expr *getAssociatedExpression() const { return AssociatedExpression; }
3367
3368
68.6k
    ValueDecl *getAssociatedDeclaration() const {
3369
68.6k
      return AssociatedDeclaration;
3370
68.6k
    }
3371
  };
3372
3373
  // List of components of an expression. This first one is the whole
3374
  // expression and the last one is the base expression.
3375
  using MappableExprComponentList = SmallVector<MappableComponent, 8>;
3376
  using MappableExprComponentListRef = ArrayRef<MappableComponent>;
3377
3378
  // List of all component lists associated to the same base declaration.
3379
  // E.g. if both 'S.a' and 'S.b' are a mappable expressions, each will have
3380
  // their component list but the same base declaration 'S'.
3381
  using MappableExprComponentLists = SmallVector<MappableExprComponentList, 8>;
3382
  using MappableExprComponentListsRef = ArrayRef<MappableExprComponentList>;
3383
3384
protected:
3385
  // Return the total number of elements in a list of component lists.
3386
  static unsigned
3387
  getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists);
3388
3389
  // Return the total number of elements in a list of declarations. All
3390
  // declarations are expected to be canonical.
3391
  static unsigned
3392
  getUniqueDeclarationsTotalNumber(ArrayRef<const ValueDecl *> Declarations);
3393
};
3394
3395
/// This represents clauses with a list of expressions that are mappable.
3396
/// Examples of these clauses are 'map' in
3397
/// '#pragma omp target [enter|exit] [data]...' directives, and  'to' and 'from
3398
/// in '#pragma omp target update...' directives.
3399
template <class T>
3400
class OMPMappableExprListClause : public OMPVarListClause<T>,
3401
                                  public OMPClauseMappableExprCommon {
3402
  friend class OMPClauseReader;
3403
3404
  /// Number of unique declarations in this clause.
3405
  unsigned NumUniqueDeclarations;
3406
3407
  /// Number of component lists in this clause.
3408
  unsigned NumComponentLists;
3409
3410
  /// Total number of components in this clause.
3411
  unsigned NumComponents;
3412
3413
protected:
3414
  /// Build a clause for \a NumUniqueDeclarations declarations, \a
3415
  /// NumComponentLists total component lists, and \a NumComponents total
3416
  /// components.
3417
  ///
3418
  /// \param K Kind of the clause.
3419
  /// \param StartLoc Starting location of the clause (the clause keyword).
3420
  /// \param LParenLoc Location of '('.
3421
  /// \param EndLoc Ending location of the clause.
3422
  /// \param NumVars Number of expressions listed in the clause.
3423
  /// \param NumUniqueDeclarations Number of unique base declarations in this
3424
  /// clause.
3425
  /// \param NumComponentLists Number of component lists in this clause - one
3426
  /// list for each expression in the clause.
3427
  /// \param NumComponents Total number of expression components in the clause.
3428
  OMPMappableExprListClause(OpenMPClauseKind K, SourceLocation StartLoc,
3429
                            SourceLocation LParenLoc, SourceLocation EndLoc,
3430
                            unsigned NumVars, unsigned NumUniqueDeclarations,
3431
                            unsigned NumComponentLists, unsigned NumComponents)
3432
      : OMPVarListClause<T>(K, StartLoc, LParenLoc, EndLoc, NumVars),
3433
        NumUniqueDeclarations(NumUniqueDeclarations),
3434
18.4k
        NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
clang::OMPMappableExprListClause<clang::OMPMapClause>::OMPMappableExprListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int, unsigned int)
Line
Count
Source
3434
14.3k
        NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
clang::OMPMappableExprListClause<clang::OMPToClause>::OMPMappableExprListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int, unsigned int)
Line
Count
Source
3434
748
        NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
clang::OMPMappableExprListClause<clang::OMPFromClause>::OMPMappableExprListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int, unsigned int)
Line
Count
Source
3434
394
        NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::OMPMappableExprListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int, unsigned int)
Line
Count
Source
3434
428
        NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::OMPMappableExprListClause(clang::OpenMPClauseKind, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int, unsigned int)
Line
Count
Source
3434
2.54k
        NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
3435
3436
  /// Get the unique declarations that are in the trailing objects of the
3437
  /// class.
3438
18.4k
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3439
18.4k
    return MutableArrayRef<ValueDecl *>(
3440
18.4k
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3441
18.4k
        NumUniqueDeclarations);
3442
18.4k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getUniqueDeclsRef()
Line
Count
Source
3438
14.3k
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3439
14.3k
    return MutableArrayRef<ValueDecl *>(
3440
14.3k
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3441
14.3k
        NumUniqueDeclarations);
3442
14.3k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getUniqueDeclsRef()
Line
Count
Source
3438
748
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3439
748
    return MutableArrayRef<ValueDecl *>(
3440
748
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3441
748
        NumUniqueDeclarations);
3442
748
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getUniqueDeclsRef()
Line
Count
Source
3438
394
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3439
394
    return MutableArrayRef<ValueDecl *>(
3440
394
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3441
394
        NumUniqueDeclarations);
3442
394
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getUniqueDeclsRef()
Line
Count
Source
3438
428
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3439
428
    return MutableArrayRef<ValueDecl *>(
3440
428
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3441
428
        NumUniqueDeclarations);
3442
428
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getUniqueDeclsRef()
Line
Count
Source
3438
2.54k
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3439
2.54k
    return MutableArrayRef<ValueDecl *>(
3440
2.54k
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3441
2.54k
        NumUniqueDeclarations);
3442
2.54k
  }
3443
3444
  /// Get the unique declarations that are in the trailing objects of the
3445
  /// class.
3446
6.44k
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3447
6.44k
    return ArrayRef<ValueDecl *>(
3448
6.44k
        static_cast<const T *>(this)
3449
6.44k
            ->template getTrailingObjects<ValueDecl *>(),
3450
6.44k
        NumUniqueDeclarations);
3451
6.44k
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getUniqueDeclsRef() const
Line
Count
Source
3446
448
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3447
448
    return ArrayRef<ValueDecl *>(
3448
448
        static_cast<const T *>(this)
3449
448
            ->template getTrailingObjects<ValueDecl *>(),
3450
448
        NumUniqueDeclarations);
3451
448
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getUniqueDeclsRef() const
Line
Count
Source
3446
5.73k
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3447
5.73k
    return ArrayRef<ValueDecl *>(
3448
5.73k
        static_cast<const T *>(this)
3449
5.73k
            ->template getTrailingObjects<ValueDecl *>(),
3450
5.73k
        NumUniqueDeclarations);
3451
5.73k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getUniqueDeclsRef() const
Line
Count
Source
3446
48
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3447
48
    return ArrayRef<ValueDecl *>(
3448
48
        static_cast<const T *>(this)
3449
48
            ->template getTrailingObjects<ValueDecl *>(),
3450
48
        NumUniqueDeclarations);
3451
48
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getUniqueDeclsRef() const
Line
Count
Source
3446
58
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3447
58
    return ArrayRef<ValueDecl *>(
3448
58
        static_cast<const T *>(this)
3449
58
            ->template getTrailingObjects<ValueDecl *>(),
3450
58
        NumUniqueDeclarations);
3451
58
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getUniqueDeclsRef() const
Line
Count
Source
3446
152
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3447
152
    return ArrayRef<ValueDecl *>(
3448
152
        static_cast<const T *>(this)
3449
152
            ->template getTrailingObjects<ValueDecl *>(),
3450
152
        NumUniqueDeclarations);
3451
152
  }
3452
3453
  /// Set the unique declarations that are in the trailing objects of the
3454
  /// class.
3455
2.09k
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3456
2.09k
    assert(UDs.size() == NumUniqueDeclarations &&
3457
2.09k
           "Unexpected amount of unique declarations.");
3458
2.09k
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3459
2.09k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3455
1.55k
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3456
1.55k
    assert(UDs.size() == NumUniqueDeclarations &&
3457
1.55k
           "Unexpected amount of unique declarations.");
3458
1.55k
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3459
1.55k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3455
32
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3456
32
    assert(UDs.size() == NumUniqueDeclarations &&
3457
32
           "Unexpected amount of unique declarations.");
3458
32
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3459
32
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3455
32
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3456
32
    assert(UDs.size() == NumUniqueDeclarations &&
3457
32
           "Unexpected amount of unique declarations.");
3458
32
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3459
32
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3455
84
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3456
84
    assert(UDs.size() == NumUniqueDeclarations &&
3457
84
           "Unexpected amount of unique declarations.");
3458
84
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3459
84
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3455
396
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3456
396
    assert(UDs.size() == NumUniqueDeclarations &&
3457
396
           "Unexpected amount of unique declarations.");
3458
396
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3459
396
  }
3460
3461
  /// Get the number of lists per declaration that are in the trailing
3462
  /// objects of the class.
3463
18.4k
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3464
18.4k
    return MutableArrayRef<unsigned>(
3465
18.4k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3466
18.4k
        NumUniqueDeclarations);
3467
18.4k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getDeclNumListsRef()
Line
Count
Source
3463
14.3k
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3464
14.3k
    return MutableArrayRef<unsigned>(
3465
14.3k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3466
14.3k
        NumUniqueDeclarations);
3467
14.3k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getDeclNumListsRef()
Line
Count
Source
3463
748
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3464
748
    return MutableArrayRef<unsigned>(
3465
748
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3466
748
        NumUniqueDeclarations);
3467
748
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getDeclNumListsRef()
Line
Count
Source
3463
394
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3464
394
    return MutableArrayRef<unsigned>(
3465
394
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3466
394
        NumUniqueDeclarations);
3467
394
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getDeclNumListsRef()
Line
Count
Source
3463
428
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3464
428
    return MutableArrayRef<unsigned>(
3465
428
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3466
428
        NumUniqueDeclarations);
3467
428
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getDeclNumListsRef()
Line
Count
Source
3463
2.54k
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3464
2.54k
    return MutableArrayRef<unsigned>(
3465
2.54k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3466
2.54k
        NumUniqueDeclarations);
3467
2.54k
  }
3468
3469
  /// Get the number of lists per declaration that are in the trailing
3470
  /// objects of the class.
3471
6.44k
  ArrayRef<unsigned> getDeclNumListsRef() const {
3472
6.44k
    return ArrayRef<unsigned>(
3473
6.44k
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3474
6.44k
        NumUniqueDeclarations);
3475
6.44k
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getDeclNumListsRef() const
Line
Count
Source
3471
448
  ArrayRef<unsigned> getDeclNumListsRef() const {
3472
448
    return ArrayRef<unsigned>(
3473
448
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3474
448
        NumUniqueDeclarations);
3475
448
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getDeclNumListsRef() const
Line
Count
Source
3471
5.73k
  ArrayRef<unsigned> getDeclNumListsRef() const {
3472
5.73k
    return ArrayRef<unsigned>(
3473
5.73k
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3474
5.73k
        NumUniqueDeclarations);
3475
5.73k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getDeclNumListsRef() const
Line
Count
Source
3471
48
  ArrayRef<unsigned> getDeclNumListsRef() const {
3472
48
    return ArrayRef<unsigned>(
3473
48
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3474
48
        NumUniqueDeclarations);
3475
48
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getDeclNumListsRef() const
Line
Count
Source
3471
58
  ArrayRef<unsigned> getDeclNumListsRef() const {
3472
58
    return ArrayRef<unsigned>(
3473
58
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3474
58
        NumUniqueDeclarations);
3475
58
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getDeclNumListsRef() const
Line
Count
Source
3471
152
  ArrayRef<unsigned> getDeclNumListsRef() const {
3472
152
    return ArrayRef<unsigned>(
3473
152
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3474
152
        NumUniqueDeclarations);
3475
152
  }
3476
3477
  /// Set the number of lists per declaration that are in the trailing
3478
  /// objects of the class.
3479
2.09k
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3480
2.09k
    assert(DNLs.size() == NumUniqueDeclarations &&
3481
2.09k
           "Unexpected amount of list numbers.");
3482
2.09k
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3483
2.09k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3479
1.55k
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3480
1.55k
    assert(DNLs.size() == NumUniqueDeclarations &&
3481
1.55k
           "Unexpected amount of list numbers.");
3482
1.55k
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3483
1.55k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3479
32
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3480
32
    assert(DNLs.size() == NumUniqueDeclarations &&
3481
32
           "Unexpected amount of list numbers.");
3482
32
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3483
32
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3479
32
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3480
32
    assert(DNLs.size() == NumUniqueDeclarations &&
3481
32
           "Unexpected amount of list numbers.");
3482
32
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3483
32
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3479
84
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3480
84
    assert(DNLs.size() == NumUniqueDeclarations &&
3481
84
           "Unexpected amount of list numbers.");
3482
84
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3483
84
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3479
396
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3480
396
    assert(DNLs.size() == NumUniqueDeclarations &&
3481
396
           "Unexpected amount of list numbers.");
3482
396
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3483
396
  }
3484
3485
  /// Get the cumulative component lists sizes that are in the trailing
3486
  /// objects of the class. They are appended after the number of lists.
3487
18.4k
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3488
18.4k
    return MutableArrayRef<unsigned>(
3489
18.4k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3490
18.4k
            NumUniqueDeclarations,
3491
18.4k
        NumComponentLists);
3492
18.4k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getComponentListSizesRef()
Line
Count
Source
3487
14.3k
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3488
14.3k
    return MutableArrayRef<unsigned>(
3489
14.3k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3490
14.3k
            NumUniqueDeclarations,
3491
14.3k
        NumComponentLists);
3492
14.3k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getComponentListSizesRef()
Line
Count
Source
3487
748
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3488
748
    return MutableArrayRef<unsigned>(
3489
748
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3490
748
            NumUniqueDeclarations,
3491
748
        NumComponentLists);
3492
748
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getComponentListSizesRef()
Line
Count
Source
3487
394
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3488
394
    return MutableArrayRef<unsigned>(
3489
394
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3490
394
            NumUniqueDeclarations,
3491
394
        NumComponentLists);
3492
394
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getComponentListSizesRef()
Line
Count
Source
3487
428
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3488
428
    return MutableArrayRef<unsigned>(
3489
428
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3490
428
            NumUniqueDeclarations,
3491
428
        NumComponentLists);
3492
428
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getComponentListSizesRef()
Line
Count
Source
3487
2.54k
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3488
2.54k
    return MutableArrayRef<unsigned>(
3489
2.54k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3490
2.54k
            NumUniqueDeclarations,
3491
2.54k
        NumComponentLists);
3492
2.54k
  }
3493
3494
  /// Get the cumulative component lists sizes that are in the trailing
3495
  /// objects of the class. They are appended after the number of lists.
3496
6.44k
  ArrayRef<unsigned> getComponentListSizesRef() const {
3497
6.44k
    return ArrayRef<unsigned>(
3498
6.44k
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3499
6.44k
            NumUniqueDeclarations,
3500
6.44k
        NumComponentLists);
3501
6.44k
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getComponentListSizesRef() const
Line
Count
Source
3496
448
  ArrayRef<unsigned> getComponentListSizesRef() const {
3497
448
    return ArrayRef<unsigned>(
3498
448
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3499
448
            NumUniqueDeclarations,
3500
448
        NumComponentLists);
3501
448
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getComponentListSizesRef() const
Line
Count
Source
3496
5.73k
  ArrayRef<unsigned> getComponentListSizesRef() const {
3497
5.73k
    return ArrayRef<unsigned>(
3498
5.73k
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3499
5.73k
            NumUniqueDeclarations,
3500
5.73k
        NumComponentLists);
3501
5.73k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getComponentListSizesRef() const
Line
Count
Source
3496
48
  ArrayRef<unsigned> getComponentListSizesRef() const {
3497
48
    return ArrayRef<unsigned>(
3498
48
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3499
48
            NumUniqueDeclarations,
3500
48
        NumComponentLists);
3501
48
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getComponentListSizesRef() const
Line
Count
Source
3496
58
  ArrayRef<unsigned> getComponentListSizesRef() const {
3497
58
    return ArrayRef<unsigned>(
3498
58
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3499
58
            NumUniqueDeclarations,
3500
58
        NumComponentLists);
3501
58
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getComponentListSizesRef() const
Line
Count
Source
3496
152
  ArrayRef<unsigned> getComponentListSizesRef() const {
3497
152
    return ArrayRef<unsigned>(
3498
152
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3499
152
            NumUniqueDeclarations,
3500
152
        NumComponentLists);
3501
152
  }
3502
3503
  /// Set the cumulative component lists sizes that are in the trailing
3504
  /// objects of the class.
3505
2.09k
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3506
2.09k
    assert(CLSs.size() == NumComponentLists &&
3507
2.09k
           "Unexpected amount of component lists.");
3508
2.09k
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3509
2.09k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3505
1.55k
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3506
1.55k
    assert(CLSs.size() == NumComponentLists &&
3507
1.55k
           "Unexpected amount of component lists.");
3508
1.55k
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3509
1.55k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3505
32
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3506
32
    assert(CLSs.size() == NumComponentLists &&
3507
32
           "Unexpected amount of component lists.");
3508
32
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3509
32
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3505
32
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3506
32
    assert(CLSs.size() == NumComponentLists &&
3507
32
           "Unexpected amount of component lists.");
3508
32
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3509
32
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3505
84
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3506
84
    assert(CLSs.size() == NumComponentLists &&
3507
84
           "Unexpected amount of component lists.");
3508
84
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3509
84
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3505
396
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3506
396
    assert(CLSs.size() == NumComponentLists &&
3507
396
           "Unexpected amount of component lists.");
3508
396
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3509
396
  }
3510
3511
  /// Get the components that are in the trailing objects of the class.
3512
18.4k
  MutableArrayRef<MappableComponent> getComponentsRef() {
3513
18.4k
    return MutableArrayRef<MappableComponent>(
3514
18.4k
        static_cast<T *>(this)
3515
18.4k
            ->template getTrailingObjects<MappableComponent>(),
3516
18.4k
        NumComponents);
3517
18.4k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getComponentsRef()
Line
Count
Source
3512
14.3k
  MutableArrayRef<MappableComponent> getComponentsRef() {
3513
14.3k
    return MutableArrayRef<MappableComponent>(
3514
14.3k
        static_cast<T *>(this)
3515
14.3k
            ->template getTrailingObjects<MappableComponent>(),
3516
14.3k
        NumComponents);
3517
14.3k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getComponentsRef()
Line
Count
Source
3512
748
  MutableArrayRef<MappableComponent> getComponentsRef() {
3513
748
    return MutableArrayRef<MappableComponent>(
3514
748
        static_cast<T *>(this)
3515
748
            ->template getTrailingObjects<MappableComponent>(),
3516
748
        NumComponents);
3517
748
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getComponentsRef()
Line
Count
Source
3512
394
  MutableArrayRef<MappableComponent> getComponentsRef() {
3513
394
    return MutableArrayRef<MappableComponent>(
3514
394
        static_cast<T *>(this)
3515
394
            ->template getTrailingObjects<MappableComponent>(),
3516
394
        NumComponents);
3517
394
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getComponentsRef()
Line
Count
Source
3512
428
  MutableArrayRef<MappableComponent> getComponentsRef() {
3513
428
    return MutableArrayRef<MappableComponent>(
3514
428
        static_cast<T *>(this)
3515
428
            ->template getTrailingObjects<MappableComponent>(),
3516
428
        NumComponents);
3517
428
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getComponentsRef()
Line
Count
Source
3512
2.54k
  MutableArrayRef<MappableComponent> getComponentsRef() {
3513
2.54k
    return MutableArrayRef<MappableComponent>(
3514
2.54k
        static_cast<T *>(this)
3515
2.54k
            ->template getTrailingObjects<MappableComponent>(),
3516
2.54k
        NumComponents);
3517
2.54k
  }
3518
3519
  /// Get the components that are in the trailing objects of the class.
3520
15.1k
  ArrayRef<MappableComponent> getComponentsRef() const {
3521
15.1k
    return ArrayRef<MappableComponent>(
3522
15.1k
        static_cast<const T *>(this)
3523
15.1k
            ->template getTrailingObjects<MappableComponent>(),
3524
15.1k
        NumComponents);
3525
15.1k
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getComponentsRef() const
Line
Count
Source
3520
552
  ArrayRef<MappableComponent> getComponentsRef() const {
3521
552
    return ArrayRef<MappableComponent>(
3522
552
        static_cast<const T *>(this)
3523
552
            ->template getTrailingObjects<MappableComponent>(),
3524
552
        NumComponents);
3525
552
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getComponentsRef() const
Line
Count
Source
3520
14.1k
  ArrayRef<MappableComponent> getComponentsRef() const {
3521
14.1k
    return ArrayRef<MappableComponent>(
3522
14.1k
        static_cast<const T *>(this)
3523
14.1k
            ->template getTrailingObjects<MappableComponent>(),
3524
14.1k
        NumComponents);
3525
14.1k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getComponentsRef() const
Line
Count
Source
3520
80
  ArrayRef<MappableComponent> getComponentsRef() const {
3521
80
    return ArrayRef<MappableComponent>(
3522
80
        static_cast<const T *>(this)
3523
80
            ->template getTrailingObjects<MappableComponent>(),
3524
80
        NumComponents);
3525
80
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getComponentsRef() const
Line
Count
Source
3520
110
  ArrayRef<MappableComponent> getComponentsRef() const {
3521
110
    return ArrayRef<MappableComponent>(
3522
110
        static_cast<const T *>(this)
3523
110
            ->template getTrailingObjects<MappableComponent>(),
3524
110
        NumComponents);
3525
110
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getComponentsRef() const
Line
Count
Source
3520
288
  ArrayRef<MappableComponent> getComponentsRef() const {
3521
288
    return ArrayRef<MappableComponent>(
3522
288
        static_cast<const T *>(this)
3523
288
            ->template getTrailingObjects<MappableComponent>(),
3524
288
        NumComponents);
3525
288
  }
3526
3527
  /// Set the components that are in the trailing objects of the class.
3528
  /// This requires the list sizes so that it can also fill the original
3529
  /// expressions, which are the first component of each list.
3530
  void setComponents(ArrayRef<MappableComponent> Components,
3531
2.09k
                     ArrayRef<unsigned> CLSs) {
3532
2.09k
    assert(Components.size() == NumComponents &&
3533
2.09k
           "Unexpected amount of component lists.");
3534
2.09k
    assert(CLSs.size() == NumComponentLists &&
3535
2.09k
           "Unexpected amount of list sizes.");
3536
2.09k
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3537
2.09k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3531
1.55k
                     ArrayRef<unsigned> CLSs) {
3532
1.55k
    assert(Components.size() == NumComponents &&
3533
1.55k
           "Unexpected amount of component lists.");
3534
1.55k
    assert(CLSs.size() == NumComponentLists &&
3535
1.55k
           "Unexpected amount of list sizes.");
3536
1.55k
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3537
1.55k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3531
32
                     ArrayRef<unsigned> CLSs) {
3532
32
    assert(Components.size() == NumComponents &&
3533
32
           "Unexpected amount of component lists.");
3534
32
    assert(CLSs.size() == NumComponentLists &&
3535
32
           "Unexpected amount of list sizes.");
3536
32
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3537
32
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3531
32
                     ArrayRef<unsigned> CLSs) {
3532
32
    assert(Components.size() == NumComponents &&
3533
32
           "Unexpected amount of component lists.");
3534
32
    assert(CLSs.size() == NumComponentLists &&
3535
32
           "Unexpected amount of list sizes.");
3536
32
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3537
32
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3531
84
                     ArrayRef<unsigned> CLSs) {
3532
84
    assert(Components.size() == NumComponents &&
3533
84
           "Unexpected amount of component lists.");
3534
84
    assert(CLSs.size() == NumComponentLists &&
3535
84
           "Unexpected amount of list sizes.");
3536
84
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3537
84
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3531
396
                     ArrayRef<unsigned> CLSs) {
3532
396
    assert(Components.size() == NumComponents &&
3533
396
           "Unexpected amount of component lists.");
3534
396
    assert(CLSs.size() == NumComponentLists &&
3535
396
           "Unexpected amount of list sizes.");
3536
396
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3537
396
  }
3538
3539
  /// Fill the clause information from the list of declarations and
3540
  /// associated component lists.
3541
  void setClauseInfo(ArrayRef<ValueDecl *> Declarations,
3542
16.3k
                     MappableExprComponentListsRef ComponentLists) {
3543
16.3k
    // Perform some checks to make sure the data sizes are consistent with the
3544
16.3k
    // information available when the clause was created.
3545
16.3k
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3546
16.3k
               NumUniqueDeclarations &&
3547
16.3k
           "Unexpected number of mappable expression info entries!");
3548
16.3k
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3549
16.3k
           "Unexpected total number of components!");
3550
16.3k
    assert(Declarations.size() == ComponentLists.size() &&
3551
16.3k
           "Declaration and component lists size is not consistent!");
3552
16.3k
    assert(Declarations.size() == NumComponentLists &&
3553
16.3k
           "Unexpected declaration and component lists size!");
3554
16.3k
3555
16.3k
    // Organize the components by declaration and retrieve the original
3556
16.3k
    // expression. Original expressions are always the first component of the
3557
16.3k
    // mappable component list.
3558
16.3k
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3559
16.3k
        ComponentListMap;
3560
16.3k
    {
3561
16.3k
      auto CI = ComponentLists.begin();
3562
33.2k
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3563
16.8k
           ++DI, ++CI) {
3564
16.8k
        assert(!CI->empty() && "Invalid component list!");
3565
16.8k
        ComponentListMap[*DI].push_back(*CI);
3566
16.8k
      }
3567
16.3k
    }
3568
16.3k
3569
16.3k
    // Iterators of the target storage.
3570
16.3k
    auto UniqueDeclarations = getUniqueDeclsRef();
3571
16.3k
    auto UDI = UniqueDeclarations.begin();
3572
16.3k
3573
16.3k
    auto DeclNumLists = getDeclNumListsRef();
3574
16.3k
    auto DNLI = DeclNumLists.begin();
3575
16.3k
3576
16.3k
    auto ComponentListSizes = getComponentListSizesRef();
3577
16.3k
    auto CLSI = ComponentListSizes.begin();
3578
16.3k
3579
16.3k
    auto Components = getComponentsRef();
3580
16.3k
    auto CI = Components.begin();
3581
16.3k
3582
16.3k
    // Variable to compute the accumulation of the number of components.
3583
16.3k
    unsigned PrevSize = 0u;
3584
16.3k
3585
16.3k
    // Scan all the declarations and associated component lists.
3586
16.7k
    for (auto &M : ComponentListMap) {
3587
16.7k
      // The declaration.
3588
16.7k
      auto *D = M.first;
3589
16.7k
      // The component lists.
3590
16.7k
      auto CL = M.second;
3591
16.7k
3592
16.7k
      // Initialize the entry.
3593
16.7k
      *UDI = D;
3594
16.7k
      ++UDI;
3595
16.7k
3596
16.7k
      *DNLI = CL.size();
3597
16.7k
      ++DNLI;
3598
16.7k
3599
16.7k
      // Obtain the cumulative sizes and concatenate all the components in the
3600
16.7k
      // reserved storage.
3601
16.8k
      for (auto C : CL) {
3602
16.8k
        // Accumulate with the previous size.
3603
16.8k
        PrevSize += C.size();
3604
16.8k
3605
16.8k
        // Save the size.
3606
16.8k
        *CLSI = PrevSize;
3607
16.8k
        ++CLSI;
3608
16.8k
3609
16.8k
        // Append components after the current components iterator.
3610
16.8k
        CI = std::copy(C.begin(), C.end(), CI);
3611
16.8k
      }
3612
16.7k
    }
3613
16.3k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3542
12.7k
                     MappableExprComponentListsRef ComponentLists) {
3543
12.7k
    // Perform some checks to make sure the data sizes are consistent with the
3544
12.7k
    // information available when the clause was created.
3545
12.7k
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3546
12.7k
               NumUniqueDeclarations &&
3547
12.7k
           "Unexpected number of mappable expression info entries!");
3548
12.7k
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3549
12.7k
           "Unexpected total number of components!");
3550
12.7k
    assert(Declarations.size() == ComponentLists.size() &&
3551
12.7k
           "Declaration and component lists size is not consistent!");
3552
12.7k
    assert(Declarations.size() == NumComponentLists &&
3553
12.7k
           "Unexpected declaration and component lists size!");
3554
12.7k
3555
12.7k
    // Organize the components by declaration and retrieve the original
3556
12.7k
    // expression. Original expressions are always the first component of the
3557
12.7k
    // mappable component list.
3558
12.7k
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3559
12.7k
        ComponentListMap;
3560
12.7k
    {
3561
12.7k
      auto CI = ComponentLists.begin();
3562
26.6k
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3563
13.8k
           ++DI, ++CI) {
3564
13.8k
        assert(!CI->empty() && "Invalid component list!");
3565
13.8k
        ComponentListMap[*DI].push_back(*CI);
3566
13.8k
      }
3567
12.7k
    }
3568
12.7k
3569
12.7k
    // Iterators of the target storage.
3570
12.7k
    auto UniqueDeclarations = getUniqueDeclsRef();
3571
12.7k
    auto UDI = UniqueDeclarations.begin();
3572
12.7k
3573
12.7k
    auto DeclNumLists = getDeclNumListsRef();
3574
12.7k
    auto DNLI = DeclNumLists.begin();
3575
12.7k
3576
12.7k
    auto ComponentListSizes = getComponentListSizesRef();
3577
12.7k
    auto CLSI = ComponentListSizes.begin();
3578
12.7k
3579
12.7k
    auto Components = getComponentsRef();
3580
12.7k
    auto CI = Components.begin();
3581
12.7k
3582
12.7k
    // Variable to compute the accumulation of the number of components.
3583
12.7k
    unsigned PrevSize = 0u;
3584
12.7k
3585
12.7k
    // Scan all the declarations and associated component lists.
3586
13.7k
    for (auto &M : ComponentListMap) {
3587
13.7k
      // The declaration.
3588
13.7k
      auto *D = M.first;
3589
13.7k
      // The component lists.
3590
13.7k
      auto CL = M.second;
3591
13.7k
3592
13.7k
      // Initialize the entry.
3593
13.7k
      *UDI = D;
3594
13.7k
      ++UDI;
3595
13.7k
3596
13.7k
      *DNLI = CL.size();
3597
13.7k
      ++DNLI;
3598
13.7k
3599
13.7k
      // Obtain the cumulative sizes and concatenate all the components in the
3600
13.7k
      // reserved storage.
3601
13.8k
      for (auto C : CL) {
3602
13.8k
        // Accumulate with the previous size.
3603
13.8k
        PrevSize += C.size();
3604
13.8k
3605
13.8k
        // Save the size.
3606
13.8k
        *CLSI = PrevSize;
3607
13.8k
        ++CLSI;
3608
13.8k
3609
13.8k
        // Append components after the current components iterator.
3610
13.8k
        CI = std::copy(C.begin(), C.end(), CI);
3611
13.8k
      }
3612
13.7k
    }
3613
12.7k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3542
716
                     MappableExprComponentListsRef ComponentLists) {
3543
716
    // Perform some checks to make sure the data sizes are consistent with the
3544
716
    // information available when the clause was created.
3545
716
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3546
716
               NumUniqueDeclarations &&
3547
716
           "Unexpected number of mappable expression info entries!");
3548
716
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3549
716
           "Unexpected total number of components!");
3550
716
    assert(Declarations.size() == ComponentLists.size() &&
3551
716
           "Declaration and component lists size is not consistent!");
3552
716
    assert(Declarations.size() == NumComponentLists &&
3553
716
           "Unexpected declaration and component lists size!");
3554
716
3555
716
    // Organize the components by declaration and retrieve the original
3556
716
    // expression. Original expressions are always the first component of the
3557
716
    // mappable component list.
3558
716
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3559
716
        ComponentListMap;
3560
716
    {
3561
716
      auto CI = ComponentLists.begin();
3562
1.35k
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3563
716
           
++DI, ++CI642
) {
3564
642
        assert(!CI->empty() && "Invalid component list!");
3565
642
        ComponentListMap[*DI].push_back(*CI);
3566
642
      }
3567
716
    }
3568
716
3569
716
    // Iterators of the target storage.
3570
716
    auto UniqueDeclarations = getUniqueDeclsRef();
3571
716
    auto UDI = UniqueDeclarations.begin();
3572
716
3573
716
    auto DeclNumLists = getDeclNumListsRef();
3574
716
    auto DNLI = DeclNumLists.begin();
3575
716
3576
716
    auto ComponentListSizes = getComponentListSizesRef();
3577
716
    auto CLSI = ComponentListSizes.begin();
3578
716
3579
716
    auto Components = getComponentsRef();
3580
716
    auto CI = Components.begin();
3581
716
3582
716
    // Variable to compute the accumulation of the number of components.
3583
716
    unsigned PrevSize = 0u;
3584
716
3585
716
    // Scan all the declarations and associated component lists.
3586
716
    for (auto &M : ComponentListMap) {
3587
634
      // The declaration.
3588
634
      auto *D = M.first;
3589
634
      // The component lists.
3590
634
      auto CL = M.second;
3591
634
3592
634
      // Initialize the entry.
3593
634
      *UDI = D;
3594
634
      ++UDI;
3595
634
3596
634
      *DNLI = CL.size();
3597
634
      ++DNLI;
3598
634
3599
634
      // Obtain the cumulative sizes and concatenate all the components in the
3600
634
      // reserved storage.
3601
642
      for (auto C : CL) {
3602
642
        // Accumulate with the previous size.
3603
642
        PrevSize += C.size();
3604
642
3605
642
        // Save the size.
3606
642
        *CLSI = PrevSize;
3607
642
        ++CLSI;
3608
642
3609
642
        // Append components after the current components iterator.
3610
642
        CI = std::copy(C.begin(), C.end(), CI);
3611
642
      }
3612
634
    }
3613
716
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3542
362
                     MappableExprComponentListsRef ComponentLists) {
3543
362
    // Perform some checks to make sure the data sizes are consistent with the
3544
362
    // information available when the clause was created.
3545
362
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3546
362
               NumUniqueDeclarations &&
3547
362
           "Unexpected number of mappable expression info entries!");
3548
362
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3549
362
           "Unexpected total number of components!");
3550
362
    assert(Declarations.size() == ComponentLists.size() &&
3551
362
           "Declaration and component lists size is not consistent!");
3552
362
    assert(Declarations.size() == NumComponentLists &&
3553
362
           "Unexpected declaration and component lists size!");
3554
362
3555
362
    // Organize the components by declaration and retrieve the original
3556
362
    // expression. Original expressions are always the first component of the
3557
362
    // mappable component list.
3558
362
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3559
362
        ComponentListMap;
3560
362
    {
3561
362
      auto CI = ComponentLists.begin();
3562
710
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3563
362
           
++DI, ++CI348
) {
3564
348
        assert(!CI->empty() && "Invalid component list!");
3565
348
        ComponentListMap[*DI].push_back(*CI);
3566
348
      }
3567
362
    }
3568
362
3569
362
    // Iterators of the target storage.
3570
362
    auto UniqueDeclarations = getUniqueDeclsRef();
3571
362
    auto UDI = UniqueDeclarations.begin();
3572
362
3573
362
    auto DeclNumLists = getDeclNumListsRef();
3574
362
    auto DNLI = DeclNumLists.begin();
3575
362
3576
362
    auto ComponentListSizes = getComponentListSizesRef();
3577
362
    auto CLSI = ComponentListSizes.begin();
3578
362
3579
362
    auto Components = getComponentsRef();
3580
362
    auto CI = Components.begin();
3581
362
3582
362
    // Variable to compute the accumulation of the number of components.
3583
362
    unsigned PrevSize = 0u;
3584
362
3585
362
    // Scan all the declarations and associated component lists.
3586
362
    for (auto &M : ComponentListMap) {
3587
340
      // The declaration.
3588
340
      auto *D = M.first;
3589
340
      // The component lists.
3590
340
      auto CL = M.second;
3591
340
3592
340
      // Initialize the entry.
3593
340
      *UDI = D;
3594
340
      ++UDI;
3595
340
3596
340
      *DNLI = CL.size();
3597
340
      ++DNLI;
3598
340
3599
340
      // Obtain the cumulative sizes and concatenate all the components in the
3600
340
      // reserved storage.
3601
348
      for (auto C : CL) {
3602
348
        // Accumulate with the previous size.
3603
348
        PrevSize += C.size();
3604
348
3605
348
        // Save the size.
3606
348
        *CLSI = PrevSize;
3607
348
        ++CLSI;
3608
348
3609
348
        // Append components after the current components iterator.
3610
348
        CI = std::copy(C.begin(), C.end(), CI);
3611
348
      }
3612
340
    }
3613
362
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3542
344
                     MappableExprComponentListsRef ComponentLists) {
3543
344
    // Perform some checks to make sure the data sizes are consistent with the
3544
344
    // information available when the clause was created.
3545
344
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3546
344
               NumUniqueDeclarations &&
3547
344
           "Unexpected number of mappable expression info entries!");
3548
344
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3549
344
           "Unexpected total number of components!");
3550
344
    assert(Declarations.size() == ComponentLists.size() &&
3551
344
           "Declaration and component lists size is not consistent!");
3552
344
    assert(Declarations.size() == NumComponentLists &&
3553
344
           "Unexpected declaration and component lists size!");
3554
344
3555
344
    // Organize the components by declaration and retrieve the original
3556
344
    // expression. Original expressions are always the first component of the
3557
344
    // mappable component list.
3558
344
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3559
344
        ComponentListMap;
3560
344
    {
3561
344
      auto CI = ComponentLists.begin();
3562
610
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3563
344
           
++DI, ++CI266
) {
3564
266
        assert(!CI->empty() && "Invalid component list!");
3565
266
        ComponentListMap[*DI].push_back(*CI);
3566
266
      }
3567
344
    }
3568
344
3569
344
    // Iterators of the target storage.
3570
344
    auto UniqueDeclarations = getUniqueDeclsRef();
3571
344
    auto UDI = UniqueDeclarations.begin();
3572
344
3573
344
    auto DeclNumLists = getDeclNumListsRef();
3574
344
    auto DNLI = DeclNumLists.begin();
3575
344
3576
344
    auto ComponentListSizes = getComponentListSizesRef();
3577
344
    auto CLSI = ComponentListSizes.begin();
3578
344
3579
344
    auto Components = getComponentsRef();
3580
344
    auto CI = Components.begin();
3581
344
3582
344
    // Variable to compute the accumulation of the number of components.
3583
344
    unsigned PrevSize = 0u;
3584
344
3585
344
    // Scan all the declarations and associated component lists.
3586
344
    for (auto &M : ComponentListMap) {
3587
266
      // The declaration.
3588
266
      auto *D = M.first;
3589
266
      // The component lists.
3590
266
      auto CL = M.second;
3591
266
3592
266
      // Initialize the entry.
3593
266
      *UDI = D;
3594
266
      ++UDI;
3595
266
3596
266
      *DNLI = CL.size();
3597
266
      ++DNLI;
3598
266
3599
266
      // Obtain the cumulative sizes and concatenate all the components in the
3600
266
      // reserved storage.
3601
266
      for (auto C : CL) {
3602
266
        // Accumulate with the previous size.
3603
266
        PrevSize += C.size();
3604
266
3605
266
        // Save the size.
3606
266
        *CLSI = PrevSize;
3607
266
        ++CLSI;
3608
266
3609
266
        // Append components after the current components iterator.
3610
266
        CI = std::copy(C.begin(), C.end(), CI);
3611
266
      }
3612
266
    }
3613
344
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3542
2.15k
                     MappableExprComponentListsRef ComponentLists) {
3543
2.15k
    // Perform some checks to make sure the data sizes are consistent with the
3544
2.15k
    // information available when the clause was created.
3545
2.15k
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3546
2.15k
               NumUniqueDeclarations &&
3547
2.15k
           "Unexpected number of mappable expression info entries!");
3548
2.15k
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3549
2.15k
           "Unexpected total number of components!");
3550
2.15k
    assert(Declarations.size() == ComponentLists.size() &&
3551
2.15k
           "Declaration and component lists size is not consistent!");
3552
2.15k
    assert(Declarations.size() == NumComponentLists &&
3553
2.15k
           "Unexpected declaration and component lists size!");
3554
2.15k
3555
2.15k
    // Organize the components by declaration and retrieve the original
3556
2.15k
    // expression. Original expressions are always the first component of the
3557
2.15k
    // mappable component list.
3558
2.15k
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3559
2.15k
        ComponentListMap;
3560
2.15k
    {
3561
2.15k
      auto CI = ComponentLists.begin();
3562
3.94k
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3563
2.15k
           
++DI, ++CI1.79k
) {
3564
1.79k
        assert(!CI->empty() && "Invalid component list!");
3565
1.79k
        ComponentListMap[*DI].push_back(*CI);
3566
1.79k
      }
3567
2.15k
    }
3568
2.15k
3569
2.15k
    // Iterators of the target storage.
3570
2.15k
    auto UniqueDeclarations = getUniqueDeclsRef();
3571
2.15k
    auto UDI = UniqueDeclarations.begin();
3572
2.15k
3573
2.15k
    auto DeclNumLists = getDeclNumListsRef();
3574
2.15k
    auto DNLI = DeclNumLists.begin();
3575
2.15k
3576
2.15k
    auto ComponentListSizes = getComponentListSizesRef();
3577
2.15k
    auto CLSI = ComponentListSizes.begin();
3578
2.15k
3579
2.15k
    auto Components = getComponentsRef();
3580
2.15k
    auto CI = Components.begin();
3581
2.15k
3582
2.15k
    // Variable to compute the accumulation of the number of components.
3583
2.15k
    unsigned PrevSize = 0u;
3584
2.15k
3585
2.15k
    // Scan all the declarations and associated component lists.
3586
2.15k
    for (auto &M : ComponentListMap) {
3587
1.78k
      // The declaration.
3588
1.78k
      auto *D = M.first;
3589
1.78k
      // The component lists.
3590
1.78k
      auto CL = M.second;
3591
1.78k
3592
1.78k
      // Initialize the entry.
3593
1.78k
      *UDI = D;
3594
1.78k
      ++UDI;
3595
1.78k
3596
1.78k
      *DNLI = CL.size();
3597
1.78k
      ++DNLI;
3598
1.78k
3599
1.78k
      // Obtain the cumulative sizes and concatenate all the components