Coverage Report

Created: 2018-07-22 10:17

/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
107k
      : StartLoc(StartLoc), EndLoc(EndLoc), Kind(K) {}
64
65
public:
66
  /// Returns the starting location of the clause.
67
44.1k
  SourceLocation getLocStart() const { return StartLoc; }
68
69
  /// Returns the ending location of the clause.
70
41.7k
  SourceLocation getLocEnd() const { return EndLoc; }
71
72
  /// Sets the starting location of the clause.
73
11.8k
  void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
74
75
  /// Sets the ending location of the clause.
76
11.8k
  void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
77
78
  /// Returns kind of OpenMP clause (private, shared, reduction, etc.).
79
1.32M
  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.2k
  OMPClauseWithPreInit(const OMPClause *This) {
110
59.2k
    assert(get(This) && "get is not tuned for pre-init.");
111
59.2k
  }
112
113
  /// Set pre-initialization statement for the clause.
114
59.2k
  void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion = OMPD_unknown) {
115
59.2k
    PreInit = S;
116
59.2k
    CaptureRegion = ThisRegion;
117
59.2k
  }
118
119
public:
120
  /// Get pre-initialization statement for the clause.
121
39.6k
  const Stmt *getPreInitStmt() const { return PreInit; }
122
123
  /// Get pre-initialization statement for the clause.
124
6.46k
  Stmt *getPreInitStmt() { return PreInit; }
125
126
  /// Get capture region for the stmt in the clause.
127
36.3k
  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.92k
  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.01k
      : 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
362k
  MutableArrayRef<Expr *> getVarRefs() {
186
362k
    return MutableArrayRef<Expr *>(
187
362k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
362k
  }
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
7.21k
  MutableArrayRef<Expr *> getVarRefs() {
186
7.21k
    return MutableArrayRef<Expr *>(
187
7.21k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
7.21k
  }
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.5k
  MutableArrayRef<Expr *> getVarRefs() {
186
15.5k
    return MutableArrayRef<Expr *>(
187
15.5k
        static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars);
188
15.5k
  }
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.01k
  void setVarRefs(ArrayRef<Expr *> VL) {
192
3.01k
    assert(VL.size() == NumVars &&
193
3.01k
           "Number of variables is not the same as the preallocated buffer");
194
3.01k
    std::copy(VL.begin(), VL.end(),
195
3.01k
              static_cast<T *>(this)->template getTrailingObjects<Expr *>());
196
3.01k
  }
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
590k
  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.7k
  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.8k
  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
41.8k
  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
904
  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.64k
  varlist_range varlists() {
208
3.64k
    return varlist_range(varlist_begin(), varlist_end());
209
3.64k
  }
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.78k
  varlist_const_range varlists() const {
211
9.78k
    return varlist_const_range(varlist_begin(), varlist_end());
212
9.78k
  }
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
457
  varlist_const_range varlists() const {
211
457
    return varlist_const_range(varlist_begin(), varlist_end());
212
457
  }
clang::OMPVarListClause<clang::OMPReductionClause>::varlists() const
Line
Count
Source
210
821
  varlist_const_range varlists() const {
211
821
    return varlist_const_range(varlist_begin(), varlist_end());
212
821
  }
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.0k
  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.14k
  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
272k
  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.2k
  varlist_iterator varlist_end() { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_end()
Line
Count
Source
215
86.7k
  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.26k
  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_begin() const
Line
Count
Source
216
821
  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.5k
  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.50k
  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_end() const
Line
Count
Source
217
14.9k
  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.25k
  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
572
  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.54k
  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
75.9k
  ArrayRef<const Expr *> getVarRefs() const {
227
75.9k
    return llvm::makeArrayRef(
228
75.9k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
75.9k
        NumVars);
230
75.9k
  }
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
6.78k
  ArrayRef<const Expr *> getVarRefs() const {
227
6.78k
    return llvm::makeArrayRef(
228
6.78k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
6.78k
        NumVars);
230
6.78k
  }
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.14k
  ArrayRef<const Expr *> getVarRefs() const {
227
3.14k
    return llvm::makeArrayRef(
228
3.14k
        static_cast<const T *>(this)->template getTrailingObjects<Expr *>(),
229
3.14k
        NumVars);
230
3.14k
  }
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
66.5k
  static bool classof(const OMPClause *T) {
319
66.5k
    return T->getClauseKind() == OMPC_if;
320
66.5k
  }
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
7.41k
  static bool classof(const OMPClause *T) {
431
7.41k
    return T->getClauseKind() == OMPC_num_threads;
432
7.41k
  }
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.07k
  static bool classof(const OMPClause *T) {
486
7.07k
    return T->getClauseKind() == OMPC_safelen;
487
7.07k
  }
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.51k
  static bool classof(const OMPClause *T) {
540
7.51k
    return T->getClauseKind() == OMPC_simdlen;
541
7.51k
  }
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.4k
  static bool classof(const OMPClause *T) {
595
58.4k
    return T->getClauseKind() == OMPC_collapse;
596
58.4k
  }
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
802
        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.17k
  static bool classof(const OMPClause *T) {
733
4.17k
    return T->getClauseKind() == OMPC_proc_bind;
734
4.17k
  }
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.32k
        ChunkSize(ChunkSize) {
855
2.32k
    setPreInitStmt(HelperChunkSize);
856
2.32k
    Modifiers[FIRST] = M1;
857
2.32k
    Modifiers[SECOND] = M2;
858
2.32k
    ModifiersLoc[FIRST] = M1Loc;
859
2.32k
    ModifiersLoc[SECOND] = M2Loc;
860
2.32k
  }
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
1.94k
  OpenMPScheduleClauseKind getScheduleKind() const { return Kind; }
872
873
  /// Get the first modifier of the clause.
874
4.22k
  OpenMPScheduleClauseModifier getFirstScheduleModifier() const {
875
4.22k
    return Modifiers[FIRST];
876
4.22k
  }
877
878
  /// Get the second modifier of the clause.
879
4.00k
  OpenMPScheduleClauseModifier getSecondScheduleModifier() const {
880
4.00k
    return Modifiers[SECOND];
881
4.00k
  }
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
600
  const Expr *getChunkSize() const { return ChunkSize; }
907
908
590
  child_range children() {
909
590
    return child_range(reinterpret_cast<Stmt **>(&ChunkSize),
910
590
                       reinterpret_cast<Stmt **>(&ChunkSize) + 1);
911
590
  }
912
913
3.21k
  static bool classof(const OMPClause *T) {
914
3.21k
    return T->getClauseKind() == OMPC_schedule;
915
3.21k
  }
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 : public OMPClause {
926
  friend class OMPClauseReader;
927
928
  /// Location of '('.
929
  SourceLocation LParenLoc;
930
931
  /// Number of for-loops.
932
  Stmt *NumForLoops = nullptr;
933
934
  /// Set the number of associated for-loops.
935
52
  void setNumForLoops(Expr *Num) { NumForLoops = Num; }
936
937
public:
938
  /// Build 'ordered' clause.
939
  ///
940
  /// \param Num Expression, possibly associated with this clause.
941
  /// \param StartLoc Starting location of the clause.
942
  /// \param LParenLoc Location of '('.
943
  /// \param EndLoc Ending location of the clause.
944
  OMPOrderedClause(Expr *Num, SourceLocation StartLoc,
945
                    SourceLocation LParenLoc, SourceLocation EndLoc)
946
      : OMPClause(OMPC_ordered, StartLoc, EndLoc), LParenLoc(LParenLoc),
947
914
        NumForLoops(Num) {}
948
949
  /// Build an empty clause.
950
  explicit OMPOrderedClause()
951
52
      : OMPClause(OMPC_ordered, SourceLocation(), SourceLocation()) {}
952
953
  /// Sets the location of '('.
954
52
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
955
956
  /// Returns the location of '('.
957
512
  SourceLocation getLParenLoc() const { return LParenLoc; }
958
959
  /// Return the number of associated for-loops.
960
1.70k
  Expr *getNumForLoops() const { return cast_or_null<Expr>(NumForLoops); }
961
962
18
  child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); }
963
964
27.0k
  static bool classof(const OMPClause *T) {
965
27.0k
    return T->getClauseKind() == OMPC_ordered;
966
27.0k
  }
967
};
968
969
/// This represents 'nowait' clause in the '#pragma omp ...' directive.
970
///
971
/// \code
972
/// #pragma omp for nowait
973
/// \endcode
974
/// In this example directive '#pragma omp for' has 'nowait' clause.
975
class OMPNowaitClause : public OMPClause {
976
public:
977
  /// Build 'nowait' clause.
978
  ///
979
  /// \param StartLoc Starting location of the clause.
980
  /// \param EndLoc Ending location of the clause.
981
  OMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc)
982
958
      : OMPClause(OMPC_nowait, StartLoc, EndLoc) {}
983
984
  /// Build an empty clause.
985
  OMPNowaitClause()
986
352
      : OMPClause(OMPC_nowait, SourceLocation(), SourceLocation()) {}
987
988
54
  child_range children() {
989
54
    return child_range(child_iterator(), child_iterator());
990
54
  }
991
992
6.59k
  static bool classof(const OMPClause *T) {
993
6.59k
    return T->getClauseKind() == OMPC_nowait;
994
6.59k
  }
995
};
996
997
/// This represents 'untied' clause in the '#pragma omp ...' directive.
998
///
999
/// \code
1000
/// #pragma omp task untied
1001
/// \endcode
1002
/// In this example directive '#pragma omp task' has 'untied' clause.
1003
class OMPUntiedClause : public OMPClause {
1004
public:
1005
  /// Build 'untied' clause.
1006
  ///
1007
  /// \param StartLoc Starting location of the clause.
1008
  /// \param EndLoc Ending location of the clause.
1009
  OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
1010
36
      : OMPClause(OMPC_untied, StartLoc, EndLoc) {}
1011
1012
  /// Build an empty clause.
1013
  OMPUntiedClause()
1014
14
      : OMPClause(OMPC_untied, SourceLocation(), SourceLocation()) {}
1015
1016
16
  child_range children() {
1017
16
    return child_range(child_iterator(), child_iterator());
1018
16
  }
1019
1020
83
  static bool classof(const OMPClause *T) {
1021
83
    return T->getClauseKind() == OMPC_untied;
1022
83
  }
1023
};
1024
1025
/// This represents 'mergeable' clause in the '#pragma omp ...'
1026
/// directive.
1027
///
1028
/// \code
1029
/// #pragma omp task mergeable
1030
/// \endcode
1031
/// In this example directive '#pragma omp task' has 'mergeable' clause.
1032
class OMPMergeableClause : public OMPClause {
1033
public:
1034
  /// Build 'mergeable' clause.
1035
  ///
1036
  /// \param StartLoc Starting location of the clause.
1037
  /// \param EndLoc Ending location of the clause.
1038
  OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
1039
32
      : OMPClause(OMPC_mergeable, StartLoc, EndLoc) {}
1040
1041
  /// Build an empty clause.
1042
  OMPMergeableClause()
1043
12
      : OMPClause(OMPC_mergeable, SourceLocation(), SourceLocation()) {}
1044
1045
32
  child_range children() {
1046
32
    return child_range(child_iterator(), child_iterator());
1047
32
  }
1048
1049
  static bool classof(const OMPClause *T) {
1050
    return T->getClauseKind() == OMPC_mergeable;
1051
  }
1052
};
1053
1054
/// This represents 'read' clause in the '#pragma omp atomic' directive.
1055
///
1056
/// \code
1057
/// #pragma omp atomic read
1058
/// \endcode
1059
/// In this example directive '#pragma omp atomic' has 'read' clause.
1060
class OMPReadClause : public OMPClause {
1061
public:
1062
  /// Build 'read' clause.
1063
  ///
1064
  /// \param StartLoc Starting location of the clause.
1065
  /// \param EndLoc Ending location of the clause.
1066
  OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
1067
278
      : OMPClause(OMPC_read, StartLoc, EndLoc) {}
1068
1069
  /// Build an empty clause.
1070
102
  OMPReadClause() : OMPClause(OMPC_read, SourceLocation(), SourceLocation()) {}
1071
1072
0
  child_range children() {
1073
0
    return child_range(child_iterator(), child_iterator());
1074
0
  }
1075
1076
  static bool classof(const OMPClause *T) {
1077
    return T->getClauseKind() == OMPC_read;
1078
  }
1079
};
1080
1081
/// This represents 'write' clause in the '#pragma omp atomic' directive.
1082
///
1083
/// \code
1084
/// #pragma omp atomic write
1085
/// \endcode
1086
/// In this example directive '#pragma omp atomic' has 'write' clause.
1087
class OMPWriteClause : public OMPClause {
1088
public:
1089
  /// Build 'write' clause.
1090
  ///
1091
  /// \param StartLoc Starting location of the clause.
1092
  /// \param EndLoc Ending location of the clause.
1093
  OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
1094
282
      : OMPClause(OMPC_write, StartLoc, EndLoc) {}
1095
1096
  /// Build an empty clause.
1097
  OMPWriteClause()
1098
104
      : OMPClause(OMPC_write, SourceLocation(), SourceLocation()) {}
1099
1100
0
  child_range children() {
1101
0
    return child_range(child_iterator(), child_iterator());
1102
0
  }
1103
1104
  static bool classof(const OMPClause *T) {
1105
    return T->getClauseKind() == OMPC_write;
1106
  }
1107
};
1108
1109
/// This represents 'update' clause in the '#pragma omp atomic'
1110
/// directive.
1111
///
1112
/// \code
1113
/// #pragma omp atomic update
1114
/// \endcode
1115
/// In this example directive '#pragma omp atomic' has 'update' clause.
1116
class OMPUpdateClause : public OMPClause {
1117
public:
1118
  /// Build 'update' clause.
1119
  ///
1120
  /// \param StartLoc Starting location of the clause.
1121
  /// \param EndLoc Ending location of the clause.
1122
  OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc)
1123
228
      : OMPClause(OMPC_update, StartLoc, EndLoc) {}
1124
1125
  /// Build an empty clause.
1126
  OMPUpdateClause()
1127
54
      : OMPClause(OMPC_update, SourceLocation(), SourceLocation()) {}
1128
1129
0
  child_range children() {
1130
0
    return child_range(child_iterator(), child_iterator());
1131
0
  }
1132
1133
  static bool classof(const OMPClause *T) {
1134
    return T->getClauseKind() == OMPC_update;
1135
  }
1136
};
1137
1138
/// This represents 'capture' clause in the '#pragma omp atomic'
1139
/// directive.
1140
///
1141
/// \code
1142
/// #pragma omp atomic capture
1143
/// \endcode
1144
/// In this example directive '#pragma omp atomic' has 'capture' clause.
1145
class OMPCaptureClause : public OMPClause {
1146
public:
1147
  /// Build 'capture' clause.
1148
  ///
1149
  /// \param StartLoc Starting location of the clause.
1150
  /// \param EndLoc Ending location of the clause.
1151
  OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
1152
660
      : OMPClause(OMPC_capture, StartLoc, EndLoc) {}
1153
1154
  /// Build an empty clause.
1155
  OMPCaptureClause()
1156
112
      : OMPClause(OMPC_capture, SourceLocation(), SourceLocation()) {}
1157
1158
0
  child_range children() {
1159
0
    return child_range(child_iterator(), child_iterator());
1160
0
  }
1161
1162
  static bool classof(const OMPClause *T) {
1163
    return T->getClauseKind() == OMPC_capture;
1164
  }
1165
};
1166
1167
/// This represents 'seq_cst' clause in the '#pragma omp atomic'
1168
/// directive.
1169
///
1170
/// \code
1171
/// #pragma omp atomic seq_cst
1172
/// \endcode
1173
/// In this example directive '#pragma omp atomic' has 'seq_cst' clause.
1174
class OMPSeqCstClause : public OMPClause {
1175
public:
1176
  /// Build 'seq_cst' clause.
1177
  ///
1178
  /// \param StartLoc Starting location of the clause.
1179
  /// \param EndLoc Ending location of the clause.
1180
  OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
1181
128
      : OMPClause(OMPC_seq_cst, StartLoc, EndLoc) {}
1182
1183
  /// Build an empty clause.
1184
  OMPSeqCstClause()
1185
56
      : OMPClause(OMPC_seq_cst, SourceLocation(), SourceLocation()) {}
1186
1187
0
  child_range children() {
1188
0
    return child_range(child_iterator(), child_iterator());
1189
0
  }
1190
1191
380
  static bool classof(const OMPClause *T) {
1192
380
    return T->getClauseKind() == OMPC_seq_cst;
1193
380
  }
1194
};
1195
1196
/// This represents clause 'private' in the '#pragma omp ...' directives.
1197
///
1198
/// \code
1199
/// #pragma omp parallel private(a,b)
1200
/// \endcode
1201
/// In this example directive '#pragma omp parallel' has clause 'private'
1202
/// with the variables 'a' and 'b'.
1203
class OMPPrivateClause final
1204
    : public OMPVarListClause<OMPPrivateClause>,
1205
      private llvm::TrailingObjects<OMPPrivateClause, Expr *> {
1206
  friend class OMPClauseReader;
1207
  friend OMPVarListClause;
1208
  friend TrailingObjects;
1209
1210
  /// Build clause with number of variables \a N.
1211
  ///
1212
  /// \param StartLoc Starting location of the clause.
1213
  /// \param LParenLoc Location of '('.
1214
  /// \param EndLoc Ending location of the clause.
1215
  /// \param N Number of the variables in the clause.
1216
  OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1217
                   SourceLocation EndLoc, unsigned N)
1218
      : OMPVarListClause<OMPPrivateClause>(OMPC_private, StartLoc, LParenLoc,
1219
7.62k
                                           EndLoc, N) {}
1220
1221
  /// Build an empty clause.
1222
  ///
1223
  /// \param N Number of variables.
1224
  explicit OMPPrivateClause(unsigned N)
1225
      : OMPVarListClause<OMPPrivateClause>(OMPC_private, SourceLocation(),
1226
                                           SourceLocation(), SourceLocation(),
1227
906
                                           N) {}
1228
1229
  /// Sets the list of references to private copies with initializers for
1230
  /// new private variables.
1231
  /// \param VL List of references.
1232
  void setPrivateCopies(ArrayRef<Expr *> VL);
1233
1234
  /// Gets the list of references to private copies with initializers for
1235
  /// new private variables.
1236
1.89k
  MutableArrayRef<Expr *> getPrivateCopies() {
1237
1.89k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1238
1.89k
  }
1239
2.57k
  ArrayRef<const Expr *> getPrivateCopies() const {
1240
2.57k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
1241
2.57k
  }
1242
1243
public:
1244
  /// Creates clause with a list of variables \a VL.
1245
  ///
1246
  /// \param C AST context.
1247
  /// \param StartLoc Starting location of the clause.
1248
  /// \param LParenLoc Location of '('.
1249
  /// \param EndLoc Ending location of the clause.
1250
  /// \param VL List of references to the variables.
1251
  /// \param PrivateVL List of references to private copies with initializers.
1252
  static OMPPrivateClause *Create(const ASTContext &C, SourceLocation StartLoc,
1253
                                  SourceLocation LParenLoc,
1254
                                  SourceLocation EndLoc, ArrayRef<Expr *> VL,
1255
                                  ArrayRef<Expr *> PrivateVL);
1256
1257
  /// Creates an empty clause with the place for \a N variables.
1258
  ///
1259
  /// \param C AST context.
1260
  /// \param N The number of variables.
1261
  static OMPPrivateClause *CreateEmpty(const ASTContext &C, unsigned N);
1262
1263
  using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
1264
  using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
1265
  using private_copies_range = llvm::iterator_range<private_copies_iterator>;
1266
  using private_copies_const_range =
1267
      llvm::iterator_range<private_copies_const_iterator>;
1268
1269
946
  private_copies_range private_copies() {
1270
946
    return private_copies_range(getPrivateCopies().begin(),
1271
946
                                getPrivateCopies().end());
1272
946
  }
1273
1274
1.28k
  private_copies_const_range private_copies() const {
1275
1.28k
    return private_copies_const_range(getPrivateCopies().begin(),
1276
1.28k
                                      getPrivateCopies().end());
1277
1.28k
  }
1278
1279
9.13k
  child_range children() {
1280
9.13k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1281
9.13k
                       reinterpret_cast<Stmt **>(varlist_end()));
1282
9.13k
  }
1283
1284
22.5k
  static bool classof(const OMPClause *T) {
1285
22.5k
    return T->getClauseKind() == OMPC_private;
1286
22.5k
  }
1287
};
1288
1289
/// This represents clause 'firstprivate' in the '#pragma omp ...'
1290
/// directives.
1291
///
1292
/// \code
1293
/// #pragma omp parallel firstprivate(a,b)
1294
/// \endcode
1295
/// In this example directive '#pragma omp parallel' has clause 'firstprivate'
1296
/// with the variables 'a' and 'b'.
1297
class OMPFirstprivateClause final
1298
    : public OMPVarListClause<OMPFirstprivateClause>,
1299
      public OMPClauseWithPreInit,
1300
      private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> {
1301
  friend class OMPClauseReader;
1302
  friend OMPVarListClause;
1303
  friend TrailingObjects;
1304
1305
  /// Build clause with number of variables \a N.
1306
  ///
1307
  /// \param StartLoc Starting location of the clause.
1308
  /// \param LParenLoc Location of '('.
1309
  /// \param EndLoc Ending location of the clause.
1310
  /// \param N Number of the variables in the clause.
1311
  OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1312
                        SourceLocation EndLoc, unsigned N)
1313
      : OMPVarListClause<OMPFirstprivateClause>(OMPC_firstprivate, StartLoc,
1314
                                                LParenLoc, EndLoc, N),
1315
20.9k
        OMPClauseWithPreInit(this) {}
1316
1317
  /// Build an empty clause.
1318
  ///
1319
  /// \param N Number of variables.
1320
  explicit OMPFirstprivateClause(unsigned N)
1321
      : OMPVarListClause<OMPFirstprivateClause>(
1322
            OMPC_firstprivate, SourceLocation(), SourceLocation(),
1323
            SourceLocation(), N),
1324
2.22k
        OMPClauseWithPreInit(this) {}
1325
1326
  /// Sets the list of references to private copies with initializers for
1327
  /// new private variables.
1328
  /// \param VL List of references.
1329
  void setPrivateCopies(ArrayRef<Expr *> VL);
1330
1331
  /// Gets the list of references to private copies with initializers for
1332
  /// new private variables.
1333
32.2k
  MutableArrayRef<Expr *> getPrivateCopies() {
1334
32.2k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1335
32.2k
  }
1336
22.6k
  ArrayRef<const Expr *> getPrivateCopies() const {
1337
22.6k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
1338
22.6k
  }
1339
1340
  /// Sets the list of references to initializer variables for new
1341
  /// private variables.
1342
  /// \param VL List of references.
1343
  void setInits(ArrayRef<Expr *> VL);
1344
1345
  /// Gets the list of references to initializer variables for new
1346
  /// private variables.
1347
4.53k
  MutableArrayRef<Expr *> getInits() {
1348
4.53k
    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
1349
4.53k
  }
1350
11.3k
  ArrayRef<const Expr *> getInits() const {
1351
11.3k
    return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1352
11.3k
  }
1353
1354
public:
1355
  /// Creates clause with a list of variables \a VL.
1356
  ///
1357
  /// \param C AST context.
1358
  /// \param StartLoc Starting location of the clause.
1359
  /// \param LParenLoc Location of '('.
1360
  /// \param EndLoc Ending location of the clause.
1361
  /// \param VL List of references to the original variables.
1362
  /// \param PrivateVL List of references to private copies with initializers.
1363
  /// \param InitVL List of references to auto generated variables used for
1364
  /// initialization of a single array element. Used if firstprivate variable is
1365
  /// of array type.
1366
  /// \param PreInit Statement that must be executed before entering the OpenMP
1367
  /// region with this clause.
1368
  static OMPFirstprivateClause *
1369
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
1370
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
1371
         ArrayRef<Expr *> InitVL, Stmt *PreInit);
1372
1373
  /// Creates an empty clause with the place for \a N variables.
1374
  ///
1375
  /// \param C AST context.
1376
  /// \param N The number of variables.
1377
  static OMPFirstprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
1378
1379
  using private_copies_iterator = MutableArrayRef<Expr *>::iterator;
1380
  using private_copies_const_iterator = ArrayRef<const Expr *>::iterator;
1381
  using private_copies_range = llvm::iterator_range<private_copies_iterator>;
1382
  using private_copies_const_range =
1383
      llvm::iterator_range<private_copies_const_iterator>;
1384
1385
2.26k
  private_copies_range private_copies() {
1386
2.26k
    return private_copies_range(getPrivateCopies().begin(),
1387
2.26k
                                getPrivateCopies().end());
1388
2.26k
  }
1389
5.65k
  private_copies_const_range private_copies() const {
1390
5.65k
    return private_copies_const_range(getPrivateCopies().begin(),
1391
5.65k
                                      getPrivateCopies().end());
1392
5.65k
  }
1393
1394
  using inits_iterator = MutableArrayRef<Expr *>::iterator;
1395
  using inits_const_iterator = ArrayRef<const Expr *>::iterator;
1396
  using inits_range = llvm::iterator_range<inits_iterator>;
1397
  using inits_const_range = llvm::iterator_range<inits_const_iterator>;
1398
1399
2.26k
  inits_range inits() {
1400
2.26k
    return inits_range(getInits().begin(), getInits().end());
1401
2.26k
  }
1402
5.65k
  inits_const_range inits() const {
1403
5.65k
    return inits_const_range(getInits().begin(), getInits().end());
1404
5.65k
  }
1405
1406
5.32k
  child_range children() {
1407
5.32k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1408
5.32k
                       reinterpret_cast<Stmt **>(varlist_end()));
1409
5.32k
  }
1410
1411
31.2k
  static bool classof(const OMPClause *T) {
1412
31.2k
    return T->getClauseKind() == OMPC_firstprivate;
1413
31.2k
  }
1414
};
1415
1416
/// This represents clause 'lastprivate' in the '#pragma omp ...'
1417
/// directives.
1418
///
1419
/// \code
1420
/// #pragma omp simd lastprivate(a,b)
1421
/// \endcode
1422
/// In this example directive '#pragma omp simd' has clause 'lastprivate'
1423
/// with the variables 'a' and 'b'.
1424
class OMPLastprivateClause final
1425
    : public OMPVarListClause<OMPLastprivateClause>,
1426
      public OMPClauseWithPostUpdate,
1427
      private llvm::TrailingObjects<OMPLastprivateClause, Expr *> {
1428
  // There are 4 additional tail-allocated arrays at the end of the class:
1429
  // 1. Contains list of pseudo variables with the default initialization for
1430
  // each non-firstprivate variables. Used in codegen for initialization of
1431
  // lastprivate copies.
1432
  // 2. List of helper expressions for proper generation of assignment operation
1433
  // required for lastprivate clause. This list represents private variables
1434
  // (for arrays, single array element).
1435
  // 3. List of helper expressions for proper generation of assignment operation
1436
  // required for lastprivate clause. This list represents original variables
1437
  // (for arrays, single array element).
1438
  // 4. List of helper expressions that represents assignment operation:
1439
  // \code
1440
  // DstExprs = SrcExprs;
1441
  // \endcode
1442
  // Required for proper codegen of final assignment performed by the
1443
  // lastprivate clause.
1444
  friend class OMPClauseReader;
1445
  friend OMPVarListClause;
1446
  friend TrailingObjects;
1447
1448
  /// Build clause with number of variables \a N.
1449
  ///
1450
  /// \param StartLoc Starting location of the clause.
1451
  /// \param LParenLoc Location of '('.
1452
  /// \param EndLoc Ending location of the clause.
1453
  /// \param N Number of the variables in the clause.
1454
  OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1455
                       SourceLocation EndLoc, unsigned N)
1456
      : OMPVarListClause<OMPLastprivateClause>(OMPC_lastprivate, StartLoc,
1457
                                               LParenLoc, EndLoc, N),
1458
2.74k
        OMPClauseWithPostUpdate(this) {}
1459
1460
  /// Build an empty clause.
1461
  ///
1462
  /// \param N Number of variables.
1463
  explicit OMPLastprivateClause(unsigned N)
1464
      : OMPVarListClause<OMPLastprivateClause>(
1465
            OMPC_lastprivate, SourceLocation(), SourceLocation(),
1466
            SourceLocation(), N),
1467
270
        OMPClauseWithPostUpdate(this) {}
1468
1469
  /// Get the list of helper expressions for initialization of private
1470
  /// copies for lastprivate variables.
1471
11.5k
  MutableArrayRef<Expr *> getPrivateCopies() {
1472
11.5k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1473
11.5k
  }
1474
5.04k
  ArrayRef<const Expr *> getPrivateCopies() const {
1475
5.04k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
1476
5.04k
  }
1477
1478
  /// Set list of helper expressions, required for proper codegen of the
1479
  /// clause. These expressions represent private variables (for arrays, single
1480
  /// array element) in the final assignment statement performed by the
1481
  /// lastprivate clause.
1482
  void setSourceExprs(ArrayRef<Expr *> SrcExprs);
1483
1484
  /// Get the list of helper source expressions.
1485
7.93k
  MutableArrayRef<Expr *> getSourceExprs() {
1486
7.93k
    return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size());
1487
7.93k
  }
1488
4.23k
  ArrayRef<const Expr *> getSourceExprs() const {
1489
4.23k
    return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size());
1490
4.23k
  }
1491
1492
  /// Set list of helper expressions, required for proper codegen of the
1493
  /// clause. These expressions represent original variables (for arrays, single
1494
  /// array element) in the final assignment statement performed by the
1495
  /// lastprivate clause.
1496
  void setDestinationExprs(ArrayRef<Expr *> DstExprs);
1497
1498
  /// Get the list of helper destination expressions.
1499
4.28k
  MutableArrayRef<Expr *> getDestinationExprs() {
1500
4.28k
    return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
1501
4.28k
  }
1502
3.09k
  ArrayRef<const Expr *> getDestinationExprs() const {
1503
3.09k
    return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
1504
3.09k
  }
1505
1506
  /// Set list of helper assignment expressions, required for proper
1507
  /// codegen of the clause. These expressions are assignment expressions that
1508
  /// assign private copy of the variable to original variable.
1509
  void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
1510
1511
  /// Get the list of helper assignment expressions.
1512
636
  MutableArrayRef<Expr *> getAssignmentOps() {
1513
636
    return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
1514
636
  }
1515
1.14k
  ArrayRef<const Expr *> getAssignmentOps() const {
1516
1.14k
    return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
1517
1.14k
  }
1518
1519
public:
1520
  /// Creates clause with a list of variables \a VL.
1521
  ///
1522
  /// \param C AST context.
1523
  /// \param StartLoc Starting location of the clause.
1524
  /// \param LParenLoc Location of '('.
1525
  /// \param EndLoc Ending location of the clause.
1526
  /// \param VL List of references to the variables.
1527
  /// \param SrcExprs List of helper expressions for proper generation of
1528
  /// assignment operation required for lastprivate clause. This list represents
1529
  /// private variables (for arrays, single array element).
1530
  /// \param DstExprs List of helper expressions for proper generation of
1531
  /// assignment operation required for lastprivate clause. This list represents
1532
  /// original variables (for arrays, single array element).
1533
  /// \param AssignmentOps List of helper expressions that represents assignment
1534
  /// operation:
1535
  /// \code
1536
  /// DstExprs = SrcExprs;
1537
  /// \endcode
1538
  /// Required for proper codegen of final assignment performed by the
1539
  /// lastprivate clause.
1540
  /// \param PreInit Statement that must be executed before entering the OpenMP
1541
  /// region with this clause.
1542
  /// \param PostUpdate Expression that must be executed after exit from the
1543
  /// OpenMP region with this clause.
1544
  static OMPLastprivateClause *
1545
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
1546
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
1547
         ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps,
1548
         Stmt *PreInit, Expr *PostUpdate);
1549
1550
  /// Creates an empty clause with the place for \a N variables.
1551
  ///
1552
  /// \param C AST context.
1553
  /// \param N The number of variables.
1554
  static OMPLastprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
1555
1556
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
1557
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
1558
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
1559
  using helper_expr_const_range =
1560
      llvm::iterator_range<helper_expr_const_iterator>;
1561
1562
  /// Set list of helper expressions, required for generation of private
1563
  /// copies of original lastprivate variables.
1564
  void setPrivateCopies(ArrayRef<Expr *> PrivateCopies);
1565
1566
406
  helper_expr_const_range private_copies() const {
1567
406
    return helper_expr_const_range(getPrivateCopies().begin(),
1568
406
                                   getPrivateCopies().end());
1569
406
  }
1570
1571
318
  helper_expr_range private_copies() {
1572
318
    return helper_expr_range(getPrivateCopies().begin(),
1573
318
                             getPrivateCopies().end());
1574
318
  }
1575
1576
570
  helper_expr_const_range source_exprs() const {
1577
570
    return helper_expr_const_range(getSourceExprs().begin(),
1578
570
                                   getSourceExprs().end());
1579
570
  }
1580
1581
318
  helper_expr_range source_exprs() {
1582
318
    return helper_expr_range(getSourceExprs().begin(), getSourceExprs().end());
1583
318
  }
1584
1585
976
  helper_expr_const_range destination_exprs() const {
1586
976
    return helper_expr_const_range(getDestinationExprs().begin(),
1587
976
                                   getDestinationExprs().end());
1588
976
  }
1589
1590
318
  helper_expr_range destination_exprs() {
1591
318
    return helper_expr_range(getDestinationExprs().begin(),
1592
318
                             getDestinationExprs().end());
1593
318
  }
1594
1595
570
  helper_expr_const_range assignment_ops() const {
1596
570
    return helper_expr_const_range(getAssignmentOps().begin(),
1597
570
                                   getAssignmentOps().end());
1598
570
  }
1599
1600
318
  helper_expr_range assignment_ops() {
1601
318
    return helper_expr_range(getAssignmentOps().begin(),
1602
318
                             getAssignmentOps().end());
1603
318
  }
1604
1605
3.81k
  child_range children() {
1606
3.81k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1607
3.81k
                       reinterpret_cast<Stmt **>(varlist_end()));
1608
3.81k
  }
1609
1610
112k
  static bool classof(const OMPClause *T) {
1611
112k
    return T->getClauseKind() == OMPC_lastprivate;
1612
112k
  }
1613
};
1614
1615
/// This represents clause 'shared' in the '#pragma omp ...' directives.
1616
///
1617
/// \code
1618
/// #pragma omp parallel shared(a,b)
1619
/// \endcode
1620
/// In this example directive '#pragma omp parallel' has clause 'shared'
1621
/// with the variables 'a' and 'b'.
1622
class OMPSharedClause final
1623
    : public OMPVarListClause<OMPSharedClause>,
1624
      private llvm::TrailingObjects<OMPSharedClause, Expr *> {
1625
  friend OMPVarListClause;
1626
  friend TrailingObjects;
1627
1628
  /// Build clause with number of variables \a N.
1629
  ///
1630
  /// \param StartLoc Starting location of the clause.
1631
  /// \param LParenLoc Location of '('.
1632
  /// \param EndLoc Ending location of the clause.
1633
  /// \param N Number of the variables in the clause.
1634
  OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1635
                  SourceLocation EndLoc, unsigned N)
1636
      : OMPVarListClause<OMPSharedClause>(OMPC_shared, StartLoc, LParenLoc,
1637
2.03k
                                          EndLoc, N) {}
1638
1639
  /// Build an empty clause.
1640
  ///
1641
  /// \param N Number of variables.
1642
  explicit OMPSharedClause(unsigned N)
1643
      : OMPVarListClause<OMPSharedClause>(OMPC_shared, SourceLocation(),
1644
                                          SourceLocation(), SourceLocation(),
1645
156
                                          N) {}
1646
1647
public:
1648
  /// Creates clause with a list of variables \a VL.
1649
  ///
1650
  /// \param C AST context.
1651
  /// \param StartLoc Starting location of the clause.
1652
  /// \param LParenLoc Location of '('.
1653
  /// \param EndLoc Ending location of the clause.
1654
  /// \param VL List of references to the variables.
1655
  static OMPSharedClause *Create(const ASTContext &C, SourceLocation StartLoc,
1656
                                 SourceLocation LParenLoc,
1657
                                 SourceLocation EndLoc, ArrayRef<Expr *> VL);
1658
1659
  /// Creates an empty clause with \a N variables.
1660
  ///
1661
  /// \param C AST context.
1662
  /// \param N The number of variables.
1663
  static OMPSharedClause *CreateEmpty(const ASTContext &C, unsigned N);
1664
1665
366
  child_range children() {
1666
366
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1667
366
                       reinterpret_cast<Stmt **>(varlist_end()));
1668
366
  }
1669
1670
  static bool classof(const OMPClause *T) {
1671
    return T->getClauseKind() == OMPC_shared;
1672
  }
1673
};
1674
1675
/// This represents clause 'reduction' in the '#pragma omp ...'
1676
/// directives.
1677
///
1678
/// \code
1679
/// #pragma omp parallel reduction(+:a,b)
1680
/// \endcode
1681
/// In this example directive '#pragma omp parallel' has clause 'reduction'
1682
/// with operator '+' and the variables 'a' and 'b'.
1683
class OMPReductionClause final
1684
    : public OMPVarListClause<OMPReductionClause>,
1685
      public OMPClauseWithPostUpdate,
1686
      private llvm::TrailingObjects<OMPReductionClause, Expr *> {
1687
  friend class OMPClauseReader;
1688
  friend OMPVarListClause;
1689
  friend TrailingObjects;
1690
1691
  /// Location of ':'.
1692
  SourceLocation ColonLoc;
1693
1694
  /// Nested name specifier for C++.
1695
  NestedNameSpecifierLoc QualifierLoc;
1696
1697
  /// Name of custom operator.
1698
  DeclarationNameInfo NameInfo;
1699
1700
  /// Build clause with number of variables \a N.
1701
  ///
1702
  /// \param StartLoc Starting location of the clause.
1703
  /// \param LParenLoc Location of '('.
1704
  /// \param EndLoc Ending location of the clause.
1705
  /// \param ColonLoc Location of ':'.
1706
  /// \param N Number of the variables in the clause.
1707
  /// \param QualifierLoc The nested-name qualifier with location information
1708
  /// \param NameInfo The full name info for reduction identifier.
1709
  OMPReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1710
                     SourceLocation ColonLoc, SourceLocation EndLoc, unsigned N,
1711
                     NestedNameSpecifierLoc QualifierLoc,
1712
                     const DeclarationNameInfo &NameInfo)
1713
      : OMPVarListClause<OMPReductionClause>(OMPC_reduction, StartLoc,
1714
                                             LParenLoc, EndLoc, N),
1715
        OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
1716
10.6k
        QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1717
1718
  /// Build an empty clause.
1719
  ///
1720
  /// \param N Number of variables.
1721
  explicit OMPReductionClause(unsigned N)
1722
      : OMPVarListClause<OMPReductionClause>(OMPC_reduction, SourceLocation(),
1723
                                             SourceLocation(), SourceLocation(),
1724
                                             N),
1725
572
        OMPClauseWithPostUpdate(this) {}
1726
1727
  /// Sets location of ':' symbol in clause.
1728
572
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
1729
1730
  /// Sets the name info for specified reduction identifier.
1731
572
  void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
1732
1733
  /// Sets the nested name specifier.
1734
572
  void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
1735
1736
  /// Set list of helper expressions, required for proper codegen of the
1737
  /// clause. These expressions represent private copy of the reduction
1738
  /// variable.
1739
  void setPrivates(ArrayRef<Expr *> Privates);
1740
1741
  /// Get the list of helper privates.
1742
53.6k
  MutableArrayRef<Expr *> getPrivates() {
1743
53.6k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1744
53.6k
  }
1745
14.1k
  ArrayRef<const Expr *> getPrivates() const {
1746
14.1k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
1747
14.1k
  }
1748
1749
  /// Set list of helper expressions, required for proper codegen of the
1750
  /// clause. These expressions represent LHS expression in the final
1751
  /// reduction expression performed by the reduction clause.
1752
  void setLHSExprs(ArrayRef<Expr *> LHSExprs);
1753
1754
  /// Get the list of helper LHS expressions.
1755
41.2k
  MutableArrayRef<Expr *> getLHSExprs() {
1756
41.2k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
1757
41.2k
  }
1758
10.6k
  ArrayRef<const Expr *> getLHSExprs() const {
1759
10.6k
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
1760
10.6k
  }
1761
1762
  /// Set list of helper expressions, required for proper codegen of the
1763
  /// clause. These expressions represent RHS expression in the final
1764
  /// reduction expression performed by the reduction clause.
1765
  /// Also, variables in these expressions are used for proper initialization of
1766
  /// reduction copies.
1767
  void setRHSExprs(ArrayRef<Expr *> RHSExprs);
1768
1769
  /// Get the list of helper destination expressions.
1770
28.8k
  MutableArrayRef<Expr *> getRHSExprs() {
1771
28.8k
    return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
1772
28.8k
  }
1773
7.08k
  ArrayRef<const Expr *> getRHSExprs() const {
1774
7.08k
    return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
1775
7.08k
  }
1776
1777
  /// Set list of helper reduction expressions, required for proper
1778
  /// codegen of the clause. These expressions are binary expressions or
1779
  /// operator/custom reduction call that calculates new value from source
1780
  /// helper expressions to destination helper expressions.
1781
  void setReductionOps(ArrayRef<Expr *> ReductionOps);
1782
1783
  /// Get the list of helper reduction expressions.
1784
16.4k
  MutableArrayRef<Expr *> getReductionOps() {
1785
16.4k
    return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
1786
16.4k
  }
1787
3.54k
  ArrayRef<const Expr *> getReductionOps() const {
1788
3.54k
    return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
1789
3.54k
  }
1790
1791
public:
1792
  /// Creates clause with a list of variables \a VL.
1793
  ///
1794
  /// \param StartLoc Starting location of the clause.
1795
  /// \param LParenLoc Location of '('.
1796
  /// \param ColonLoc Location of ':'.
1797
  /// \param EndLoc Ending location of the clause.
1798
  /// \param VL The variables in the clause.
1799
  /// \param QualifierLoc The nested-name qualifier with location information
1800
  /// \param NameInfo The full name info for reduction identifier.
1801
  /// \param Privates List of helper expressions for proper generation of
1802
  /// private copies.
1803
  /// \param LHSExprs List of helper expressions for proper generation of
1804
  /// assignment operation required for copyprivate clause. This list represents
1805
  /// LHSs of the reduction expressions.
1806
  /// \param RHSExprs List of helper expressions for proper generation of
1807
  /// assignment operation required for copyprivate clause. This list represents
1808
  /// RHSs of the reduction expressions.
1809
  /// Also, variables in these expressions are used for proper initialization of
1810
  /// reduction copies.
1811
  /// \param ReductionOps List of helper expressions that represents reduction
1812
  /// expressions:
1813
  /// \code
1814
  /// LHSExprs binop RHSExprs;
1815
  /// operator binop(LHSExpr, RHSExpr);
1816
  /// <CutomReduction>(LHSExpr, RHSExpr);
1817
  /// \endcode
1818
  /// Required for proper codegen of final reduction operation performed by the
1819
  /// reduction clause.
1820
  /// \param PreInit Statement that must be executed before entering the OpenMP
1821
  /// region with this clause.
1822
  /// \param PostUpdate Expression that must be executed after exit from the
1823
  /// OpenMP region with this clause.
1824
  static OMPReductionClause *
1825
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
1826
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
1827
         NestedNameSpecifierLoc QualifierLoc,
1828
         const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
1829
         ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
1830
         ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
1831
1832
  /// Creates an empty clause with the place for \a N variables.
1833
  ///
1834
  /// \param C AST context.
1835
  /// \param N The number of variables.
1836
  static OMPReductionClause *CreateEmpty(const ASTContext &C, unsigned N);
1837
1838
  /// Gets location of ':' symbol in clause.
1839
8.22k
  SourceLocation getColonLoc() const { return ColonLoc; }
1840
1841
  /// Gets the name info for specified reduction identifier.
1842
9.69k
  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
1843
1844
  /// Gets the nested name specifier.
1845
9.46k
  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
1846
1847
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
1848
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
1849
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
1850
  using helper_expr_const_range =
1851
      llvm::iterator_range<helper_expr_const_iterator>;
1852
1853
1.77k
  helper_expr_const_range privates() const {
1854
1.77k
    return helper_expr_const_range(getPrivates().begin(), getPrivates().end());
1855
1.77k
  }
1856
1857
590
  helper_expr_range privates() {
1858
590
    return helper_expr_range(getPrivates().begin(), getPrivates().end());
1859
590
  }
1860
1861
1.77k
  helper_expr_const_range lhs_exprs() const {
1862
1.77k
    return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end());
1863
1.77k
  }
1864
1865
590
  helper_expr_range lhs_exprs() {
1866
590
    return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end());
1867
590
  }
1868
1869
1.77k
  helper_expr_const_range rhs_exprs() const {
1870
1.77k
    return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end());
1871
1.77k
  }
1872
1873
590
  helper_expr_range rhs_exprs() {
1874
590
    return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end());
1875
590
  }
1876
1877
1.77k
  helper_expr_const_range reduction_ops() const {
1878
1.77k
    return helper_expr_const_range(getReductionOps().begin(),
1879
1.77k
                                   getReductionOps().end());
1880
1.77k
  }
1881
1882
8.22k
  helper_expr_range reduction_ops() {
1883
8.22k
    return helper_expr_range(getReductionOps().begin(),
1884
8.22k
                             getReductionOps().end());
1885
8.22k
  }
1886
1887
12.7k
  child_range children() {
1888
12.7k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
1889
12.7k
                       reinterpret_cast<Stmt **>(varlist_end()));
1890
12.7k
  }
1891
1892
38.4k
  static bool classof(const OMPClause *T) {
1893
38.4k
    return T->getClauseKind() == OMPC_reduction;
1894
38.4k
  }
1895
};
1896
1897
/// This represents clause 'task_reduction' in the '#pragma omp taskgroup'
1898
/// directives.
1899
///
1900
/// \code
1901
/// #pragma omp taskgroup task_reduction(+:a,b)
1902
/// \endcode
1903
/// In this example directive '#pragma omp taskgroup' has clause
1904
/// 'task_reduction' with operator '+' and the variables 'a' and 'b'.
1905
class OMPTaskReductionClause final
1906
    : public OMPVarListClause<OMPTaskReductionClause>,
1907
      public OMPClauseWithPostUpdate,
1908
      private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> {
1909
  friend class OMPClauseReader;
1910
  friend OMPVarListClause;
1911
  friend TrailingObjects;
1912
1913
  /// Location of ':'.
1914
  SourceLocation ColonLoc;
1915
1916
  /// Nested name specifier for C++.
1917
  NestedNameSpecifierLoc QualifierLoc;
1918
1919
  /// Name of custom operator.
1920
  DeclarationNameInfo NameInfo;
1921
1922
  /// Build clause with number of variables \a N.
1923
  ///
1924
  /// \param StartLoc Starting location of the clause.
1925
  /// \param LParenLoc Location of '('.
1926
  /// \param EndLoc Ending location of the clause.
1927
  /// \param ColonLoc Location of ':'.
1928
  /// \param N Number of the variables in the clause.
1929
  /// \param QualifierLoc The nested-name qualifier with location information
1930
  /// \param NameInfo The full name info for reduction identifier.
1931
  OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
1932
                         SourceLocation ColonLoc, SourceLocation EndLoc,
1933
                         unsigned N, NestedNameSpecifierLoc QualifierLoc,
1934
                         const DeclarationNameInfo &NameInfo)
1935
      : OMPVarListClause<OMPTaskReductionClause>(OMPC_task_reduction, StartLoc,
1936
                                                 LParenLoc, EndLoc, N),
1937
        OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
1938
1.41k
        QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1939
1940
  /// Build an empty clause.
1941
  ///
1942
  /// \param N Number of variables.
1943
  explicit OMPTaskReductionClause(unsigned N)
1944
      : OMPVarListClause<OMPTaskReductionClause>(
1945
            OMPC_task_reduction, SourceLocation(), SourceLocation(),
1946
            SourceLocation(), N),
1947
50
        OMPClauseWithPostUpdate(this) {}
1948
1949
  /// Sets location of ':' symbol in clause.
1950
50
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
1951
1952
  /// Sets the name info for specified reduction identifier.
1953
50
  void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
1954
1955
  /// Sets the nested name specifier.
1956
50
  void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
1957
1958
  /// Set list of helper expressions, required for proper codegen of the clause.
1959
  /// These expressions represent private copy of the reduction variable.
1960
  void setPrivates(ArrayRef<Expr *> Privates);
1961
1962
  /// Get the list of helper privates.
1963
6.41k
  MutableArrayRef<Expr *> getPrivates() {
1964
6.41k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1965
6.41k
  }
1966
480
  ArrayRef<const Expr *> getPrivates() const {
1967
480
    return llvm::makeArrayRef(varlist_end(), varlist_size());
1968
480
  }
1969
1970
  /// Set list of helper expressions, required for proper codegen of the clause.
1971
  /// These expressions represent LHS expression in the final reduction
1972
  /// expression performed by the reduction clause.
1973
  void setLHSExprs(ArrayRef<Expr *> LHSExprs);
1974
1975
  /// Get the list of helper LHS expressions.
1976
4.84k
  MutableArrayRef<Expr *> getLHSExprs() {
1977
4.84k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
1978
4.84k
  }
1979
360
  ArrayRef<const Expr *> getLHSExprs() const {
1980
360
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
1981
360
  }
1982
1983
  /// Set list of helper expressions, required for proper codegen of the clause.
1984
  /// These expressions represent RHS expression in the final reduction
1985
  /// expression performed by the reduction clause. Also, variables in these
1986
  /// expressions are used for proper initialization of reduction copies.
1987
  void setRHSExprs(ArrayRef<Expr *> RHSExprs);
1988
1989
  ///  Get the list of helper destination expressions.
1990
3.27k
  MutableArrayRef<Expr *> getRHSExprs() {
1991
3.27k
    return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
1992
3.27k
  }
1993
240
  ArrayRef<const Expr *> getRHSExprs() const {
1994
240
    return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
1995
240
  }
1996
1997
  /// Set list of helper reduction expressions, required for proper
1998
  /// codegen of the clause. These expressions are binary expressions or
1999
  /// operator/custom reduction call that calculates new value from source
2000
  /// helper expressions to destination helper expressions.
2001
  void setReductionOps(ArrayRef<Expr *> ReductionOps);
2002
2003
  ///  Get the list of helper reduction expressions.
2004
1.70k
  MutableArrayRef<Expr *> getReductionOps() {
2005
1.70k
    return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
2006
1.70k
  }
2007
120
  ArrayRef<const Expr *> getReductionOps() const {
2008
120
    return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2009
120
  }
2010
2011
public:
2012
  /// Creates clause with a list of variables \a VL.
2013
  ///
2014
  /// \param StartLoc Starting location of the clause.
2015
  /// \param LParenLoc Location of '('.
2016
  /// \param ColonLoc Location of ':'.
2017
  /// \param EndLoc Ending location of the clause.
2018
  /// \param VL The variables in the clause.
2019
  /// \param QualifierLoc The nested-name qualifier with location information
2020
  /// \param NameInfo The full name info for reduction identifier.
2021
  /// \param Privates List of helper expressions for proper generation of
2022
  /// private copies.
2023
  /// \param LHSExprs List of helper expressions for proper generation of
2024
  /// assignment operation required for copyprivate clause. This list represents
2025
  /// LHSs of the reduction expressions.
2026
  /// \param RHSExprs List of helper expressions for proper generation of
2027
  /// assignment operation required for copyprivate clause. This list represents
2028
  /// RHSs of the reduction expressions.
2029
  /// Also, variables in these expressions are used for proper initialization of
2030
  /// reduction copies.
2031
  /// \param ReductionOps List of helper expressions that represents reduction
2032
  /// expressions:
2033
  /// \code
2034
  /// LHSExprs binop RHSExprs;
2035
  /// operator binop(LHSExpr, RHSExpr);
2036
  /// <CutomReduction>(LHSExpr, RHSExpr);
2037
  /// \endcode
2038
  /// Required for proper codegen of final reduction operation performed by the
2039
  /// reduction clause.
2040
  /// \param PreInit Statement that must be executed before entering the OpenMP
2041
  /// region with this clause.
2042
  /// \param PostUpdate Expression that must be executed after exit from the
2043
  /// OpenMP region with this clause.
2044
  static OMPTaskReductionClause *
2045
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2046
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
2047
         NestedNameSpecifierLoc QualifierLoc,
2048
         const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
2049
         ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
2050
         ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate);
2051
2052
  /// Creates an empty clause with the place for \a N variables.
2053
  ///
2054
  /// \param C AST context.
2055
  /// \param N The number of variables.
2056
  static OMPTaskReductionClause *CreateEmpty(const ASTContext &C, unsigned N);
2057
2058
  /// Gets location of ':' symbol in clause.
2059
854
  SourceLocation getColonLoc() const { return ColonLoc; }
2060
2061
  /// Gets the name info for specified reduction identifier.
2062
1.01k
  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
2063
2064
  /// Gets the nested name specifier.
2065
1.00k
  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
2066
2067
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
2068
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
2069
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
2070
  using helper_expr_const_range =
2071
      llvm::iterator_range<helper_expr_const_iterator>;
2072
2073
60
  helper_expr_const_range privates() const {
2074
60
    return helper_expr_const_range(getPrivates().begin(), getPrivates().end());
2075
60
  }
2076
2077
50
  helper_expr_range privates() {
2078
50
    return helper_expr_range(getPrivates().begin(), getPrivates().end());
2079
50
  }
2080
2081
60
  helper_expr_const_range lhs_exprs() const {
2082
60
    return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end());
2083
60
  }
2084
2085
50
  helper_expr_range lhs_exprs() {
2086
50
    return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end());
2087
50
  }
2088
2089
60
  helper_expr_const_range rhs_exprs() const {
2090
60
    return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end());
2091
60
  }
2092
2093
50
  helper_expr_range rhs_exprs() {
2094
50
    return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end());
2095
50
  }
2096
2097
60
  helper_expr_const_range reduction_ops() const {
2098
60
    return helper_expr_const_range(getReductionOps().begin(),
2099
60
                                   getReductionOps().end());
2100
60
  }
2101
2102
854
  helper_expr_range reduction_ops() {
2103
854
    return helper_expr_range(getReductionOps().begin(),
2104
854
                             getReductionOps().end());
2105
854
  }
2106
2107
1.33k
  child_range children() {
2108
1.33k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2109
1.33k
                       reinterpret_cast<Stmt **>(varlist_end()));
2110
1.33k
  }
2111
2112
18
  static bool classof(const OMPClause *T) {
2113
18
    return T->getClauseKind() == OMPC_task_reduction;
2114
18
  }
2115
};
2116
2117
/// This represents clause 'in_reduction' in the '#pragma omp task' directives.
2118
///
2119
/// \code
2120
/// #pragma omp task in_reduction(+:a,b)
2121
/// \endcode
2122
/// In this example directive '#pragma omp task' has clause 'in_reduction' with
2123
/// operator '+' and the variables 'a' and 'b'.
2124
class OMPInReductionClause final
2125
    : public OMPVarListClause<OMPInReductionClause>,
2126
      public OMPClauseWithPostUpdate,
2127
      private llvm::TrailingObjects<OMPInReductionClause, Expr *> {
2128
  friend class OMPClauseReader;
2129
  friend OMPVarListClause;
2130
  friend TrailingObjects;
2131
2132
  /// Location of ':'.
2133
  SourceLocation ColonLoc;
2134
2135
  /// Nested name specifier for C++.
2136
  NestedNameSpecifierLoc QualifierLoc;
2137
2138
  /// Name of custom operator.
2139
  DeclarationNameInfo NameInfo;
2140
2141
  /// Build clause with number of variables \a N.
2142
  ///
2143
  /// \param StartLoc Starting location of the clause.
2144
  /// \param LParenLoc Location of '('.
2145
  /// \param EndLoc Ending location of the clause.
2146
  /// \param ColonLoc Location of ':'.
2147
  /// \param N Number of the variables in the clause.
2148
  /// \param QualifierLoc The nested-name qualifier with location information
2149
  /// \param NameInfo The full name info for reduction identifier.
2150
  OMPInReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2151
                       SourceLocation ColonLoc, SourceLocation EndLoc,
2152
                       unsigned N, NestedNameSpecifierLoc QualifierLoc,
2153
                       const DeclarationNameInfo &NameInfo)
2154
      : OMPVarListClause<OMPInReductionClause>(OMPC_in_reduction, StartLoc,
2155
                                               LParenLoc, EndLoc, N),
2156
        OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc),
2157
834
        QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
2158
2159
  /// Build an empty clause.
2160
  ///
2161
  /// \param N Number of variables.
2162
  explicit OMPInReductionClause(unsigned N)
2163
      : OMPVarListClause<OMPInReductionClause>(
2164
            OMPC_in_reduction, SourceLocation(), SourceLocation(),
2165
            SourceLocation(), N),
2166
28
        OMPClauseWithPostUpdate(this) {}
2167
2168
  /// Sets location of ':' symbol in clause.
2169
28
  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
2170
2171
  /// Sets the name info for specified reduction identifier.
2172
28
  void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
2173
2174
  /// Sets the nested name specifier.
2175
28
  void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
2176
2177
  /// Set list of helper expressions, required for proper codegen of the clause.
2178
  /// These expressions represent private copy of the reduction variable.
2179
  void setPrivates(ArrayRef<Expr *> Privates);
2180
2181
  /// Get the list of helper privates.
2182
7.65k
  MutableArrayRef<Expr *> getPrivates() {
2183
7.65k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2184
7.65k
  }
2185
72
  ArrayRef<const Expr *> getPrivates() const {
2186
72
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2187
72
  }
2188
2189
  /// Set list of helper expressions, required for proper codegen of the clause.
2190
  /// These expressions represent LHS expression in the final reduction
2191
  /// expression performed by the reduction clause.
2192
  void setLHSExprs(ArrayRef<Expr *> LHSExprs);
2193
2194
  /// Get the list of helper LHS expressions.
2195
6.73k
  MutableArrayRef<Expr *> getLHSExprs() {
2196
6.73k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
2197
6.73k
  }
2198
48
  ArrayRef<const Expr *> getLHSExprs() const {
2199
48
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
2200
48
  }
2201
2202
  /// Set list of helper expressions, required for proper codegen of the clause.
2203
  /// These expressions represent RHS expression in the final reduction
2204
  /// expression performed by the reduction clause. Also, variables in these
2205
  /// expressions are used for proper initialization of reduction copies.
2206
  void setRHSExprs(ArrayRef<Expr *> RHSExprs);
2207
2208
  ///  Get the list of helper destination expressions.
2209
5.81k
  MutableArrayRef<Expr *> getRHSExprs() {
2210
5.81k
    return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size());
2211
5.81k
  }
2212
48
  ArrayRef<const Expr *> getRHSExprs() const {
2213
48
    return llvm::makeArrayRef(getLHSExprs().end(), varlist_size());
2214
48
  }
2215
2216
  /// Set list of helper reduction expressions, required for proper
2217
  /// codegen of the clause. These expressions are binary expressions or
2218
  /// operator/custom reduction call that calculates new value from source
2219
  /// helper expressions to destination helper expressions.
2220
  void setReductionOps(ArrayRef<Expr *> ReductionOps);
2221
2222
  ///  Get the list of helper reduction expressions.
2223
4.89k
  MutableArrayRef<Expr *> getReductionOps() {
2224
4.89k
    return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size());
2225
4.89k
  }
2226
48
  ArrayRef<const Expr *> getReductionOps() const {
2227
48
    return llvm::makeArrayRef(getRHSExprs().end(), varlist_size());
2228
48
  }
2229
2230
  /// Set list of helper reduction taskgroup descriptors.
2231
  void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps);
2232
2233
  ///  Get the list of helper reduction taskgroup descriptors.
2234
2.65k
  MutableArrayRef<Expr *> getTaskgroupDescriptors() {
2235
2.65k
    return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size());
2236
2.65k
  }
2237
24
  ArrayRef<const Expr *> getTaskgroupDescriptors() const {
2238
24
    return llvm::makeArrayRef(getReductionOps().end(), varlist_size());
2239
24
  }
2240
2241
public:
2242
  /// Creates clause with a list of variables \a VL.
2243
  ///
2244
  /// \param StartLoc Starting location of the clause.
2245
  /// \param LParenLoc Location of '('.
2246
  /// \param ColonLoc Location of ':'.
2247
  /// \param EndLoc Ending location of the clause.
2248
  /// \param VL The variables in the clause.
2249
  /// \param QualifierLoc The nested-name qualifier with location information
2250
  /// \param NameInfo The full name info for reduction identifier.
2251
  /// \param Privates List of helper expressions for proper generation of
2252
  /// private copies.
2253
  /// \param LHSExprs List of helper expressions for proper generation of
2254
  /// assignment operation required for copyprivate clause. This list represents
2255
  /// LHSs of the reduction expressions.
2256
  /// \param RHSExprs List of helper expressions for proper generation of
2257
  /// assignment operation required for copyprivate clause. This list represents
2258
  /// RHSs of the reduction expressions.
2259
  /// Also, variables in these expressions are used for proper initialization of
2260
  /// reduction copies.
2261
  /// \param ReductionOps List of helper expressions that represents reduction
2262
  /// expressions:
2263
  /// \code
2264
  /// LHSExprs binop RHSExprs;
2265
  /// operator binop(LHSExpr, RHSExpr);
2266
  /// <CutomReduction>(LHSExpr, RHSExpr);
2267
  /// \endcode
2268
  /// Required for proper codegen of final reduction operation performed by the
2269
  /// reduction clause.
2270
  /// \param TaskgroupDescriptors List of helper taskgroup descriptors for
2271
  /// corresponding items in parent taskgroup task_reduction clause.
2272
  /// \param PreInit Statement that must be executed before entering the OpenMP
2273
  /// region with this clause.
2274
  /// \param PostUpdate Expression that must be executed after exit from the
2275
  /// OpenMP region with this clause.
2276
  static OMPInReductionClause *
2277
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2278
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
2279
         NestedNameSpecifierLoc QualifierLoc,
2280
         const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates,
2281
         ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs,
2282
         ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors,
2283
         Stmt *PreInit, Expr *PostUpdate);
2284
2285
  /// Creates an empty clause with the place for \a N variables.
2286
  ///
2287
  /// \param C AST context.
2288
  /// \param N The number of variables.
2289
  static OMPInReductionClause *CreateEmpty(const ASTContext &C, unsigned N);
2290
2291
  /// Gets location of ':' symbol in clause.
2292
692
  SourceLocation getColonLoc() const { return ColonLoc; }
2293
2294
  /// Gets the name info for specified reduction identifier.
2295
760
  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
2296
2297
  /// Gets the nested name specifier.
2298
752
  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
2299
2300
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
2301
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
2302
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
2303
  using helper_expr_const_range =
2304
      llvm::iterator_range<helper_expr_const_iterator>;
2305
2306
12
  helper_expr_const_range privates() const {
2307
12
    return helper_expr_const_range(getPrivates().begin(), getPrivates().end());
2308
12
  }
2309
2310
28
  helper_expr_range privates() {
2311
28
    return helper_expr_range(getPrivates().begin(), getPrivates().end());
2312
28
  }
2313
2314
0
  helper_expr_const_range lhs_exprs() const {
2315
0
    return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end());
2316
0
  }
2317
2318
28
  helper_expr_range lhs_exprs() {
2319
28
    return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end());
2320
28
  }
2321
2322
0
  helper_expr_const_range rhs_exprs() const {
2323
0
    return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end());
2324
0
  }
2325
2326
28
  helper_expr_range rhs_exprs() {
2327
28
    return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end());
2328
28
  }
2329
2330
12
  helper_expr_const_range reduction_ops() const {
2331
12
    return helper_expr_const_range(getReductionOps().begin(),
2332
12
                                   getReductionOps().end());
2333
12
  }
2334
2335
692
  helper_expr_range reduction_ops() {
2336
692
    return helper_expr_range(getReductionOps().begin(),
2337
692
                             getReductionOps().end());
2338
692
  }
2339
2340
12
  helper_expr_const_range taskgroup_descriptors() const {
2341
12
    return helper_expr_const_range(getTaskgroupDescriptors().begin(),
2342
12
                                   getTaskgroupDescriptors().end());
2343
12
  }
2344
2345
1.32k
  helper_expr_range taskgroup_descriptors() {
2346
1.32k
    return helper_expr_range(getTaskgroupDescriptors().begin(),
2347
1.32k
                             getTaskgroupDescriptors().end());
2348
1.32k
  }
2349
2350
1.26k
  child_range children() {
2351
1.26k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2352
1.26k
                       reinterpret_cast<Stmt **>(varlist_end()));
2353
1.26k
  }
2354
2355
51.0k
  static bool classof(const OMPClause *T) {
2356
51.0k
    return T->getClauseKind() == OMPC_in_reduction;
2357
51.0k
  }
2358
};
2359
2360
/// This represents clause 'linear' in the '#pragma omp ...'
2361
/// directives.
2362
///
2363
/// \code
2364
/// #pragma omp simd linear(a,b : 2)
2365
/// \endcode
2366
/// In this example directive '#pragma omp simd' has clause 'linear'
2367
/// with variables 'a', 'b' and linear step '2'.
2368
class OMPLinearClause final
2369
    : public OMPVarListClause<OMPLinearClause>,
2370
      public OMPClauseWithPostUpdate,
2371
      private llvm::TrailingObjects<OMPLinearClause, Expr *> {
2372
  friend class OMPClauseReader;
2373
  friend OMPVarListClause;
2374
  friend TrailingObjects;
2375
2376
  /// Modifier of 'linear' clause.
2377
  OpenMPLinearClauseKind Modifier = OMPC_LINEAR_val;
2378
2379
  /// Location of linear modifier if any.
2380
  SourceLocation ModifierLoc;
2381
2382
  /// Location of ':'.
2383
  SourceLocation ColonLoc;
2384
2385
  /// Sets the linear step for clause.
2386
2.05k
  void setStep(Expr *Step) { *(getFinals().end()) = Step; }
2387
2388
  /// Sets the expression to calculate linear step for clause.
2389
2.05k
  void setCalcStep(Expr *CalcStep) { *(getFinals().end() + 1) = CalcStep; }
2390
2391
  /// Build 'linear' clause with given number of variables \a NumVars.
2392
  ///
2393
  /// \param StartLoc Starting location of the clause.
2394
  /// \param LParenLoc Location of '('.
2395
  /// \param ColonLoc Location of ':'.
2396
  /// \param EndLoc Ending location of the clause.
2397
  /// \param NumVars Number of variables.
2398
  OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2399
                  OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
2400
                  SourceLocation ColonLoc, SourceLocation EndLoc,
2401
                  unsigned NumVars)
2402
      : OMPVarListClause<OMPLinearClause>(OMPC_linear, StartLoc, LParenLoc,
2403
                                          EndLoc, NumVars),
2404
        OMPClauseWithPostUpdate(this), Modifier(Modifier),
2405
1.84k
        ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {}
2406
2407
  /// Build an empty clause.
2408
  ///
2409
  /// \param NumVars Number of variables.
2410
  explicit OMPLinearClause(unsigned NumVars)
2411
      : OMPVarListClause<OMPLinearClause>(OMPC_linear, SourceLocation(),
2412
                                          SourceLocation(), SourceLocation(),
2413
                                          NumVars),
2414
216
        OMPClauseWithPostUpdate(this) {}
2415
2416
  /// Gets the list of initial values for linear variables.
2417
  ///
2418
  /// There are NumVars expressions with initial values allocated after the
2419
  /// varlist, they are followed by NumVars update expressions (used to update
2420
  /// the linear variable's value on current iteration) and they are followed by
2421
  /// NumVars final expressions (used to calculate the linear variable's
2422
  /// value after the loop body). After these lists, there are 2 helper
2423
  /// expressions - linear step and a helper to calculate it before the
2424
  /// loop body (used when the linear step is not constant):
2425
  ///
2426
  /// { Vars[] /* in OMPVarListClause */; Privates[]; Inits[]; Updates[];
2427
  /// Finals[]; Step; CalcStep; }
2428
27.6k
  MutableArrayRef<Expr *> getPrivates() {
2429
27.6k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2430
27.6k
  }
2431
4.60k
  ArrayRef<const Expr *> getPrivates() const {
2432
4.60k
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2433
4.60k
  }
2434
2435
22.4k
  MutableArrayRef<Expr *> getInits() {
2436
22.4k
    return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size());
2437
22.4k
  }
2438
3.61k
  ArrayRef<const Expr *> getInits() const {
2439
3.61k
    return llvm::makeArrayRef(getPrivates().end(), varlist_size());
2440
3.61k
  }
2441
2442
  /// Sets the list of update expressions for linear variables.
2443
14.0k
  MutableArrayRef<Expr *> getUpdates() {
2444
14.0k
    return MutableArrayRef<Expr *>(getInits().end(), varlist_size());
2445
14.0k
  }
2446
2.62k
  ArrayRef<const Expr *> getUpdates() const {
2447
2.62k
    return llvm::makeArrayRef(getInits().end(), varlist_size());
2448
2.62k
  }
2449
2450
  /// Sets the list of final update expressions for linear variables.
2451
8.39k
  MutableArrayRef<Expr *> getFinals() {
2452
8.39k
    return MutableArrayRef<Expr *>(getUpdates().end(), varlist_size());
2453
8.39k
  }
2454
1.79k
  ArrayRef<const Expr *> getFinals() const {
2455
1.79k
    return llvm::makeArrayRef(getUpdates().end(), varlist_size());
2456
1.79k
  }
2457
2458
  /// Sets the list of the copies of original linear variables.
2459
  /// \param PL List of expressions.
2460
  void setPrivates(ArrayRef<Expr *> PL);
2461
2462
  /// Sets the list of the initial values for linear variables.
2463
  /// \param IL List of expressions.
2464
  void setInits(ArrayRef<Expr *> IL);
2465
2466
public:
2467
  /// Creates clause with a list of variables \a VL and a linear step
2468
  /// \a Step.
2469
  ///
2470
  /// \param C AST Context.
2471
  /// \param StartLoc Starting location of the clause.
2472
  /// \param LParenLoc Location of '('.
2473
  /// \param Modifier Modifier of 'linear' clause.
2474
  /// \param ModifierLoc Modifier location.
2475
  /// \param ColonLoc Location of ':'.
2476
  /// \param EndLoc Ending location of the clause.
2477
  /// \param VL List of references to the variables.
2478
  /// \param PL List of private copies of original variables.
2479
  /// \param IL List of initial values for the variables.
2480
  /// \param Step Linear step.
2481
  /// \param CalcStep Calculation of the linear step.
2482
  /// \param PreInit Statement that must be executed before entering the OpenMP
2483
  /// region with this clause.
2484
  /// \param PostUpdate Expression that must be executed after exit from the
2485
  /// OpenMP region with this clause.
2486
  static OMPLinearClause *
2487
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2488
         OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc,
2489
         SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
2490
         ArrayRef<Expr *> PL, ArrayRef<Expr *> IL, Expr *Step, Expr *CalcStep,
2491
         Stmt *PreInit, Expr *PostUpdate);
2492
2493
  /// Creates an empty clause with the place for \a NumVars variables.
2494
  ///
2495
  /// \param C AST context.
2496
  /// \param NumVars Number of variables.
2497
  static OMPLinearClause *CreateEmpty(const ASTContext &C, unsigned NumVars);
2498
2499
  /// Set modifier.
2500
216
  void setModifier(OpenMPLinearClauseKind Kind) { Modifier = Kind; }
2501
2502
  /// Return modifier.
2503
2.01k
  OpenMPLinearClauseKind getModifier() const { return Modifier; }
2504
2505
  /// Set modifier location.
2506
216
  void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; }
2507
2508
  /// Return modifier location.
2509
1.09k
  SourceLocation getModifierLoc() const { return ModifierLoc; }
2510
2511
  /// Sets the location of ':'.
2512
216
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
2513
2514
  /// Returns the location of ':'.
2515
642
  SourceLocation getColonLoc() const { return ColonLoc; }
2516
2517
  /// Returns linear step.
2518
2.29k
  Expr *getStep() { return *(getFinals().end()); }
2519
2520
  /// Returns linear step.
2521
272
  const Expr *getStep() const { return *(getFinals().end()); }
2522
2523
  /// Returns expression to calculate linear step.
2524
1.56k
  Expr *getCalcStep() { return *(getFinals().end() + 1); }
2525
2526
  /// Returns expression to calculate linear step.
2527
532
  const Expr *getCalcStep() const { return *(getFinals().end() + 1); }
2528
2529
  /// Sets the list of update expressions for linear variables.
2530
  /// \param UL List of expressions.
2531
  void setUpdates(ArrayRef<Expr *> UL);
2532
2533
  /// Sets the list of final update expressions for linear variables.
2534
  /// \param FL List of expressions.
2535
  void setFinals(ArrayRef<Expr *> FL);
2536
2537
  using privates_iterator = MutableArrayRef<Expr *>::iterator;
2538
  using privates_const_iterator = ArrayRef<const Expr *>::iterator;
2539
  using privates_range = llvm::iterator_range<privates_iterator>;
2540
  using privates_const_range = llvm::iterator_range<privates_const_iterator>;
2541
2542
1.56k
  privates_range privates() {
2543
1.56k
    return privates_range(getPrivates().begin(), getPrivates().end());
2544
1.56k
  }
2545
2546
494
  privates_const_range privates() const {
2547
494
    return privates_const_range(getPrivates().begin(), getPrivates().end());
2548
494
  }
2549
2550
  using inits_iterator = MutableArrayRef<Expr *>::iterator;
2551
  using inits_const_iterator = ArrayRef<const Expr *>::iterator;
2552
  using inits_range = llvm::iterator_range<inits_iterator>;
2553
  using inits_const_range = llvm::iterator_range<inits_const_iterator>;
2554
2555
1.56k
  inits_range inits() {
2556
1.56k
    return inits_range(getInits().begin(), getInits().end());
2557
1.56k
  }
2558
2559
494
  inits_const_range inits() const {
2560
494
    return inits_const_range(getInits().begin(), getInits().end());
2561
494
  }
2562
2563
  using updates_iterator = MutableArrayRef<Expr *>::iterator;
2564
  using updates_const_iterator = ArrayRef<const Expr *>::iterator;
2565
  using updates_range = llvm::iterator_range<updates_iterator>;
2566
  using updates_const_range = llvm::iterator_range<updates_const_iterator>;
2567
2568
216
  updates_range updates() {
2569
216
    return updates_range(getUpdates().begin(), getUpdates().end());
2570
216
  }
2571
2572
418
  updates_const_range updates() const {
2573
418
    return updates_const_range(getUpdates().begin(), getUpdates().end());
2574
418
  }
2575
2576
  using finals_iterator = MutableArrayRef<Expr *>::iterator;
2577
  using finals_const_iterator = ArrayRef<const Expr *>::iterator;
2578
  using finals_range = llvm::iterator_range<finals_iterator>;
2579
  using finals_const_range = llvm::iterator_range<finals_const_iterator>;
2580
2581
216
  finals_range finals() {
2582
216
    return finals_range(getFinals().begin(), getFinals().end());
2583
216
  }
2584
2585
494
  finals_const_range finals() const {
2586
494
    return finals_const_range(getFinals().begin(), getFinals().end());
2587
494
  }
2588
2589
1.99k
  child_range children() {
2590
1.99k
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2591
1.99k
                       reinterpret_cast<Stmt **>(varlist_end()));
2592
1.99k
  }
2593
2594
61.1k
  static bool classof(const OMPClause *T) {
2595
61.1k
    return T->getClauseKind() == OMPC_linear;
2596
61.1k
  }
2597
};
2598
2599
/// This represents clause 'aligned' in the '#pragma omp ...'
2600
/// directives.
2601
///
2602
/// \code
2603
/// #pragma omp simd aligned(a,b : 8)
2604
/// \endcode
2605
/// In this example directive '#pragma omp simd' has clause 'aligned'
2606
/// with variables 'a', 'b' and alignment '8'.
2607
class OMPAlignedClause final
2608
    : public OMPVarListClause<OMPAlignedClause>,
2609
      private llvm::TrailingObjects<OMPAlignedClause, Expr *> {
2610
  friend class OMPClauseReader;
2611
  friend OMPVarListClause;
2612
  friend TrailingObjects;
2613
2614
  /// Location of ':'.
2615
  SourceLocation ColonLoc;
2616
2617
  /// Sets the alignment for clause.
2618
1.27k
  void setAlignment(Expr *A) { *varlist_end() = A; }
2619
2620
  /// Build 'aligned' clause with given number of variables \a NumVars.
2621
  ///
2622
  /// \param StartLoc Starting location of the clause.
2623
  /// \param LParenLoc Location of '('.
2624
  /// \param ColonLoc Location of ':'.
2625
  /// \param EndLoc Ending location of the clause.
2626
  /// \param NumVars Number of variables.
2627
  OMPAlignedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2628
                   SourceLocation ColonLoc, SourceLocation EndLoc,
2629
                   unsigned NumVars)
2630
      : OMPVarListClause<OMPAlignedClause>(OMPC_aligned, StartLoc, LParenLoc,
2631
                                           EndLoc, NumVars),
2632
1.14k
        ColonLoc(ColonLoc) {}
2633
2634
  /// Build an empty clause.
2635
  ///
2636
  /// \param NumVars Number of variables.
2637
  explicit OMPAlignedClause(unsigned NumVars)
2638
      : OMPVarListClause<OMPAlignedClause>(OMPC_aligned, SourceLocation(),
2639
                                           SourceLocation(), SourceLocation(),
2640
132
                                           NumVars) {}
2641
2642
public:
2643
  /// Creates clause with a list of variables \a VL and alignment \a A.
2644
  ///
2645
  /// \param C AST Context.
2646
  /// \param StartLoc Starting location of the clause.
2647
  /// \param LParenLoc Location of '('.
2648
  /// \param ColonLoc Location of ':'.
2649
  /// \param EndLoc Ending location of the clause.
2650
  /// \param VL List of references to the variables.
2651
  /// \param A Alignment.
2652
  static OMPAlignedClause *Create(const ASTContext &C, SourceLocation StartLoc,
2653
                                  SourceLocation LParenLoc,
2654
                                  SourceLocation ColonLoc,
2655
                                  SourceLocation EndLoc, ArrayRef<Expr *> VL,
2656
                                  Expr *A);
2657
2658
  /// Creates an empty clause with the place for \a NumVars variables.
2659
  ///
2660
  /// \param C AST context.
2661
  /// \param NumVars Number of variables.
2662
  static OMPAlignedClause *CreateEmpty(const ASTContext &C, unsigned NumVars);
2663
2664
  /// Sets the location of ':'.
2665
132
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
2666
2667
  /// Returns the location of ':'.
2668
472
  SourceLocation getColonLoc() const { return ColonLoc; }
2669
2670
  /// Returns alignment.
2671
816
  Expr *getAlignment() { return *varlist_end(); }
2672
2673
  /// Returns alignment.
2674
370
  const Expr *getAlignment() const { return *varlist_end(); }
2675
2676
264
  child_range children() {
2677
264
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2678
264
                       reinterpret_cast<Stmt **>(varlist_end()));
2679
264
  }
2680
2681
11.1k
  static bool classof(const OMPClause *T) {
2682
11.1k
    return T->getClauseKind() == OMPC_aligned;
2683
11.1k
  }
2684
};
2685
2686
/// This represents clause 'copyin' in the '#pragma omp ...' directives.
2687
///
2688
/// \code
2689
/// #pragma omp parallel copyin(a,b)
2690
/// \endcode
2691
/// In this example directive '#pragma omp parallel' has clause 'copyin'
2692
/// with the variables 'a' and 'b'.
2693
class OMPCopyinClause final
2694
    : public OMPVarListClause<OMPCopyinClause>,
2695
      private llvm::TrailingObjects<OMPCopyinClause, Expr *> {
2696
  // Class has 3 additional tail allocated arrays:
2697
  // 1. List of helper expressions for proper generation of assignment operation
2698
  // required for copyin clause. This list represents sources.
2699
  // 2. List of helper expressions for proper generation of assignment operation
2700
  // required for copyin clause. This list represents destinations.
2701
  // 3. List of helper expressions that represents assignment operation:
2702
  // \code
2703
  // DstExprs = SrcExprs;
2704
  // \endcode
2705
  // Required for proper codegen of propagation of master's thread values of
2706
  // threadprivate variables to local instances of that variables in other
2707
  // implicit threads.
2708
2709
  friend class OMPClauseReader;
2710
  friend OMPVarListClause;
2711
  friend TrailingObjects;
2712
2713
  /// Build clause with number of variables \a N.
2714
  ///
2715
  /// \param StartLoc Starting location of the clause.
2716
  /// \param LParenLoc Location of '('.
2717
  /// \param EndLoc Ending location of the clause.
2718
  /// \param N Number of the variables in the clause.
2719
  OMPCopyinClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2720
                  SourceLocation EndLoc, unsigned N)
2721
      : OMPVarListClause<OMPCopyinClause>(OMPC_copyin, StartLoc, LParenLoc,
2722
324
                                          EndLoc, N) {}
2723
2724
  /// Build an empty clause.
2725
  ///
2726
  /// \param N Number of variables.
2727
  explicit OMPCopyinClause(unsigned N)
2728
      : OMPVarListClause<OMPCopyinClause>(OMPC_copyin, SourceLocation(),
2729
                                          SourceLocation(), SourceLocation(),
2730
56
                                          N) {}
2731
2732
  /// Set list of helper expressions, required for proper codegen of the
2733
  /// clause. These expressions represent source expression in the final
2734
  /// assignment statement performed by the copyin clause.
2735
  void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2736
2737
  /// Get the list of helper source expressions.
2738
1.10k
  MutableArrayRef<Expr *> getSourceExprs() {
2739
1.10k
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2740
1.10k
  }
2741
300
  ArrayRef<const Expr *> getSourceExprs() const {
2742
300
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2743
300
  }
2744
2745
  /// Set list of helper expressions, required for proper codegen of the
2746
  /// clause. These expressions represent destination expression in the final
2747
  /// assignment statement performed by the copyin clause.
2748
  void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2749
2750
  /// Get the list of helper destination expressions.
2751
612
  MutableArrayRef<Expr *> getDestinationExprs() {
2752
612
    return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2753
612
  }
2754
200
  ArrayRef<const Expr *> getDestinationExprs() const {
2755
200
    return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2756
200
  }
2757
2758
  /// Set list of helper assignment expressions, required for proper
2759
  /// codegen of the clause. These expressions are assignment expressions that
2760
  /// assign source helper expressions to destination helper expressions
2761
  /// correspondingly.
2762
  void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2763
2764
  /// Get the list of helper assignment expressions.
2765
116
  MutableArrayRef<Expr *> getAssignmentOps() {
2766
116
    return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2767
116
  }
2768
100
  ArrayRef<const Expr *> getAssignmentOps() const {
2769
100
    return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2770
100
  }
2771
2772
public:
2773
  /// Creates clause with a list of variables \a VL.
2774
  ///
2775
  /// \param C AST context.
2776
  /// \param StartLoc Starting location of the clause.
2777
  /// \param LParenLoc Location of '('.
2778
  /// \param EndLoc Ending location of the clause.
2779
  /// \param VL List of references to the variables.
2780
  /// \param SrcExprs List of helper expressions for proper generation of
2781
  /// assignment operation required for copyin clause. This list represents
2782
  /// sources.
2783
  /// \param DstExprs List of helper expressions for proper generation of
2784
  /// assignment operation required for copyin clause. This list represents
2785
  /// destinations.
2786
  /// \param AssignmentOps List of helper expressions that represents assignment
2787
  /// operation:
2788
  /// \code
2789
  /// DstExprs = SrcExprs;
2790
  /// \endcode
2791
  /// Required for proper codegen of propagation of master's thread values of
2792
  /// threadprivate variables to local instances of that variables in other
2793
  /// implicit threads.
2794
  static OMPCopyinClause *
2795
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2796
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2797
         ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2798
2799
  /// Creates an empty clause with \a N variables.
2800
  ///
2801
  /// \param C AST context.
2802
  /// \param N The number of variables.
2803
  static OMPCopyinClause *CreateEmpty(const ASTContext &C, unsigned N);
2804
2805
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
2806
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
2807
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
2808
  using helper_expr_const_range =
2809
      llvm::iterator_range<helper_expr_const_iterator>;
2810
2811
50
  helper_expr_const_range source_exprs() const {
2812
50
    return helper_expr_const_range(getSourceExprs().begin(),
2813
50
                                   getSourceExprs().end());
2814
50
  }
2815
2816
58
  helper_expr_range source_exprs() {
2817
58
    return helper_expr_range(getSourceExprs().begin(), getSourceExprs().end());
2818
58
  }
2819
2820
50
  helper_expr_const_range destination_exprs() const {
2821
50
    return helper_expr_const_range(getDestinationExprs().begin(),
2822
50
                                   getDestinationExprs().end());
2823
50
  }
2824
2825
58
  helper_expr_range destination_exprs() {
2826
58
    return helper_expr_range(getDestinationExprs().begin(),
2827
58
                             getDestinationExprs().end());
2828
58
  }
2829
2830
50
  helper_expr_const_range assignment_ops() const {
2831
50
    return helper_expr_const_range(getAssignmentOps().begin(),
2832
50
                                   getAssignmentOps().end());
2833
50
  }
2834
2835
58
  helper_expr_range assignment_ops() {
2836
58
    return helper_expr_range(getAssignmentOps().begin(),
2837
58
                             getAssignmentOps().end());
2838
58
  }
2839
2840
261
  child_range children() {
2841
261
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2842
261
                       reinterpret_cast<Stmt **>(varlist_end()));
2843
261
  }
2844
2845
243
  static bool classof(const OMPClause *T) {
2846
243
    return T->getClauseKind() == OMPC_copyin;
2847
243
  }
2848
};
2849
2850
/// This represents clause 'copyprivate' in the '#pragma omp ...'
2851
/// directives.
2852
///
2853
/// \code
2854
/// #pragma omp single copyprivate(a,b)
2855
/// \endcode
2856
/// In this example directive '#pragma omp single' has clause 'copyprivate'
2857
/// with the variables 'a' and 'b'.
2858
class OMPCopyprivateClause final
2859
    : public OMPVarListClause<OMPCopyprivateClause>,
2860
      private llvm::TrailingObjects<OMPCopyprivateClause, Expr *> {
2861
  friend class OMPClauseReader;
2862
  friend OMPVarListClause;
2863
  friend TrailingObjects;
2864
2865
  /// Build clause with number of variables \a N.
2866
  ///
2867
  /// \param StartLoc Starting location of the clause.
2868
  /// \param LParenLoc Location of '('.
2869
  /// \param EndLoc Ending location of the clause.
2870
  /// \param N Number of the variables in the clause.
2871
  OMPCopyprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2872
                       SourceLocation EndLoc, unsigned N)
2873
      : OMPVarListClause<OMPCopyprivateClause>(OMPC_copyprivate, StartLoc,
2874
140
                                               LParenLoc, EndLoc, N) {}
2875
2876
  /// Build an empty clause.
2877
  ///
2878
  /// \param N Number of variables.
2879
  explicit OMPCopyprivateClause(unsigned N)
2880
      : OMPVarListClause<OMPCopyprivateClause>(
2881
            OMPC_copyprivate, SourceLocation(), SourceLocation(),
2882
18
            SourceLocation(), N) {}
2883
2884
  /// Set list of helper expressions, required for proper codegen of the
2885
  /// clause. These expressions represent source expression in the final
2886
  /// assignment statement performed by the copyprivate clause.
2887
  void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2888
2889
  /// Get the list of helper source expressions.
2890
424
  MutableArrayRef<Expr *> getSourceExprs() {
2891
424
    return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2892
424
  }
2893
228
  ArrayRef<const Expr *> getSourceExprs() const {
2894
228
    return llvm::makeArrayRef(varlist_end(), varlist_size());
2895
228
  }
2896
2897
  /// Set list of helper expressions, required for proper codegen of the
2898
  /// clause. These expressions represent destination expression in the final
2899
  /// assignment statement performed by the copyprivate clause.
2900
  void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2901
2902
  /// Get the list of helper destination expressions.
2903
230
  MutableArrayRef<Expr *> getDestinationExprs() {
2904
230
    return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2905
230
  }
2906
152
  ArrayRef<const Expr *> getDestinationExprs() const {
2907
152
    return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2908
152
  }
2909
2910
  /// Set list of helper assignment expressions, required for proper
2911
  /// codegen of the clause. These expressions are assignment expressions that
2912
  /// assign source helper expressions to destination helper expressions
2913
  /// correspondingly.
2914
  void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2915
2916
  /// Get the list of helper assignment expressions.
2917
36
  MutableArrayRef<Expr *> getAssignmentOps() {
2918
36
    return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2919
36
  }
2920
76
  ArrayRef<const Expr *> getAssignmentOps() const {
2921
76
    return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2922
76
  }
2923
2924
public:
2925
  /// Creates clause with a list of variables \a VL.
2926
  ///
2927
  /// \param C AST context.
2928
  /// \param StartLoc Starting location of the clause.
2929
  /// \param LParenLoc Location of '('.
2930
  /// \param EndLoc Ending location of the clause.
2931
  /// \param VL List of references to the variables.
2932
  /// \param SrcExprs List of helper expressions for proper generation of
2933
  /// assignment operation required for copyprivate clause. This list represents
2934
  /// sources.
2935
  /// \param DstExprs List of helper expressions for proper generation of
2936
  /// assignment operation required for copyprivate clause. This list represents
2937
  /// destinations.
2938
  /// \param AssignmentOps List of helper expressions that represents assignment
2939
  /// operation:
2940
  /// \code
2941
  /// DstExprs = SrcExprs;
2942
  /// \endcode
2943
  /// Required for proper codegen of final assignment performed by the
2944
  /// copyprivate clause.
2945
  static OMPCopyprivateClause *
2946
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2947
         SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2948
         ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2949
2950
  /// Creates an empty clause with \a N variables.
2951
  ///
2952
  /// \param C AST context.
2953
  /// \param N The number of variables.
2954
  static OMPCopyprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
2955
2956
  using helper_expr_iterator = MutableArrayRef<Expr *>::iterator;
2957
  using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator;
2958
  using helper_expr_range = llvm::iterator_range<helper_expr_iterator>;
2959
  using helper_expr_const_range =
2960
      llvm::iterator_range<helper_expr_const_iterator>;
2961
2962
38
  helper_expr_const_range source_exprs() const {
2963
38
    return helper_expr_const_range(getSourceExprs().begin(),
2964
38
                                   getSourceExprs().end());
2965
38
  }
2966
2967
18
  helper_expr_range source_exprs() {
2968
18
    return helper_expr_range(getSourceExprs().begin(), getSourceExprs().end());
2969
18
  }
2970
2971
38
  helper_expr_const_range destination_exprs() const {
2972
38
    return helper_expr_const_range(getDestinationExprs().begin(),
2973
38
                                   getDestinationExprs().end());
2974
38
  }
2975
2976
18
  helper_expr_range destination_exprs() {
2977
18
    return helper_expr_range(getDestinationExprs().begin(),
2978
18
                             getDestinationExprs().end());
2979
18
  }
2980
2981
38
  helper_expr_const_range assignment_ops() const {
2982
38
    return helper_expr_const_range(getAssignmentOps().begin(),
2983
38
                                   getAssignmentOps().end());
2984
38
  }
2985
2986
18
  helper_expr_range assignment_ops() {
2987
18
    return helper_expr_range(getAssignmentOps().begin(),
2988
18
                             getAssignmentOps().end());
2989
18
  }
2990
2991
192
  child_range children() {
2992
192
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
2993
192
                       reinterpret_cast<Stmt **>(varlist_end()));
2994
192
  }
2995
2996
35
  static bool classof(const OMPClause *T) {
2997
35
    return T->getClauseKind() == OMPC_copyprivate;
2998
35
  }
2999
};
3000
3001
/// This represents implicit clause 'flush' for the '#pragma omp flush'
3002
/// directive.
3003
/// This clause does not exist by itself, it can be only as a part of 'omp
3004
/// flush' directive. This clause is introduced to keep the original structure
3005
/// of \a OMPExecutableDirective class and its derivatives and to use the
3006
/// existing infrastructure of clauses with the list of variables.
3007
///
3008
/// \code
3009
/// #pragma omp flush(a,b)
3010
/// \endcode
3011
/// In this example directive '#pragma omp flush' has implicit clause 'flush'
3012
/// with the variables 'a' and 'b'.
3013
class OMPFlushClause final
3014
    : public OMPVarListClause<OMPFlushClause>,
3015
      private llvm::TrailingObjects<OMPFlushClause, Expr *> {
3016
  friend OMPVarListClause;
3017
  friend TrailingObjects;
3018
3019
  /// Build clause with number of variables \a N.
3020
  ///
3021
  /// \param StartLoc Starting location of the clause.
3022
  /// \param LParenLoc Location of '('.
3023
  /// \param EndLoc Ending location of the clause.
3024
  /// \param N Number of the variables in the clause.
3025
  OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3026
                 SourceLocation EndLoc, unsigned N)
3027
      : OMPVarListClause<OMPFlushClause>(OMPC_flush, StartLoc, LParenLoc,
3028
52
                                         EndLoc, N) {}
3029
3030
  /// Build an empty clause.
3031
  ///
3032
  /// \param N Number of variables.
3033
  explicit OMPFlushClause(unsigned N)
3034
      : OMPVarListClause<OMPFlushClause>(OMPC_flush, SourceLocation(),
3035
                                         SourceLocation(), SourceLocation(),
3036
8
                                         N) {}
3037
3038
public:
3039
  /// Creates clause with a list of variables \a VL.
3040
  ///
3041
  /// \param C AST context.
3042
  /// \param StartLoc Starting location of the clause.
3043
  /// \param LParenLoc Location of '('.
3044
  /// \param EndLoc Ending location of the clause.
3045
  /// \param VL List of references to the variables.
3046
  static OMPFlushClause *Create(const ASTContext &C, SourceLocation StartLoc,
3047
                                SourceLocation LParenLoc, SourceLocation EndLoc,
3048
                                ArrayRef<Expr *> VL);
3049
3050
  /// Creates an empty clause with \a N variables.
3051
  ///
3052
  /// \param C AST context.
3053
  /// \param N The number of variables.
3054
  static OMPFlushClause *CreateEmpty(const ASTContext &C, unsigned N);
3055
3056
0
  child_range children() {
3057
0
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3058
0
                       reinterpret_cast<Stmt **>(varlist_end()));
3059
0
  }
3060
3061
4
  static bool classof(const OMPClause *T) {
3062
4
    return T->getClauseKind() == OMPC_flush;
3063
4
  }
3064
};
3065
3066
/// This represents implicit clause 'depend' for the '#pragma omp task'
3067
/// directive.
3068
///
3069
/// \code
3070
/// #pragma omp task depend(in:a,b)
3071
/// \endcode
3072
/// In this example directive '#pragma omp task' with clause 'depend' with the
3073
/// variables 'a' and 'b' with dependency 'in'.
3074
class OMPDependClause final
3075
    : public OMPVarListClause<OMPDependClause>,
3076
      private llvm::TrailingObjects<OMPDependClause, Expr *> {
3077
  friend class OMPClauseReader;
3078
  friend OMPVarListClause;
3079
  friend TrailingObjects;
3080
3081
  /// Dependency type (one of in, out, inout).
3082
  OpenMPDependClauseKind DepKind = OMPC_DEPEND_unknown;
3083
3084
  /// Dependency type location.
3085
  SourceLocation DepLoc;
3086
3087
  /// Colon location.
3088
  SourceLocation ColonLoc;
3089
3090
  /// Build clause with number of variables \a N.
3091
  ///
3092
  /// \param StartLoc Starting location of the clause.
3093
  /// \param LParenLoc Location of '('.
3094
  /// \param EndLoc Ending location of the clause.
3095
  /// \param N Number of the variables in the clause.
3096
  OMPDependClause(SourceLocation StartLoc, SourceLocation LParenLoc,
3097
                  SourceLocation EndLoc, unsigned N)
3098
      : OMPVarListClause<OMPDependClause>(OMPC_depend, StartLoc, LParenLoc,
3099
2.18k
                                          EndLoc, N) {}
3100
3101
  /// Build an empty clause.
3102
  ///
3103
  /// \param N Number of variables.
3104
  explicit OMPDependClause(unsigned N)
3105
      : OMPVarListClause<OMPDependClause>(OMPC_depend, SourceLocation(),
3106
                                          SourceLocation(), SourceLocation(),
3107
526
                                          N) {}
3108
3109
  /// Set dependency kind.
3110
2.71k
  void setDependencyKind(OpenMPDependClauseKind K) { DepKind = K; }
3111
3112
  /// Set dependency kind and its location.
3113
2.71k
  void setDependencyLoc(SourceLocation Loc) { DepLoc = Loc; }
3114
3115
  /// Set colon location.
3116
2.71k
  void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; }
3117
3118
public:
3119
  /// Creates clause with a list of variables \a VL.
3120
  ///
3121
  /// \param C AST context.
3122
  /// \param StartLoc Starting location of the clause.
3123
  /// \param LParenLoc Location of '('.
3124
  /// \param EndLoc Ending location of the clause.
3125
  /// \param DepKind Dependency type.
3126
  /// \param DepLoc Location of the dependency type.
3127
  /// \param ColonLoc Colon location.
3128
  /// \param VL List of references to the variables.
3129
  static OMPDependClause *
3130
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
3131
         SourceLocation EndLoc, OpenMPDependClauseKind DepKind,
3132
         SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL);
3133
3134
  /// Creates an empty clause with \a N variables.
3135
  ///
3136
  /// \param C AST context.
3137
  /// \param N The number of variables.
3138
  static OMPDependClause *CreateEmpty(const ASTContext &C, unsigned N);
3139
3140
  /// Get dependency type.
3141
3.11k
  OpenMPDependClauseKind getDependencyKind() const { return DepKind; }
3142
3143
  /// Get dependency type location.
3144
870
  SourceLocation getDependencyLoc() const { return DepLoc; }
3145
3146
  /// Get colon location.
3147
870
  SourceLocation getColonLoc() const { return ColonLoc; }
3148
3149
  /// Set the loop counter value for the depend clauses with 'sink|source' kind
3150
  /// of dependency. Required for codegen.
3151
  void setCounterValue(Expr *V);
3152
3153
  /// Get the loop counter value.
3154
  Expr *getCounterValue();
3155
3156
  /// Get the loop counter value.
3157
  const Expr *getCounterValue() const;
3158
3159
20
  child_range children() {
3160
20
    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
3161
20
                       reinterpret_cast<Stmt **>(varlist_end()));
3162
20
  }
3163
3164
7.59k
  static bool classof(const OMPClause *T) {
3165
7.59k
    return T->getClauseKind() == OMPC_depend;
3166
7.59k
  }
3167
};
3168
3169
/// This represents 'device' clause in the '#pragma omp ...'
3170
/// directive.
3171
///
3172
/// \code
3173
/// #pragma omp target device(a)
3174
/// \endcode
3175
/// In this example directive '#pragma omp target' has clause 'device'
3176
/// with single expression 'a'.
3177
class OMPDeviceClause : public OMPClause, public OMPClauseWithPreInit {
3178
  friend class OMPClauseReader;
3179
3180
  /// Location of '('.
3181
  SourceLocation LParenLoc;
3182
3183
  /// Device number.
3184
  Stmt *Device = nullptr;
3185
3186
  /// Set the device number.
3187
  ///
3188
  /// \param E Device number.
3189
288
  void setDevice(Expr *E) { Device = E; }
3190
3191
public:
3192
  /// Build 'device' clause.
3193
  ///
3194
  /// \param E Expression associated with this clause.
3195
  /// \param CaptureRegion Innermost OpenMP region where expressions in this
3196
  /// clause must be captured.
3197
  /// \param StartLoc Starting location of the clause.
3198
  /// \param LParenLoc Location of '('.
3199
  /// \param EndLoc Ending location of the clause.
3200
  OMPDeviceClause(Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion,
3201
                  SourceLocation StartLoc, SourceLocation LParenLoc,
3202
                  SourceLocation EndLoc)
3203
      : OMPClause(OMPC_device, StartLoc, EndLoc), OMPClauseWithPreInit(this),
3204
986
        LParenLoc(LParenLoc), Device(E) {
3205
986
    setPreInitStmt(HelperE, CaptureRegion);
3206
986
  }
3207
3208
  /// Build an empty clause.
3209
  OMPDeviceClause()
3210
      : OMPClause(OMPC_device, SourceLocation(), SourceLocation()),
3211
288
        OMPClauseWithPreInit(this) {}
3212
3213
  /// Sets the location of '('.
3214
288
  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
3215
3216
  /// Returns the location of '('.
3217
348
  SourceLocation getLParenLoc() const { return LParenLoc; }
3218
3219
  /// Return device number.
3220
380
  Expr *getDevice() { return cast<Expr>(Device); }
3221
3222
  /// Return device number.
3223
792
  Expr *getDevice() const { return cast<Expr>(Device); }
3224
3225
14
  child_range children() { return child_range(&Device, &Device + 1); }
3226
3227
5.54k
  static bool classof(const OMPClause *T) {
3228
5.54k
    return T->getClauseKind() == OMPC_device;
3229
5.54k
  }
3230
};
3231
3232
/// This represents 'threads' clause in the '#pragma omp ...' directive.
3233
///
3234
/// \code
3235
/// #pragma omp ordered threads
3236
/// \endcode
3237
/// In this example directive '#pragma omp ordered' has simple 'threads' clause.
3238
class OMPThreadsClause : public OMPClause {
3239
public:
3240
  /// Build 'threads' clause.
3241
  ///
3242
  /// \param StartLoc Starting location of the clause.
3243
  /// \param EndLoc Ending location of the clause.
3244
  OMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc)
3245
104
      : OMPClause(OMPC_threads, StartLoc, EndLoc) {}
3246
3247
  /// Build an empty clause.
3248
  OMPThreadsClause()
3249
8
      : OMPClause(OMPC_threads, SourceLocation(), SourceLocation()) {}
3250
3251
0
  child_range children() {
3252
0
    return child_range(child_iterator(), child_iterator());
3253
0
  }
3254
3255
  static bool classof(const OMPClause *T) {
3256
    return T->getClauseKind() == OMPC_threads;
3257
  }
3258
};
3259
3260
/// This represents 'simd' clause in the '#pragma omp ...' directive.
3261
///
3262
/// \code
3263
/// #pragma omp ordered simd
3264
/// \endcode
3265
/// In this example directive '#pragma omp ordered' has simple 'simd' clause.
3266
class OMPSIMDClause : public OMPClause {
3267
public:
3268
  /// Build 'simd' clause.
3269
  ///
3270
  /// \param StartLoc Starting location of the clause.
3271
  /// \param EndLoc Ending location of the clause.
3272
  OMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc)
3273
74
      : OMPClause(OMPC_simd, StartLoc, EndLoc) {}
3274
3275
  /// Build an empty clause.
3276
16
  OMPSIMDClause() : OMPClause(OMPC_simd, SourceLocation(), SourceLocation()) {}
3277
3278
0
  child_range children() {
3279
0
    return child_range(child_iterator(), child_iterator());
3280
0
  }
3281
3282
8
  static bool classof(const OMPClause *T) {
3283
8
    return T->getClauseKind() == OMPC_simd;
3284
8
  }
3285
};
3286
3287
/// Struct that defines common infrastructure to handle mappable
3288
/// expressions used in OpenMP clauses.
3289
class OMPClauseMappableExprCommon {
3290
public:
3291
  /// Class that represents a component of a mappable expression. E.g.
3292
  /// for an expression S.a, the first component is a declaration reference
3293
  /// expression associated with 'S' and the second is a member expression
3294
  /// associated with the field declaration 'a'. If the expression is an array
3295
  /// subscript it may not have any associated declaration. In that case the
3296
  /// associated declaration is set to nullptr.
3297
  class MappableComponent {
3298
    /// Expression associated with the component.
3299
    Expr *AssociatedExpression = nullptr;
3300
3301
    /// Declaration associated with the declaration. If the component does
3302
    /// not have a declaration (e.g. array subscripts or section), this is set
3303
    /// to nullptr.
3304
    ValueDecl *AssociatedDeclaration = nullptr;
3305
3306
  public:
3307
    explicit MappableComponent() = default;
3308
    explicit MappableComponent(Expr *AssociatedExpression,
3309
                               ValueDecl *AssociatedDeclaration)
3310
        : AssociatedExpression(AssociatedExpression),
3311
          AssociatedDeclaration(
3312
              AssociatedDeclaration
3313
                  ? cast<ValueDecl>(AssociatedDeclaration->getCanonicalDecl())
3314
25.5k
                  : nullptr) {}
3315
3316
43.8k
    Expr *getAssociatedExpression() const { return AssociatedExpression; }
3317
3318
67.8k
    ValueDecl *getAssociatedDeclaration() const {
3319
67.8k
      return AssociatedDeclaration;
3320
67.8k
    }
3321
  };
3322
3323
  // List of components of an expression. This first one is the whole
3324
  // expression and the last one is the base expression.
3325
  using MappableExprComponentList = SmallVector<MappableComponent, 8>;
3326
  using MappableExprComponentListRef = ArrayRef<MappableComponent>;
3327
3328
  // List of all component lists associated to the same base declaration.
3329
  // E.g. if both 'S.a' and 'S.b' are a mappable expressions, each will have
3330
  // their component list but the same base declaration 'S'.
3331
  using MappableExprComponentLists = SmallVector<MappableExprComponentList, 8>;
3332
  using MappableExprComponentListsRef = ArrayRef<MappableExprComponentList>;
3333
3334
protected:
3335
  // Return the total number of elements in a list of component lists.
3336
  static unsigned
3337
  getComponentsTotalNumber(MappableExprComponentListsRef ComponentLists);
3338
3339
  // Return the total number of elements in a list of declarations. All
3340
  // declarations are expected to be canonical.
3341
  static unsigned
3342
  getUniqueDeclarationsTotalNumber(ArrayRef<const ValueDecl *> Declarations);
3343
};
3344
3345
/// This represents clauses with a list of expressions that are mappable.
3346
/// Examples of these clauses are 'map' in
3347
/// '#pragma omp target [enter|exit] [data]...' directives, and  'to' and 'from
3348
/// in '#pragma omp target update...' directives.
3349
template <class T>
3350
class OMPMappableExprListClause : public OMPVarListClause<T>,
3351
                                  public OMPClauseMappableExprCommon {
3352
  friend class OMPClauseReader;
3353
3354
  /// Number of unique declarations in this clause.
3355
  unsigned NumUniqueDeclarations;
3356
3357
  /// Number of component lists in this clause.
3358
  unsigned NumComponentLists;
3359
3360
  /// Total number of components in this clause.
3361
  unsigned NumComponents;
3362
3363
protected:
3364
  /// Build a clause for \a NumUniqueDeclarations declarations, \a
3365
  /// NumComponentLists total component lists, and \a NumComponents total
3366
  /// components.
3367
  ///
3368
  /// \param K Kind of the clause.
3369
  /// \param StartLoc Starting location of the clause (the clause keyword).
3370
  /// \param LParenLoc Location of '('.
3371
  /// \param EndLoc Ending location of the clause.
3372
  /// \param NumVars Number of expressions listed in the clause.
3373
  /// \param NumUniqueDeclarations Number of unique base declarations in this
3374
  /// clause.
3375
  /// \param NumComponentLists Number of component lists in this clause - one
3376
  /// list for each expression in the clause.
3377
  /// \param NumComponents Total number of expression components in the clause.
3378
  OMPMappableExprListClause(OpenMPClauseKind K, SourceLocation StartLoc,
3379
                            SourceLocation LParenLoc, SourceLocation EndLoc,
3380
                            unsigned NumVars, unsigned NumUniqueDeclarations,
3381
                            unsigned NumComponentLists, unsigned NumComponents)
3382
      : OMPVarListClause<T>(K, StartLoc, LParenLoc, EndLoc, NumVars),
3383
        NumUniqueDeclarations(NumUniqueDeclarations),
3384
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
3384
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
3384
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
3384
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
3384
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
3384
2.54k
        NumComponentLists(NumComponentLists), NumComponents(NumComponents) {}
3385
3386
  /// Get the unique declarations that are in the trailing objects of the
3387
  /// class.
3388
18.4k
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3389
18.4k
    return MutableArrayRef<ValueDecl *>(
3390
18.4k
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3391
18.4k
        NumUniqueDeclarations);
3392
18.4k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getUniqueDeclsRef()
Line
Count
Source
3388
14.3k
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3389
14.3k
    return MutableArrayRef<ValueDecl *>(
3390
14.3k
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3391
14.3k
        NumUniqueDeclarations);
3392
14.3k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getUniqueDeclsRef()
Line
Count
Source
3388
748
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3389
748
    return MutableArrayRef<ValueDecl *>(
3390
748
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3391
748
        NumUniqueDeclarations);
3392
748
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getUniqueDeclsRef()
Line
Count
Source
3388
394
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3389
394
    return MutableArrayRef<ValueDecl *>(
3390
394
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3391
394
        NumUniqueDeclarations);
3392
394
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getUniqueDeclsRef()
Line
Count
Source
3388
428
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3389
428
    return MutableArrayRef<ValueDecl *>(
3390
428
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3391
428
        NumUniqueDeclarations);
3392
428
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getUniqueDeclsRef()
Line
Count
Source
3388
2.54k
  MutableArrayRef<ValueDecl *> getUniqueDeclsRef() {
3389
2.54k
    return MutableArrayRef<ValueDecl *>(
3390
2.54k
        static_cast<T *>(this)->template getTrailingObjects<ValueDecl *>(),
3391
2.54k
        NumUniqueDeclarations);
3392
2.54k
  }
3393
3394
  /// Get the unique declarations that are in the trailing objects of the
3395
  /// class.
3396
6.43k
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3397
6.43k
    return ArrayRef<ValueDecl *>(
3398
6.43k
        static_cast<const T *>(this)
3399
6.43k
            ->template getTrailingObjects<ValueDecl *>(),
3400
6.43k
        NumUniqueDeclarations);
3401
6.43k
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getUniqueDeclsRef() const
Line
Count
Source
3396
448
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3397
448
    return ArrayRef<ValueDecl *>(
3398
448
        static_cast<const T *>(this)
3399
448
            ->template getTrailingObjects<ValueDecl *>(),
3400
448
        NumUniqueDeclarations);
3401
448
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getUniqueDeclsRef() const
Line
Count
Source
3396
5.72k
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3397
5.72k
    return ArrayRef<ValueDecl *>(
3398
5.72k
        static_cast<const T *>(this)
3399
5.72k
            ->template getTrailingObjects<ValueDecl *>(),
3400
5.72k
        NumUniqueDeclarations);
3401
5.72k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getUniqueDeclsRef() const
Line
Count
Source
3396
48
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3397
48
    return ArrayRef<ValueDecl *>(
3398
48
        static_cast<const T *>(this)
3399
48
            ->template getTrailingObjects<ValueDecl *>(),
3400
48
        NumUniqueDeclarations);
3401
48
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getUniqueDeclsRef() const
Line
Count
Source
3396
58
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3397
58
    return ArrayRef<ValueDecl *>(
3398
58
        static_cast<const T *>(this)
3399
58
            ->template getTrailingObjects<ValueDecl *>(),
3400
58
        NumUniqueDeclarations);
3401
58
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getUniqueDeclsRef() const
Line
Count
Source
3396
152
  ArrayRef<ValueDecl *> getUniqueDeclsRef() const {
3397
152
    return ArrayRef<ValueDecl *>(
3398
152
        static_cast<const T *>(this)
3399
152
            ->template getTrailingObjects<ValueDecl *>(),
3400
152
        NumUniqueDeclarations);
3401
152
  }
3402
3403
  /// Set the unique declarations that are in the trailing objects of the
3404
  /// class.
3405
2.09k
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3406
2.09k
    assert(UDs.size() == NumUniqueDeclarations &&
3407
2.09k
           "Unexpected amount of unique declarations.");
3408
2.09k
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3409
2.09k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3405
1.54k
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3406
1.54k
    assert(UDs.size() == NumUniqueDeclarations &&
3407
1.54k
           "Unexpected amount of unique declarations.");
3408
1.54k
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3409
1.54k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3405
32
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3406
32
    assert(UDs.size() == NumUniqueDeclarations &&
3407
32
           "Unexpected amount of unique declarations.");
3408
32
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3409
32
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3405
32
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3406
32
    assert(UDs.size() == NumUniqueDeclarations &&
3407
32
           "Unexpected amount of unique declarations.");
3408
32
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3409
32
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3405
84
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3406
84
    assert(UDs.size() == NumUniqueDeclarations &&
3407
84
           "Unexpected amount of unique declarations.");
3408
84
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3409
84
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setUniqueDecls(llvm::ArrayRef<clang::ValueDecl*>)
Line
Count
Source
3405
396
  void setUniqueDecls(ArrayRef<ValueDecl *> UDs) {
3406
396
    assert(UDs.size() == NumUniqueDeclarations &&
3407
396
           "Unexpected amount of unique declarations.");
3408
396
    std::copy(UDs.begin(), UDs.end(), getUniqueDeclsRef().begin());
3409
396
  }
3410
3411
  /// Get the number of lists per declaration that are in the trailing
3412
  /// objects of the class.
3413
18.4k
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3414
18.4k
    return MutableArrayRef<unsigned>(
3415
18.4k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3416
18.4k
        NumUniqueDeclarations);
3417
18.4k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getDeclNumListsRef()
Line
Count
Source
3413
14.3k
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3414
14.3k
    return MutableArrayRef<unsigned>(
3415
14.3k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3416
14.3k
        NumUniqueDeclarations);
3417
14.3k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getDeclNumListsRef()
Line
Count
Source
3413
748
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3414
748
    return MutableArrayRef<unsigned>(
3415
748
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3416
748
        NumUniqueDeclarations);
3417
748
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getDeclNumListsRef()
Line
Count
Source
3413
394
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3414
394
    return MutableArrayRef<unsigned>(
3415
394
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3416
394
        NumUniqueDeclarations);
3417
394
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getDeclNumListsRef()
Line
Count
Source
3413
428
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3414
428
    return MutableArrayRef<unsigned>(
3415
428
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3416
428
        NumUniqueDeclarations);
3417
428
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getDeclNumListsRef()
Line
Count
Source
3413
2.54k
  MutableArrayRef<unsigned> getDeclNumListsRef() {
3414
2.54k
    return MutableArrayRef<unsigned>(
3415
2.54k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>(),
3416
2.54k
        NumUniqueDeclarations);
3417
2.54k
  }
3418
3419
  /// Get the number of lists per declaration that are in the trailing
3420
  /// objects of the class.
3421
6.43k
  ArrayRef<unsigned> getDeclNumListsRef() const {
3422
6.43k
    return ArrayRef<unsigned>(
3423
6.43k
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3424
6.43k
        NumUniqueDeclarations);
3425
6.43k
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getDeclNumListsRef() const
Line
Count
Source
3421
448
  ArrayRef<unsigned> getDeclNumListsRef() const {
3422
448
    return ArrayRef<unsigned>(
3423
448
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3424
448
        NumUniqueDeclarations);
3425
448
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getDeclNumListsRef() const
Line
Count
Source
3421
5.72k
  ArrayRef<unsigned> getDeclNumListsRef() const {
3422
5.72k
    return ArrayRef<unsigned>(
3423
5.72k
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3424
5.72k
        NumUniqueDeclarations);
3425
5.72k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getDeclNumListsRef() const
Line
Count
Source
3421
48
  ArrayRef<unsigned> getDeclNumListsRef() const {
3422
48
    return ArrayRef<unsigned>(
3423
48
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3424
48
        NumUniqueDeclarations);
3425
48
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getDeclNumListsRef() const
Line
Count
Source
3421
58
  ArrayRef<unsigned> getDeclNumListsRef() const {
3422
58
    return ArrayRef<unsigned>(
3423
58
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3424
58
        NumUniqueDeclarations);
3425
58
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getDeclNumListsRef() const
Line
Count
Source
3421
152
  ArrayRef<unsigned> getDeclNumListsRef() const {
3422
152
    return ArrayRef<unsigned>(
3423
152
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>(),
3424
152
        NumUniqueDeclarations);
3425
152
  }
3426
3427
  /// Set the number of lists per declaration that are in the trailing
3428
  /// objects of the class.
3429
2.09k
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3430
2.09k
    assert(DNLs.size() == NumUniqueDeclarations &&
3431
2.09k
           "Unexpected amount of list numbers.");
3432
2.09k
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3433
2.09k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3429
1.54k
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3430
1.54k
    assert(DNLs.size() == NumUniqueDeclarations &&
3431
1.54k
           "Unexpected amount of list numbers.");
3432
1.54k
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3433
1.54k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3429
32
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3430
32
    assert(DNLs.size() == NumUniqueDeclarations &&
3431
32
           "Unexpected amount of list numbers.");
3432
32
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3433
32
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3429
32
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3430
32
    assert(DNLs.size() == NumUniqueDeclarations &&
3431
32
           "Unexpected amount of list numbers.");
3432
32
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3433
32
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3429
84
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3430
84
    assert(DNLs.size() == NumUniqueDeclarations &&
3431
84
           "Unexpected amount of list numbers.");
3432
84
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3433
84
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setDeclNumLists(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3429
396
  void setDeclNumLists(ArrayRef<unsigned> DNLs) {
3430
396
    assert(DNLs.size() == NumUniqueDeclarations &&
3431
396
           "Unexpected amount of list numbers.");
3432
396
    std::copy(DNLs.begin(), DNLs.end(), getDeclNumListsRef().begin());
3433
396
  }
3434
3435
  /// Get the cumulative component lists sizes that are in the trailing
3436
  /// objects of the class. They are appended after the number of lists.
3437
18.4k
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3438
18.4k
    return MutableArrayRef<unsigned>(
3439
18.4k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3440
18.4k
            NumUniqueDeclarations,
3441
18.4k
        NumComponentLists);
3442
18.4k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getComponentListSizesRef()
Line
Count
Source
3437
14.3k
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3438
14.3k
    return MutableArrayRef<unsigned>(
3439
14.3k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3440
14.3k
            NumUniqueDeclarations,
3441
14.3k
        NumComponentLists);
3442
14.3k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getComponentListSizesRef()
Line
Count
Source
3437
748
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3438
748
    return MutableArrayRef<unsigned>(
3439
748
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3440
748
            NumUniqueDeclarations,
3441
748
        NumComponentLists);
3442
748
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getComponentListSizesRef()
Line
Count
Source
3437
394
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3438
394
    return MutableArrayRef<unsigned>(
3439
394
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3440
394
            NumUniqueDeclarations,
3441
394
        NumComponentLists);
3442
394
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getComponentListSizesRef()
Line
Count
Source
3437
428
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3438
428
    return MutableArrayRef<unsigned>(
3439
428
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3440
428
            NumUniqueDeclarations,
3441
428
        NumComponentLists);
3442
428
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getComponentListSizesRef()
Line
Count
Source
3437
2.54k
  MutableArrayRef<unsigned> getComponentListSizesRef() {
3438
2.54k
    return MutableArrayRef<unsigned>(
3439
2.54k
        static_cast<T *>(this)->template getTrailingObjects<unsigned>() +
3440
2.54k
            NumUniqueDeclarations,
3441
2.54k
        NumComponentLists);
3442
2.54k
  }
3443
3444
  /// Get the cumulative component lists sizes that are in the trailing
3445
  /// objects of the class. They are appended after the number of lists.
3446
6.43k
  ArrayRef<unsigned> getComponentListSizesRef() const {
3447
6.43k
    return ArrayRef<unsigned>(
3448
6.43k
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3449
6.43k
            NumUniqueDeclarations,
3450
6.43k
        NumComponentLists);
3451
6.43k
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getComponentListSizesRef() const
Line
Count
Source
3446
448
  ArrayRef<unsigned> getComponentListSizesRef() const {
3447
448
    return ArrayRef<unsigned>(
3448
448
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3449
448
            NumUniqueDeclarations,
3450
448
        NumComponentLists);
3451
448
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getComponentListSizesRef() const
Line
Count
Source
3446
5.72k
  ArrayRef<unsigned> getComponentListSizesRef() const {
3447
5.72k
    return ArrayRef<unsigned>(
3448
5.72k
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3449
5.72k
            NumUniqueDeclarations,
3450
5.72k
        NumComponentLists);
3451
5.72k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getComponentListSizesRef() const
Line
Count
Source
3446
48
  ArrayRef<unsigned> getComponentListSizesRef() const {
3447
48
    return ArrayRef<unsigned>(
3448
48
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3449
48
            NumUniqueDeclarations,
3450
48
        NumComponentLists);
3451
48
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getComponentListSizesRef() const
Line
Count
Source
3446
58
  ArrayRef<unsigned> getComponentListSizesRef() const {
3447
58
    return ArrayRef<unsigned>(
3448
58
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3449
58
            NumUniqueDeclarations,
3450
58
        NumComponentLists);
3451
58
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getComponentListSizesRef() const
Line
Count
Source
3446
152
  ArrayRef<unsigned> getComponentListSizesRef() const {
3447
152
    return ArrayRef<unsigned>(
3448
152
        static_cast<const T *>(this)->template getTrailingObjects<unsigned>() +
3449
152
            NumUniqueDeclarations,
3450
152
        NumComponentLists);
3451
152
  }
3452
3453
  /// Set the cumulative component lists sizes that are in the trailing
3454
  /// objects of the class.
3455
2.09k
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3456
2.09k
    assert(CLSs.size() == NumComponentLists &&
3457
2.09k
           "Unexpected amount of component lists.");
3458
2.09k
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3459
2.09k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3455
1.54k
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3456
1.54k
    assert(CLSs.size() == NumComponentLists &&
3457
1.54k
           "Unexpected amount of component lists.");
3458
1.54k
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3459
1.54k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3455
32
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3456
32
    assert(CLSs.size() == NumComponentLists &&
3457
32
           "Unexpected amount of component lists.");
3458
32
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3459
32
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3455
32
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3456
32
    assert(CLSs.size() == NumComponentLists &&
3457
32
           "Unexpected amount of component lists.");
3458
32
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3459
32
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3455
84
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3456
84
    assert(CLSs.size() == NumComponentLists &&
3457
84
           "Unexpected amount of component lists.");
3458
84
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3459
84
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setComponentListSizes(llvm::ArrayRef<unsigned int>)
Line
Count
Source
3455
396
  void setComponentListSizes(ArrayRef<unsigned> CLSs) {
3456
396
    assert(CLSs.size() == NumComponentLists &&
3457
396
           "Unexpected amount of component lists.");
3458
396
    std::copy(CLSs.begin(), CLSs.end(), getComponentListSizesRef().begin());
3459
396
  }
3460
3461
  /// Get the components that are in the trailing objects of the class.
3462
18.4k
  MutableArrayRef<MappableComponent> getComponentsRef() {
3463
18.4k
    return MutableArrayRef<MappableComponent>(
3464
18.4k
        static_cast<T *>(this)
3465
18.4k
            ->template getTrailingObjects<MappableComponent>(),
3466
18.4k
        NumComponents);
3467
18.4k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getComponentsRef()
Line
Count
Source
3462
14.3k
  MutableArrayRef<MappableComponent> getComponentsRef() {
3463
14.3k
    return MutableArrayRef<MappableComponent>(
3464
14.3k
        static_cast<T *>(this)
3465
14.3k
            ->template getTrailingObjects<MappableComponent>(),
3466
14.3k
        NumComponents);
3467
14.3k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getComponentsRef()
Line
Count
Source
3462
748
  MutableArrayRef<MappableComponent> getComponentsRef() {
3463
748
    return MutableArrayRef<MappableComponent>(
3464
748
        static_cast<T *>(this)
3465
748
            ->template getTrailingObjects<MappableComponent>(),
3466
748
        NumComponents);
3467
748
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getComponentsRef()
Line
Count
Source
3462
394
  MutableArrayRef<MappableComponent> getComponentsRef() {
3463
394
    return MutableArrayRef<MappableComponent>(
3464
394
        static_cast<T *>(this)
3465
394
            ->template getTrailingObjects<MappableComponent>(),
3466
394
        NumComponents);
3467
394
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getComponentsRef()
Line
Count
Source
3462
428
  MutableArrayRef<MappableComponent> getComponentsRef() {
3463
428
    return MutableArrayRef<MappableComponent>(
3464
428
        static_cast<T *>(this)
3465
428
            ->template getTrailingObjects<MappableComponent>(),
3466
428
        NumComponents);
3467
428
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getComponentsRef()
Line
Count
Source
3462
2.54k
  MutableArrayRef<MappableComponent> getComponentsRef() {
3463
2.54k
    return MutableArrayRef<MappableComponent>(
3464
2.54k
        static_cast<T *>(this)
3465
2.54k
            ->template getTrailingObjects<MappableComponent>(),
3466
2.54k
        NumComponents);
3467
2.54k
  }
3468
3469
  /// Get the components that are in the trailing objects of the class.
3470
15.1k
  ArrayRef<MappableComponent> getComponentsRef() const {
3471
15.1k
    return ArrayRef<MappableComponent>(
3472
15.1k
        static_cast<const T *>(this)
3473
15.1k
            ->template getTrailingObjects<MappableComponent>(),
3474
15.1k
        NumComponents);
3475
15.1k
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getComponentsRef() const
Line
Count
Source
3470
552
  ArrayRef<MappableComponent> getComponentsRef() const {
3471
552
    return ArrayRef<MappableComponent>(
3472
552
        static_cast<const T *>(this)
3473
552
            ->template getTrailingObjects<MappableComponent>(),
3474
552
        NumComponents);
3475
552
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getComponentsRef() const
Line
Count
Source
3470
14.0k
  ArrayRef<MappableComponent> getComponentsRef() const {
3471
14.0k
    return ArrayRef<MappableComponent>(
3472
14.0k
        static_cast<const T *>(this)
3473
14.0k
            ->template getTrailingObjects<MappableComponent>(),
3474
14.0k
        NumComponents);
3475
14.0k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::getComponentsRef() const
Line
Count
Source
3470
80
  ArrayRef<MappableComponent> getComponentsRef() const {
3471
80
    return ArrayRef<MappableComponent>(
3472
80
        static_cast<const T *>(this)
3473
80
            ->template getTrailingObjects<MappableComponent>(),
3474
80
        NumComponents);
3475
80
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getComponentsRef() const
Line
Count
Source
3470
110
  ArrayRef<MappableComponent> getComponentsRef() const {
3471
110
    return ArrayRef<MappableComponent>(
3472
110
        static_cast<const T *>(this)
3473
110
            ->template getTrailingObjects<MappableComponent>(),
3474
110
        NumComponents);
3475
110
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getComponentsRef() const
Line
Count
Source
3470
288
  ArrayRef<MappableComponent> getComponentsRef() const {
3471
288
    return ArrayRef<MappableComponent>(
3472
288
        static_cast<const T *>(this)
3473
288
            ->template getTrailingObjects<MappableComponent>(),
3474
288
        NumComponents);
3475
288
  }
3476
3477
  /// Set the components that are in the trailing objects of the class.
3478
  /// This requires the list sizes so that it can also fill the original
3479
  /// expressions, which are the first component of each list.
3480
  void setComponents(ArrayRef<MappableComponent> Components,
3481
2.09k
                     ArrayRef<unsigned> CLSs) {
3482
2.09k
    assert(Components.size() == NumComponents &&
3483
2.09k
           "Unexpected amount of component lists.");
3484
2.09k
    assert(CLSs.size() == NumComponentLists &&
3485
2.09k
           "Unexpected amount of list sizes.");
3486
2.09k
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3487
2.09k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3481
1.54k
                     ArrayRef<unsigned> CLSs) {
3482
1.54k
    assert(Components.size() == NumComponents &&
3483
1.54k
           "Unexpected amount of component lists.");
3484
1.54k
    assert(CLSs.size() == NumComponentLists &&
3485
1.54k
           "Unexpected amount of list sizes.");
3486
1.54k
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3487
1.54k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3481
32
                     ArrayRef<unsigned> CLSs) {
3482
32
    assert(Components.size() == NumComponents &&
3483
32
           "Unexpected amount of component lists.");
3484
32
    assert(CLSs.size() == NumComponentLists &&
3485
32
           "Unexpected amount of list sizes.");
3486
32
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3487
32
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3481
32
                     ArrayRef<unsigned> CLSs) {
3482
32
    assert(Components.size() == NumComponents &&
3483
32
           "Unexpected amount of component lists.");
3484
32
    assert(CLSs.size() == NumComponentLists &&
3485
32
           "Unexpected amount of list sizes.");
3486
32
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3487
32
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3481
84
                     ArrayRef<unsigned> CLSs) {
3482
84
    assert(Components.size() == NumComponents &&
3483
84
           "Unexpected amount of component lists.");
3484
84
    assert(CLSs.size() == NumComponentLists &&
3485
84
           "Unexpected amount of list sizes.");
3486
84
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3487
84
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setComponents(llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>, llvm::ArrayRef<unsigned int>)
Line
Count
Source
3481
396
                     ArrayRef<unsigned> CLSs) {
3482
396
    assert(Components.size() == NumComponents &&
3483
396
           "Unexpected amount of component lists.");
3484
396
    assert(CLSs.size() == NumComponentLists &&
3485
396
           "Unexpected amount of list sizes.");
3486
396
    std::copy(Components.begin(), Components.end(), getComponentsRef().begin());
3487
396
  }
3488
3489
  /// Fill the clause information from the list of declarations and
3490
  /// associated component lists.
3491
  void setClauseInfo(ArrayRef<ValueDecl *> Declarations,
3492
16.3k
                     MappableExprComponentListsRef ComponentLists) {
3493
16.3k
    // Perform some checks to make sure the data sizes are consistent with the
3494
16.3k
    // information available when the clause was created.
3495
16.3k
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3496
16.3k
               NumUniqueDeclarations &&
3497
16.3k
           "Unexpected number of mappable expression info entries!");
3498
16.3k
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3499
16.3k
           "Unexpected total number of components!");
3500
16.3k
    assert(Declarations.size() == ComponentLists.size() &&
3501
16.3k
           "Declaration and component lists size is not consistent!");
3502
16.3k
    assert(Declarations.size() == NumComponentLists &&
3503
16.3k
           "Unexpected declaration and component lists size!");
3504
16.3k
3505
16.3k
    // Organize the components by declaration and retrieve the original
3506
16.3k
    // expression. Original expressions are always the first component of the
3507
16.3k
    // mappable component list.
3508
16.3k
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3509
16.3k
        ComponentListMap;
3510
16.3k
    {
3511
16.3k
      auto CI = ComponentLists.begin();
3512
33.1k
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3513
16.8k
           ++DI, ++CI) {
3514
16.8k
        assert(!CI->empty() && "Invalid component list!");
3515
16.8k
        ComponentListMap[*DI].push_back(*CI);
3516
16.8k
      }
3517
16.3k
    }
3518
16.3k
3519
16.3k
    // Iterators of the target storage.
3520
16.3k
    auto UniqueDeclarations = getUniqueDeclsRef();
3521
16.3k
    auto UDI = UniqueDeclarations.begin();
3522
16.3k
3523
16.3k
    auto DeclNumLists = getDeclNumListsRef();
3524
16.3k
    auto DNLI = DeclNumLists.begin();
3525
16.3k
3526
16.3k
    auto ComponentListSizes = getComponentListSizesRef();
3527
16.3k
    auto CLSI = ComponentListSizes.begin();
3528
16.3k
3529
16.3k
    auto Components = getComponentsRef();
3530
16.3k
    auto CI = Components.begin();
3531
16.3k
3532
16.3k
    // Variable to compute the accumulation of the number of components.
3533
16.3k
    unsigned PrevSize = 0u;
3534
16.3k
3535
16.3k
    // Scan all the declarations and associated component lists.
3536
16.7k
    for (auto &M : ComponentListMap) {
3537
16.7k
      // The declaration.
3538
16.7k
      auto *D = M.first;
3539
16.7k
      // The component lists.
3540
16.7k
      auto CL = M.second;
3541
16.7k
3542
16.7k
      // Initialize the entry.
3543
16.7k
      *UDI = D;
3544
16.7k
      ++UDI;
3545
16.7k
3546
16.7k
      *DNLI = CL.size();
3547
16.7k
      ++DNLI;
3548
16.7k
3549
16.7k
      // Obtain the cumulative sizes and concatenate all the components in the
3550
16.7k
      // reserved storage.
3551
16.8k
      for (auto C : CL) {
3552
16.8k
        // Accumulate with the previous size.
3553
16.8k
        PrevSize += C.size();
3554
16.8k
3555
16.8k
        // Save the size.
3556
16.8k
        *CLSI = PrevSize;
3557
16.8k
        ++CLSI;
3558
16.8k
3559
16.8k
        // Append components after the current components iterator.
3560
16.8k
        CI = std::copy(C.begin(), C.end(), CI);
3561
16.8k
      }
3562
16.7k
    }
3563
16.3k
  }
clang::OMPMappableExprListClause<clang::OMPMapClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3492
12.7k
                     MappableExprComponentListsRef ComponentLists) {
3493
12.7k
    // Perform some checks to make sure the data sizes are consistent with the
3494
12.7k
    // information available when the clause was created.
3495
12.7k
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3496
12.7k
               NumUniqueDeclarations &&
3497
12.7k
           "Unexpected number of mappable expression info entries!");
3498
12.7k
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3499
12.7k
           "Unexpected total number of components!");
3500
12.7k
    assert(Declarations.size() == ComponentLists.size() &&
3501
12.7k
           "Declaration and component lists size is not consistent!");
3502
12.7k
    assert(Declarations.size() == NumComponentLists &&
3503
12.7k
           "Unexpected declaration and component lists size!");
3504
12.7k
3505
12.7k
    // Organize the components by declaration and retrieve the original
3506
12.7k
    // expression. Original expressions are always the first component of the
3507
12.7k
    // mappable component list.
3508
12.7k
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3509
12.7k
        ComponentListMap;
3510
12.7k
    {
3511
12.7k
      auto CI = ComponentLists.begin();
3512
26.5k
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3513
13.7k
           ++DI, ++CI) {
3514
13.7k
        assert(!CI->empty() && "Invalid component list!");
3515
13.7k
        ComponentListMap[*DI].push_back(*CI);
3516
13.7k
      }
3517
12.7k
    }
3518
12.7k
3519
12.7k
    // Iterators of the target storage.
3520
12.7k
    auto UniqueDeclarations = getUniqueDeclsRef();
3521
12.7k
    auto UDI = UniqueDeclarations.begin();
3522
12.7k
3523
12.7k
    auto DeclNumLists = getDeclNumListsRef();
3524
12.7k
    auto DNLI = DeclNumLists.begin();
3525
12.7k
3526
12.7k
    auto ComponentListSizes = getComponentListSizesRef();
3527
12.7k
    auto CLSI = ComponentListSizes.begin();
3528
12.7k
3529
12.7k
    auto Components = getComponentsRef();
3530
12.7k
    auto CI = Components.begin();
3531
12.7k
3532
12.7k
    // Variable to compute the accumulation of the number of components.
3533
12.7k
    unsigned PrevSize = 0u;
3534
12.7k
3535
12.7k
    // Scan all the declarations and associated component lists.
3536
13.7k
    for (auto &M : ComponentListMap) {
3537
13.7k
      // The declaration.
3538
13.7k
      auto *D = M.first;
3539
13.7k
      // The component lists.
3540
13.7k
      auto CL = M.second;
3541
13.7k
3542
13.7k
      // Initialize the entry.
3543
13.7k
      *UDI = D;
3544
13.7k
      ++UDI;
3545
13.7k
3546
13.7k
      *DNLI = CL.size();
3547
13.7k
      ++DNLI;
3548
13.7k
3549
13.7k
      // Obtain the cumulative sizes and concatenate all the components in the
3550
13.7k
      // reserved storage.
3551
13.7k
      for (auto C : CL) {
3552
13.7k
        // Accumulate with the previous size.
3553
13.7k
        PrevSize += C.size();
3554
13.7k
3555
13.7k
        // Save the size.
3556
13.7k
        *CLSI = PrevSize;
3557
13.7k
        ++CLSI;
3558
13.7k
3559
13.7k
        // Append components after the current components iterator.
3560
13.7k
        CI = std::copy(C.begin(), C.end(), CI);
3561
13.7k
      }
3562
13.7k
    }
3563
12.7k
  }
clang::OMPMappableExprListClause<clang::OMPToClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3492
716
                     MappableExprComponentListsRef ComponentLists) {
3493
716
    // Perform some checks to make sure the data sizes are consistent with the
3494
716
    // information available when the clause was created.
3495
716
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3496
716
               NumUniqueDeclarations &&
3497
716
           "Unexpected number of mappable expression info entries!");
3498
716
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3499
716
           "Unexpected total number of components!");
3500
716
    assert(Declarations.size() == ComponentLists.size() &&
3501
716
           "Declaration and component lists size is not consistent!");
3502
716
    assert(Declarations.size() == NumComponentLists &&
3503
716
           "Unexpected declaration and component lists size!");
3504
716
3505
716
    // Organize the components by declaration and retrieve the original
3506
716
    // expression. Original expressions are always the first component of the
3507
716
    // mappable component list.
3508
716
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3509
716
        ComponentListMap;
3510
716
    {
3511
716
      auto CI = ComponentLists.begin();
3512
1.35k
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3513
716
           
++DI, ++CI642
) {
3514
642
        assert(!CI->empty() && "Invalid component list!");
3515
642
        ComponentListMap[*DI].push_back(*CI);
3516
642
      }
3517
716
    }
3518
716
3519
716
    // Iterators of the target storage.
3520
716
    auto UniqueDeclarations = getUniqueDeclsRef();
3521
716
    auto UDI = UniqueDeclarations.begin();
3522
716
3523
716
    auto DeclNumLists = getDeclNumListsRef();
3524
716
    auto DNLI = DeclNumLists.begin();
3525
716
3526
716
    auto ComponentListSizes = getComponentListSizesRef();
3527
716
    auto CLSI = ComponentListSizes.begin();
3528
716
3529
716
    auto Components = getComponentsRef();
3530
716
    auto CI = Components.begin();
3531
716
3532
716
    // Variable to compute the accumulation of the number of components.
3533
716
    unsigned PrevSize = 0u;
3534
716
3535
716
    // Scan all the declarations and associated component lists.
3536
716
    for (auto &M : ComponentListMap) {
3537
634
      // The declaration.
3538
634
      auto *D = M.first;
3539
634
      // The component lists.
3540
634
      auto CL = M.second;
3541
634
3542
634
      // Initialize the entry.
3543
634
      *UDI = D;
3544
634
      ++UDI;
3545
634
3546
634
      *DNLI = CL.size();
3547
634
      ++DNLI;
3548
634
3549
634
      // Obtain the cumulative sizes and concatenate all the components in the
3550
634
      // reserved storage.
3551
642
      for (auto C : CL) {
3552
642
        // Accumulate with the previous size.
3553
642
        PrevSize += C.size();
3554
642
3555
642
        // Save the size.
3556
642
        *CLSI = PrevSize;
3557
642
        ++CLSI;
3558
642
3559
642
        // Append components after the current components iterator.
3560
642
        CI = std::copy(C.begin(), C.end(), CI);
3561
642
      }
3562
634
    }
3563
716
  }
clang::OMPMappableExprListClause<clang::OMPFromClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3492
362
                     MappableExprComponentListsRef ComponentLists) {
3493
362
    // Perform some checks to make sure the data sizes are consistent with the
3494
362
    // information available when the clause was created.
3495
362
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3496
362
               NumUniqueDeclarations &&
3497
362
           "Unexpected number of mappable expression info entries!");
3498
362
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3499
362
           "Unexpected total number of components!");
3500
362
    assert(Declarations.size() == ComponentLists.size() &&
3501
362
           "Declaration and component lists size is not consistent!");
3502
362
    assert(Declarations.size() == NumComponentLists &&
3503
362
           "Unexpected declaration and component lists size!");
3504
362
3505
362
    // Organize the components by declaration and retrieve the original
3506
362
    // expression. Original expressions are always the first component of the
3507
362
    // mappable component list.
3508
362
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3509
362
        ComponentListMap;
3510
362
    {
3511
362
      auto CI = ComponentLists.begin();
3512
710
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3513
362
           
++DI, ++CI348
) {
3514
348
        assert(!CI->empty() && "Invalid component list!");
3515
348
        ComponentListMap[*DI].push_back(*CI);
3516
348
      }
3517
362
    }
3518
362
3519
362
    // Iterators of the target storage.
3520
362
    auto UniqueDeclarations = getUniqueDeclsRef();
3521
362
    auto UDI = UniqueDeclarations.begin();
3522
362
3523
362
    auto DeclNumLists = getDeclNumListsRef();
3524
362
    auto DNLI = DeclNumLists.begin();
3525
362
3526
362
    auto ComponentListSizes = getComponentListSizesRef();
3527
362
    auto CLSI = ComponentListSizes.begin();
3528
362
3529
362
    auto Components = getComponentsRef();
3530
362
    auto CI = Components.begin();
3531
362
3532
362
    // Variable to compute the accumulation of the number of components.
3533
362
    unsigned PrevSize = 0u;
3534
362
3535
362
    // Scan all the declarations and associated component lists.
3536
362
    for (auto &M : ComponentListMap) {
3537
340
      // The declaration.
3538
340
      auto *D = M.first;
3539
340
      // The component lists.
3540
340
      auto CL = M.second;
3541
340
3542
340
      // Initialize the entry.
3543
340
      *UDI = D;
3544
340
      ++UDI;
3545
340
3546
340
      *DNLI = CL.size();
3547
340
      ++DNLI;
3548
340
3549
340
      // Obtain the cumulative sizes and concatenate all the components in the
3550
340
      // reserved storage.
3551
348
      for (auto C : CL) {
3552
348
        // Accumulate with the previous size.
3553
348
        PrevSize += C.size();
3554
348
3555
348
        // Save the size.
3556
348
        *CLSI = PrevSize;
3557
348
        ++CLSI;
3558
348
3559
348
        // Append components after the current components iterator.
3560
348
        CI = std::copy(C.begin(), C.end(), CI);
3561
348
      }
3562
340
    }
3563
362
  }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3492
344
                     MappableExprComponentListsRef ComponentLists) {
3493
344
    // Perform some checks to make sure the data sizes are consistent with the
3494
344
    // information available when the clause was created.
3495
344
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3496
344
               NumUniqueDeclarations &&
3497
344
           "Unexpected number of mappable expression info entries!");
3498
344
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3499
344
           "Unexpected total number of components!");
3500
344
    assert(Declarations.size() == ComponentLists.size() &&
3501
344
           "Declaration and component lists size is not consistent!");
3502
344
    assert(Declarations.size() == NumComponentLists &&
3503
344
           "Unexpected declaration and component lists size!");
3504
344
3505
344
    // Organize the components by declaration and retrieve the original
3506
344
    // expression. Original expressions are always the first component of the
3507
344
    // mappable component list.
3508
344
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3509
344
        ComponentListMap;
3510
344
    {
3511
344
      auto CI = ComponentLists.begin();
3512
610
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3513
344
           
++DI, ++CI266
) {
3514
266
        assert(!CI->empty() && "Invalid component list!");
3515
266
        ComponentListMap[*DI].push_back(*CI);
3516
266
      }
3517
344
    }
3518
344
3519
344
    // Iterators of the target storage.
3520
344
    auto UniqueDeclarations = getUniqueDeclsRef();
3521
344
    auto UDI = UniqueDeclarations.begin();
3522
344
3523
344
    auto DeclNumLists = getDeclNumListsRef();
3524
344
    auto DNLI = DeclNumLists.begin();
3525
344
3526
344
    auto ComponentListSizes = getComponentListSizesRef();
3527
344
    auto CLSI = ComponentListSizes.begin();
3528
344
3529
344
    auto Components = getComponentsRef();
3530
344
    auto CI = Components.begin();
3531
344
3532
344
    // Variable to compute the accumulation of the number of components.
3533
344
    unsigned PrevSize = 0u;
3534
344
3535
344
    // Scan all the declarations and associated component lists.
3536
344
    for (auto &M : ComponentListMap) {
3537
266
      // The declaration.
3538
266
      auto *D = M.first;
3539
266
      // The component lists.
3540
266
      auto CL = M.second;
3541
266
3542
266
      // Initialize the entry.
3543
266
      *UDI = D;
3544
266
      ++UDI;
3545
266
3546
266
      *DNLI = CL.size();
3547
266
      ++DNLI;
3548
266
3549
266
      // Obtain the cumulative sizes and concatenate all the components in the
3550
266
      // reserved storage.
3551
266
      for (auto C : CL) {
3552
266
        // Accumulate with the previous size.
3553
266
        PrevSize += C.size();
3554
266
3555
266
        // Save the size.
3556
266
        *CLSI = PrevSize;
3557
266
        ++CLSI;
3558
266
3559
266
        // Append components after the current components iterator.
3560
266
        CI = std::copy(C.begin(), C.end(), CI);
3561
266
      }
3562
266
    }
3563
344
  }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::setClauseInfo(llvm::ArrayRef<clang::ValueDecl*>, llvm::ArrayRef<llvm::SmallVector<clang::OMPClauseMappableExprCommon::MappableComponent, 8u> >)
Line
Count
Source
3492
2.15k
                     MappableExprComponentListsRef ComponentLists) {
3493
2.15k
    // Perform some checks to make sure the data sizes are consistent with the
3494
2.15k
    // information available when the clause was created.
3495
2.15k
    assert(getUniqueDeclarationsTotalNumber(Declarations) ==
3496
2.15k
               NumUniqueDeclarations &&
3497
2.15k
           "Unexpected number of mappable expression info entries!");
3498
2.15k
    assert(getComponentsTotalNumber(ComponentLists) == NumComponents &&
3499
2.15k
           "Unexpected total number of components!");
3500
2.15k
    assert(Declarations.size() == ComponentLists.size() &&
3501
2.15k
           "Declaration and component lists size is not consistent!");
3502
2.15k
    assert(Declarations.size() == NumComponentLists &&
3503
2.15k
           "Unexpected declaration and component lists size!");
3504
2.15k
3505
2.15k
    // Organize the components by declaration and retrieve the original
3506
2.15k
    // expression. Original expressions are always the first component of the
3507
2.15k
    // mappable component list.
3508
2.15k
    llvm::MapVector<ValueDecl *, SmallVector<MappableExprComponentListRef, 8>>
3509
2.15k
        ComponentListMap;
3510
2.15k
    {
3511
2.15k
      auto CI = ComponentLists.begin();
3512
3.94k
      for (auto DI = Declarations.begin(), DE = Declarations.end(); DI != DE;
3513
2.15k
           
++DI, ++CI1.79k
) {
3514
1.79k
        assert(!CI->empty() && "Invalid component list!");
3515
1.79k
        ComponentListMap[*DI].push_back(*CI);
3516
1.79k
      }
3517
2.15k
    }
3518
2.15k
3519
2.15k
    // Iterators of the target storage.
3520
2.15k
    auto UniqueDeclarations = getUniqueDeclsRef();
3521
2.15k
    auto UDI = UniqueDeclarations.begin();
3522
2.15k
3523
2.15k
    auto DeclNumLists = getDeclNumListsRef();
3524
2.15k
    auto DNLI = DeclNumLists.begin();
3525
2.15k
3526
2.15k
    auto ComponentListSizes = getComponentListSizesRef();
3527
2.15k
    auto CLSI = ComponentListSizes.begin();
3528
2.15k
3529
2.15k
    auto Components = getComponentsRef();
3530
2.15k
    auto CI = Components.begin();
3531
2.15k
3532
2.15k
    // Variable to compute the accumulation of the number of components.
3533
2.15k
    unsigned PrevSize = 0u;
3534
2.15k
3535
2.15k
    // Scan all the declarations and associated component lists.
3536
2.15k
    for (auto &M : ComponentListMap) {
3537
1.78k
      // The declaration.
3538
1.78k
      auto *D = M.first;
3539
1.78k
      // The component lists.
3540
1.78k
      auto CL = M.second;
3541
1.78k
3542
1.78k
      // Initialize the entry.
3543
1.78k
      *UDI = D;
3544
1.78k
      ++UDI;
3545
1.78k
3546
1.78k
      *DNLI = CL.size();
3547
1.78k
      ++DNLI;
3548
1.78k
3549
1.78k
      // Obtain the cumulative sizes and concatenate all the components in the
3550
1.78k
      // reserved storage.
3551
1.79k
      for (auto C : CL) {
3552
1.79k
        // Accumulate with the previous size.
3553
1.79k
        PrevSize += C.size();
3554
1.79k
3555
1.79k
        // Save the size.
3556
1.79k
        *CLSI = PrevSize;
3557
1.79k
        ++CLSI;
3558
1.79k
3559
1.79k
        // Append components after the current components iterator.
3560
1.79k
        CI = std::copy(C.begin(), C.end(), CI);
3561
1.79k
      }
3562
1.78k
    }
3563
2.15k
  }
3564
3565
public:
3566
  /// Return the number of unique base declarations in this clause.
3567
121k
  unsigned getUniqueDeclarationsNum() const { return NumUniqueDeclarations; }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getUniqueDeclarationsNum() const
Line
Count
Source
3567
12.9k
  unsigned getUniqueDeclarationsNum() const { return NumUniqueDeclarations; }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getUniqueDeclarationsNum() const
Line
Count
Source
3567
100k
  unsigned getUniqueDeclarationsNum() const { return NumUniqueDeclarations; }
clang::OMPMappableExprListClause<clang::OMPToClause>::getUniqueDeclarationsNum() const
Line
Count
Source
3567
3.31k
  unsigned getUniqueDeclarationsNum() const { return NumUniqueDeclarations; }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getUniqueDeclarationsNum() const
Line
Count
Source
3567
1.97k
  unsigned getUniqueDeclarationsNum() const { return NumUniqueDeclarations; }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getUniqueDeclarationsNum() const
Line
Count
Source
3567
2.76k
  unsigned getUniqueDeclarationsNum() const { return NumUniqueDeclarations; }
3568
3569
  /// Return the number of lists derived from the clause expressions.
3570
37.7k
  unsigned getTotalComponentListNum() const { return NumComponentLists; }
clang::OMPMappableExprListClause<clang::OMPIsDevicePtrClause>::getTotalComponentListNum() const
Line
Count
Source
3570
3.89k
  unsigned getTotalComponentListNum() const { return NumComponentLists; }
clang::OMPMappableExprListClause<clang::OMPMapClause>::getTotalComponentListNum() const
Line
Count
Source
3570
31.5k
  unsigned getTotalComponentListNum() const { return NumComponentLists; }
clang::OMPMappableExprListClause<clang::OMPToClause>::getTotalComponentListNum() const
Line
Count
Source
3570
892
  unsigned getTotalComponentListNum() const { return NumComponentLists; }
clang::OMPMappableExprListClause<clang::OMPFromClause>::getTotalComponentListNum() const
Line
Count
Source
3570
568
  unsigned getTotalComponentListNum() const { return NumComponentLists; }
clang::OMPMappableExprListClause<clang::OMPUseDevicePtrClause>::getTotalComponentListNum() const
Line
Count
Source
3570
884
  unsigned getTotalComponentListNum() const { return NumComponentLists; }
3571
3572
  /// Return the total number of components in all lists derived from the