Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/AST/StmtOpenMP.h
Line
Count
Source (jump to first uncovered line)
1
//===- StmtOpenMP.h - Classes for OpenMP directives  ------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
/// \file
9
/// This file defines OpenMP AST classes for executable directives and
10
/// clauses.
11
///
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CLANG_AST_STMTOPENMP_H
15
#define LLVM_CLANG_AST_STMTOPENMP_H
16
17
#include "clang/AST/Expr.h"
18
#include "clang/AST/OpenMPClause.h"
19
#include "clang/AST/Stmt.h"
20
#include "clang/Basic/OpenMPKinds.h"
21
#include "clang/Basic/SourceLocation.h"
22
23
namespace clang {
24
25
//===----------------------------------------------------------------------===//
26
// AST classes for directives.
27
//===----------------------------------------------------------------------===//
28
29
/// This is a basic class for representing single OpenMP executable
30
/// directive.
31
///
32
class OMPExecutableDirective : public Stmt {
33
  friend class ASTStmtReader;
34
  /// Kind of the directive.
35
  OpenMPDirectiveKind Kind;
36
  /// Starting location of the directive (directive keyword).
37
  SourceLocation StartLoc;
38
  /// Ending location of the directive.
39
  SourceLocation EndLoc;
40
  /// Numbers of clauses.
41
  const unsigned NumClauses;
42
  /// Number of child expressions/stmts.
43
  const unsigned NumChildren;
44
  /// Offset from this to the start of clauses.
45
  /// There are NumClauses pointers to clauses, they are followed by
46
  /// NumChildren pointers to child stmts/exprs (if the directive type
47
  /// requires an associated stmt, then it has to be the first of them).
48
  const unsigned ClausesOffset;
49
50
  /// Get the clauses storage.
51
3.72M
  MutableArrayRef<OMPClause *> getClauses() {
52
3.72M
    OMPClause **ClauseStorage = reinterpret_cast<OMPClause **>(
53
3.72M
        reinterpret_cast<char *>(this) + ClausesOffset);
54
3.72M
    return MutableArrayRef<OMPClause *>(ClauseStorage, NumClauses);
55
3.72M
  }
56
57
protected:
58
  /// Build instance of directive of class \a K.
59
  ///
60
  /// \param SC Statement class.
61
  /// \param K Kind of OpenMP directive.
62
  /// \param StartLoc Starting location of the directive (directive keyword).
63
  /// \param EndLoc Ending location of the directive.
64
  ///
65
  template <typename T>
66
  OMPExecutableDirective(const T *, StmtClass SC, OpenMPDirectiveKind K,
67
                         SourceLocation StartLoc, SourceLocation EndLoc,
68
                         unsigned NumClauses, unsigned NumChildren)
69
      : Stmt(SC), Kind(K), StartLoc(std::move(StartLoc)),
70
        EndLoc(std::move(EndLoc)), NumClauses(NumClauses),
71
        NumChildren(NumChildren),
72
158k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPParallelDirective>(clang::OMPParallelDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
11.6k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPSimdDirective>(clang::OMPSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.17k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPForDirective>(clang::OMPForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.72k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPForSimdDirective>(clang::OMPForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.10k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPSectionsDirective>(clang::OMPSectionsDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
1.70k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPSectionDirective>(clang::OMPSectionDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
397
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPSingleDirective>(clang::OMPSingleDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
975
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPMasterDirective>(clang::OMPMasterDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
375
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPCriticalDirective>(clang::OMPCriticalDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
677
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPParallelForDirective>(clang::OMPParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
2.99k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPParallelForSimdDirective>(clang::OMPParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.43k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPParallelSectionsDirective>(clang::OMPParallelSectionsDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
1.78k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTaskDirective>(clang::OMPTaskDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
1.94k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTaskyieldDirective>(clang::OMPTaskyieldDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
300
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPBarrierDirective>(clang::OMPBarrierDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
276
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTaskwaitDirective>(clang::OMPTaskwaitDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
286
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTaskgroupDirective>(clang::OMPTaskgroupDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
1.82k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPCancellationPointDirective>(clang::OMPCancellationPointDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
121
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPCancelDirective>(clang::OMPCancelDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
352
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPFlushDirective>(clang::OMPFlushDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
360
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPOrderedDirective>(clang::OMPOrderedDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
718
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPAtomicDirective>(clang::OMPAtomicDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
2.24k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetDirective>(clang::OMPTargetDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
30.3k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetParallelDirective>(clang::OMPTargetParallelDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
4.17k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetParallelForDirective>(clang::OMPTargetParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
4.47k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetDataDirective>(clang::OMPTargetDataDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
1.42k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetEnterDataDirective>(clang::OMPTargetEnterDataDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
1.01k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetExitDataDirective>(clang::OMPTargetExitDataDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
1.02k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTeamsDirective>(clang::OMPTeamsDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
11.9k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTaskLoopDirective>(clang::OMPTaskLoopDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
2.84k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTaskLoopSimdDirective>(clang::OMPTaskLoopSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.20k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPDistributeDirective>(clang::OMPDistributeDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
1.23k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetUpdateDirective>(clang::OMPTargetUpdateDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
1.16k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPDistributeParallelForDirective>(clang::OMPDistributeParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.11k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPDistributeParallelForSimdDirective>(clang::OMPDistributeParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.82k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPDistributeSimdDirective>(clang::OMPDistributeSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
2.73k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetParallelForSimdDirective>(clang::OMPTargetParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
4.72k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetSimdDirective>(clang::OMPTargetSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
4.36k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTeamsDistributeDirective>(clang::OMPTeamsDistributeDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
2.38k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTeamsDistributeSimdDirective>(clang::OMPTeamsDistributeSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
2.89k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTeamsDistributeParallelForSimdDirective>(clang::OMPTeamsDistributeParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.50k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTeamsDistributeParallelForDirective>(clang::OMPTeamsDistributeParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
2.96k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetTeamsDirective>(clang::OMPTargetTeamsDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.86k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetTeamsDistributeDirective>(clang::OMPTargetTeamsDistributeDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
3.72k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetTeamsDistributeParallelForDirective>(clang::OMPTargetTeamsDistributeParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
4.34k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetTeamsDistributeParallelForSimdDirective>(clang::OMPTargetTeamsDistributeParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
5.45k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
clang::OMPExecutableDirective::OMPExecutableDirective<clang::OMPTargetTeamsDistributeSimdDirective>(clang::OMPTargetTeamsDistributeSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int)
Line
Count
Source
72
4.82k
        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
73
74
  /// Sets the list of variables for this clause.
75
  ///
76
  /// \param Clauses The list of clauses for the directive.
77
  ///
78
  void setClauses(ArrayRef<OMPClause *> Clauses);
79
80
  /// Set the associated statement for the directive.
81
  ///
82
  /// /param S Associated statement.
83
  ///
84
156k
  void setAssociatedStmt(Stmt *S) {
85
156k
    assert(hasAssociatedStmt() && "no associated statement.");
86
156k
    *child_begin() = S;
87
156k
  }
88
89
public:
90
  /// Iterates over expressions/statements used in the construct.
91
  class used_clauses_child_iterator
92
      : public llvm::iterator_adaptor_base<
93
            used_clauses_child_iterator, ArrayRef<OMPClause *>::iterator,
94
            std::forward_iterator_tag, Stmt *, ptrdiff_t, Stmt *, Stmt *> {
95
    ArrayRef<OMPClause *>::iterator End;
96
    OMPClause::child_iterator ChildI, ChildEnd;
97
98
29.0k
    void MoveToNext() {
99
29.0k
      if (ChildI != ChildEnd)
100
8.40k
        return;
101
35.6k
      
while (20.6k
this->I != End) {
102
17.2k
        ++this->I;
103
17.2k
        if (this->I != End) {
104
7.66k
          ChildI = (*this->I)->used_children().begin();
105
7.66k
          ChildEnd = (*this->I)->used_children().end();
106
7.66k
          if (ChildI != ChildEnd)
107
2.24k
            return;
108
7.66k
        }
109
17.2k
      }
110
20.6k
    }
111
112
  public:
113
    explicit used_clauses_child_iterator(ArrayRef<OMPClause *> Clauses)
114
        : used_clauses_child_iterator::iterator_adaptor_base(Clauses.begin()),
115
29.5k
          End(Clauses.end()) {
116
29.5k
      if (this->I != End) {
117
12.2k
        ChildI = (*this->I)->used_children().begin();
118
12.2k
        ChildEnd = (*this->I)->used_children().end();
119
12.2k
        MoveToNext();
120
12.2k
      }
121
29.5k
    }
122
12.1k
    Stmt *operator*() const { return *ChildI; }
123
0
    Stmt *operator->() const { return **this; }
124
125
23.6k
    used_clauses_child_iterator &operator++() {
126
23.6k
      ++ChildI;
127
23.6k
      if (ChildI != ChildEnd)
128
6.82k
        return *this;
129
16.7k
      if (this->I != End) {
130
16.7k
        ++this->I;
131
16.7k
        if (this->I != End) {
132
8.06k
          ChildI = (*this->I)->used_children().begin();
133
8.06k
          ChildEnd = (*this->I)->used_children().end();
134
8.06k
        }
135
16.7k
      }
136
16.7k
      MoveToNext();
137
16.7k
      return *this;
138
16.7k
    }
139
  };
140
141
  static llvm::iterator_range<used_clauses_child_iterator>
142
14.7k
  used_clauses_children(ArrayRef<OMPClause *> Clauses) {
143
14.7k
    return {used_clauses_child_iterator(Clauses),
144
14.7k
            used_clauses_child_iterator(llvm::makeArrayRef(Clauses.end(), 0))};
145
14.7k
  }
146
147
  /// Iterates over a filtered subrange of clauses applied to a
148
  /// directive.
149
  ///
150
  /// This iterator visits only clauses of type SpecificClause.
151
  template <typename SpecificClause>
152
  class specific_clause_iterator
153
      : public llvm::iterator_adaptor_base<
154
            specific_clause_iterator<SpecificClause>,
155
            ArrayRef<OMPClause *>::const_iterator, std::forward_iterator_tag,
156
            const SpecificClause *, ptrdiff_t, const SpecificClause *,
157
            const SpecificClause *> {
158
    ArrayRef<OMPClause *>::const_iterator End;
159
160
671k
    void SkipToNextClause() {
161
1.02M
      while (this->I != End && 
!isa<SpecificClause>(*this->I)382k
)
162
353k
        ++this->I;
163
671k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPOrderedClause>::SkipToNextClause()
Line
Count
Source
160
95.4k
    void SkipToNextClause() {
161
144k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)50.0k
)
162
49.1k
        ++this->I;
163
95.4k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNowaitClause>::SkipToNextClause()
Line
Count
Source
160
12.2k
    void SkipToNextClause() {
161
20.5k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)8.82k
)
162
8.38k
        ++this->I;
163
12.2k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDeviceClause>::SkipToNextClause()
Line
Count
Source
160
9.95k
    void SkipToNextClause() {
161
16.4k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)6.83k
)
162
6.47k
        ++this->I;
163
9.95k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDependClause>::SkipToNextClause()
Line
Count
Source
160
10.9k
    void SkipToNextClause() {
161
18.4k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)8.10k
)
162
7.45k
        ++this->I;
163
10.9k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFirstprivateClause>::SkipToNextClause()
Line
Count
Source
160
39.4k
    void SkipToNextClause() {
161
53.6k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)21.1k
)
162
14.2k
        ++this->I;
163
39.4k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIsDevicePtrClause>::SkipToNextClause()
Line
Count
Source
160
9.07k
    void SkipToNextClause() {
161
15.4k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)6.46k
)
162
6.41k
        ++this->I;
163
9.07k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPMapClause>::SkipToNextClause()
Line
Count
Source
160
28.8k
    void SkipToNextClause() {
161
42.8k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)19.4k
)
162
13.9k
        ++this->I;
163
28.8k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTeamsClause>::SkipToNextClause()
Line
Count
Source
160
12.6k
    void SkipToNextClause() {
161
19.0k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)6.99k
)
162
6.46k
        ++this->I;
163
12.6k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPThreadLimitClause>::SkipToNextClause()
Line
Count
Source
160
12.1k
    void SkipToNextClause() {
161
19.0k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)7.33k
)
162
6.91k
        ++this->I;
163
12.1k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIfClause>::SkipToNextClause()
Line
Count
Source
160
22.1k
    void SkipToNextClause() {
161
33.9k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)13.6k
)
162
11.8k
        ++this->I;
163
22.1k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumThreadsClause>::SkipToNextClause()
Line
Count
Source
160
11.1k
    void SkipToNextClause() {
161
18.1k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)7.23k
)
162
6.97k
        ++this->I;
163
11.1k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPToClause>::SkipToNextClause()
Line
Count
Source
160
444
    void SkipToNextClause() {
161
952
      while (this->I != End && 
!isa<SpecificClause>(*this->I)528
)
162
508
        ++this->I;
163
444
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFromClause>::SkipToNextClause()
Line
Count
Source
160
454
    void SkipToNextClause() {
161
952
      while (this->I != End && 
!isa<SpecificClause>(*this->I)528
)
162
498
        ++this->I;
163
454
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUseDevicePtrClause>::SkipToNextClause()
Line
Count
Source
160
688
    void SkipToNextClause() {
161
1.22k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)668
)
162
532
        ++this->I;
163
688
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPScheduleClause>::SkipToNextClause()
Line
Count
Source
160
6.91k
    void SkipToNextClause() {
161
9.95k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)4.33k
)
162
3.03k
        ++this->I;
163
6.91k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPReductionClause>::SkipToNextClause()
Line
Count
Source
160
64.1k
    void SkipToNextClause() {
161
103k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)41.2k
)
162
39.7k
        ++this->I;
163
64.1k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLastprivateClause>::SkipToNextClause()
Line
Count
Source
160
42.6k
    void SkipToNextClause() {
161
68.2k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)26.7k
)
162
25.5k
        ++this->I;
163
42.6k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPProcBindClause>::SkipToNextClause()
Line
Count
Source
160
7.56k
    void SkipToNextClause() {
161
12.2k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)4.74k
)
162
4.68k
        ++this->I;
163
7.56k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSimdlenClause>::SkipToNextClause()
Line
Count
Source
160
10.9k
    void SkipToNextClause() {
161
18.6k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)7.90k
)
162
7.72k
        ++this->I;
163
10.9k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSafelenClause>::SkipToNextClause()
Line
Count
Source
160
10.7k
    void SkipToNextClause() {
161
18.0k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)7.46k
)
162
7.31k
        ++this->I;
163
10.7k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPAlignedClause>::SkipToNextClause()
Line
Count
Source
160
17.2k
    void SkipToNextClause() {
161
29.0k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)12.1k
)
162
11.8k
        ++this->I;
163
17.2k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFlushClause>::SkipToNextClause()
Line
Count
Source
160
16
    void SkipToNextClause() {
161
16
      while (this->I != End && 
!isa<SpecificClause>(*this->I)4
)
162
0
        ++this->I;
163
16
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPrivateClause>::SkipToNextClause()
Line
Count
Source
160
42.9k
    void SkipToNextClause() {
161
68.1k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)25.9k
)
162
25.1k
        ++this->I;
163
42.9k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyinClause>::SkipToNextClause()
Line
Count
Source
160
1.31k
    void SkipToNextClause() {
161
1.59k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)300
)
162
277
        ++this->I;
163
1.31k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLinearClause>::SkipToNextClause()
Line
Count
Source
160
39.1k
    void SkipToNextClause() {
161
65.3k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)27.5k
)
162
26.2k
        ++this->I;
163
39.1k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyprivateClause>::SkipToNextClause()
Line
Count
Source
160
96
    void SkipToNextClause() {
161
113
      while (this->I != End && 
!isa<SpecificClause>(*this->I)35
)
162
17
        ++this->I;
163
96
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPHintClause>::SkipToNextClause()
Line
Count
Source
160
56
    void SkipToNextClause() {
161
56
      while (this->I != End && 
!isa<SpecificClause>(*this->I)5
)
162
0
        ++this->I;
163
56
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFinalClause>::SkipToNextClause()
Line
Count
Source
160
300
    void SkipToNextClause() {
161
484
      while (this->I != End && 
!isa<SpecificClause>(*this->I)192
)
162
184
        ++this->I;
163
300
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPriorityClause>::SkipToNextClause()
Line
Count
Source
160
300
    void SkipToNextClause() {
161
490
      while (this->I != End && 
!isa<SpecificClause>(*this->I)196
)
162
190
        ++this->I;
163
300
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPInReductionClause>::SkipToNextClause()
Line
Count
Source
160
312
    void SkipToNextClause() {
161
496
      while (this->I != End && 
!isa<SpecificClause>(*this->I)196
)
162
184
        ++this->I;
163
312
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUntiedClause>::SkipToNextClause()
Line
Count
Source
160
170
    void SkipToNextClause() {
161
251
      while (this->I != End && 
!isa<SpecificClause>(*this->I)89
)
162
81
        ++this->I;
163
170
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPTaskReductionClause>::SkipToNextClause()
Line
Count
Source
160
54
    void SkipToNextClause() {
161
57
      while (this->I != End && 
!isa<SpecificClause>(*this->I)21
)
162
3
        ++this->I;
163
54
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDistScheduleClause>::SkipToNextClause()
Line
Count
Source
160
5.92k
    void SkipToNextClause() {
161
9.51k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)3.94k
)
162
3.58k
        ++this->I;
163
5.92k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSIMDClause>::SkipToNextClause()
Line
Count
Source
160
24
    void SkipToNextClause() {
161
28
      while (this->I != End && 
!isa<SpecificClause>(*this->I)8
)
162
4
        ++this->I;
163
24
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSeqCstClause>::SkipToNextClause()
Line
Count
Source
160
836
    void SkipToNextClause() {
161
1.18k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)380
)
162
348
        ++this->I;
163
836
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNogroupClause>::SkipToNextClause()
Line
Count
Source
160
130
    void SkipToNextClause() {
161
223
      while (this->I != End && 
!isa<SpecificClause>(*this->I)97
)
162
93
        ++this->I;
163
130
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPGrainsizeClause>::SkipToNextClause()
Line
Count
Source
160
130
    void SkipToNextClause() {
161
227
      while (this->I != End && 
!isa<SpecificClause>(*this->I)101
)
162
97
        ++this->I;
163
130
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTasksClause>::SkipToNextClause()
Line
Count
Source
160
122
    void SkipToNextClause() {
161
201
      while (this->I != End && 
!isa<SpecificClause>(*this->I)87
)
162
79
        ++this->I;
163
122
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCollapseClause>::SkipToNextClause()
Line
Count
Source
160
153k
    void SkipToNextClause() {
161
210k
      while (this->I != End && 
!isa<SpecificClause>(*this->I)60.5k
)
162
56.8k
        ++this->I;
163
153k
    }
164
165
  public:
166
    explicit specific_clause_iterator(ArrayRef<OMPClause *> Clauses)
167
        : specific_clause_iterator::iterator_adaptor_base(Clauses.begin()),
168
652k
          End(Clauses.end()) {
169
652k
      SkipToNextClause();
170
652k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPOrderedClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
95.3k
          End(Clauses.end()) {
169
95.3k
      SkipToNextClause();
170
95.3k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNowaitClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
12.2k
          End(Clauses.end()) {
169
12.2k
      SkipToNextClause();
170
12.2k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDeviceClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
9.95k
          End(Clauses.end()) {
169
9.95k
      SkipToNextClause();
170
9.95k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDependClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
10.5k
          End(Clauses.end()) {
169
10.5k
      SkipToNextClause();
170
10.5k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFirstprivateClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
32.5k
          End(Clauses.end()) {
169
32.5k
      SkipToNextClause();
170
32.5k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIsDevicePtrClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
9.01k
          End(Clauses.end()) {
169
9.01k
      SkipToNextClause();
170
9.01k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPMapClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
23.4k
          End(Clauses.end()) {
169
23.4k
      SkipToNextClause();
170
23.4k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTeamsClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
12.6k
          End(Clauses.end()) {
169
12.6k
      SkipToNextClause();
170
12.6k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPThreadLimitClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
12.1k
          End(Clauses.end()) {
169
12.1k
      SkipToNextClause();
170
12.1k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIfClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
21.6k
          End(Clauses.end()) {
169
21.6k
      SkipToNextClause();
170
21.6k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumThreadsClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
11.1k
          End(Clauses.end()) {
169
11.1k
      SkipToNextClause();
170
11.1k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPToClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
424
          End(Clauses.end()) {
169
424
      SkipToNextClause();
170
424
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFromClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
424
          End(Clauses.end()) {
169
424
      SkipToNextClause();
170
424
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUseDevicePtrClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
552
          End(Clauses.end()) {
169
552
      SkipToNextClause();
170
552
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPScheduleClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
6.81k
          End(Clauses.end()) {
169
6.81k
      SkipToNextClause();
170
6.81k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPReductionClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
62.7k
          End(Clauses.end()) {
169
62.7k
      SkipToNextClause();
170
62.7k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLastprivateClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
41.4k
          End(Clauses.end()) {
169
41.4k
      SkipToNextClause();
170
41.4k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPProcBindClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
7.56k
          End(Clauses.end()) {
169
7.56k
      SkipToNextClause();
170
7.56k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSimdlenClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
10.9k
          End(Clauses.end()) {
169
10.9k
      SkipToNextClause();
170
10.9k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSafelenClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
10.7k
          End(Clauses.end()) {
169
10.7k
      SkipToNextClause();
170
10.7k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPAlignedClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
16.9k
          End(Clauses.end()) {
169
16.9k
      SkipToNextClause();
170
16.9k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFlushClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
16
          End(Clauses.end()) {
169
16
      SkipToNextClause();
170
16
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPrivateClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
42.2k
          End(Clauses.end()) {
169
42.2k
      SkipToNextClause();
170
42.2k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyinClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
1.29k
          End(Clauses.end()) {
169
1.29k
      SkipToNextClause();
170
1.29k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLinearClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
37.8k
          End(Clauses.end()) {
169
37.8k
      SkipToNextClause();
170
37.8k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyprivateClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
78
          End(Clauses.end()) {
169
78
      SkipToNextClause();
170
78
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPHintClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
56
          End(Clauses.end()) {
169
56
      SkipToNextClause();
170
56
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFinalClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
300
          End(Clauses.end()) {
169
300
      SkipToNextClause();
170
300
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPriorityClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
300
          End(Clauses.end()) {
169
300
      SkipToNextClause();
170
300
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPInReductionClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
300
          End(Clauses.end()) {
169
300
      SkipToNextClause();
170
300
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUntiedClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
170
          End(Clauses.end()) {
169
170
      SkipToNextClause();
170
170
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPTaskReductionClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
36
          End(Clauses.end()) {
169
36
      SkipToNextClause();
170
36
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDistScheduleClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
5.92k
          End(Clauses.end()) {
169
5.92k
      SkipToNextClause();
170
5.92k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSIMDClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
24
          End(Clauses.end()) {
169
24
      SkipToNextClause();
170
24
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSeqCstClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
836
          End(Clauses.end()) {
169
836
      SkipToNextClause();
170
836
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNogroupClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
130
          End(Clauses.end()) {
169
130
      SkipToNextClause();
170
130
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPGrainsizeClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
130
          End(Clauses.end()) {
169
130
      SkipToNextClause();
170
130
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTasksClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
122
          End(Clauses.end()) {
169
122
      SkipToNextClause();
170
122
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCollapseClause>::specific_clause_iterator(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
168
153k
          End(Clauses.end()) {
169
153k
      SkipToNextClause();
170
153k
    }
171
172
27.5k
    const SpecificClause *operator*() const {
173
27.5k
      return cast<SpecificClause>(*this->I);
174
27.5k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPOrderedClause>::operator*() const
Line
Count
Source
172
977
    const SpecificClause *operator*() const {
173
977
      return cast<SpecificClause>(*this->I);
174
977
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDeviceClause>::operator*() const
Line
Count
Source
172
352
    const SpecificClause *operator*() const {
173
352
      return cast<SpecificClause>(*this->I);
174
352
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFirstprivateClause>::operator*() const
Line
Count
Source
172
6.90k
    const SpecificClause *operator*() const {
173
6.90k
      return cast<SpecificClause>(*this->I);
174
6.90k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIsDevicePtrClause>::operator*() const
Line
Count
Source
172
52
    const SpecificClause *operator*() const {
173
52
      return cast<SpecificClause>(*this->I);
174
52
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPMapClause>::operator*() const
Line
Count
Source
172
5.45k
    const SpecificClause *operator*() const {
173
5.45k
      return cast<SpecificClause>(*this->I);
174
5.45k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTeamsClause>::operator*() const
Line
Count
Source
172
379
    const SpecificClause *operator*() const {
173
379
      return cast<SpecificClause>(*this->I);
174
379
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPThreadLimitClause>::operator*() const
Line
Count
Source
172
315
    const SpecificClause *operator*() const {
173
315
      return cast<SpecificClause>(*this->I);
174
315
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIfClause>::operator*() const
Line
Count
Source
172
1.59k
    const SpecificClause *operator*() const {
173
1.59k
      return cast<SpecificClause>(*this->I);
174
1.59k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumThreadsClause>::operator*() const
Line
Count
Source
172
202
    const SpecificClause *operator*() const {
173
202
      return cast<SpecificClause>(*this->I);
174
202
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPToClause>::operator*() const
Line
Count
Source
172
20
    const SpecificClause *operator*() const {
173
20
      return cast<SpecificClause>(*this->I);
174
20
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFromClause>::operator*() const
Line
Count
Source
172
30
    const SpecificClause *operator*() const {
173
30
      return cast<SpecificClause>(*this->I);
174
30
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUseDevicePtrClause>::operator*() const
Line
Count
Source
172
136
    const SpecificClause *operator*() const {
173
136
      return cast<SpecificClause>(*this->I);
174
136
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPScheduleClause>::operator*() const
Line
Count
Source
172
1.13k
    const SpecificClause *operator*() const {
173
1.13k
      return cast<SpecificClause>(*this->I);
174
1.13k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPReductionClause>::operator*() const
Line
Count
Source
172
1.48k
    const SpecificClause *operator*() const {
173
1.48k
      return cast<SpecificClause>(*this->I);
174
1.48k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLastprivateClause>::operator*() const
Line
Count
Source
172
1.20k
    const SpecificClause *operator*() const {
173
1.20k
      return cast<SpecificClause>(*this->I);
174
1.20k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPProcBindClause>::operator*() const
Line
Count
Source
172
68
    const SpecificClause *operator*() const {
173
68
      return cast<SpecificClause>(*this->I);
174
68
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSimdlenClause>::operator*() const
Line
Count
Source
172
172
    const SpecificClause *operator*() const {
173
172
      return cast<SpecificClause>(*this->I);
174
172
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSafelenClause>::operator*() const
Line
Count
Source
172
142
    const SpecificClause *operator*() const {
173
142
      return cast<SpecificClause>(*this->I);
174
142
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPAlignedClause>::operator*() const
Line
Count
Source
172
250
    const SpecificClause *operator*() const {
173
250
      return cast<SpecificClause>(*this->I);
174
250
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFlushClause>::operator*() const
Line
Count
Source
172
4
    const SpecificClause *operator*() const {
173
4
      return cast<SpecificClause>(*this->I);
174
4
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPrivateClause>::operator*() const
Line
Count
Source
172
766
    const SpecificClause *operator*() const {
173
766
      return cast<SpecificClause>(*this->I);
174
766
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyinClause>::operator*() const
Line
Count
Source
172
23
    const SpecificClause *operator*() const {
173
23
      return cast<SpecificClause>(*this->I);
174
23
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNowaitClause>::operator*() const
Line
Count
Source
172
28
    const SpecificClause *operator*() const {
173
28
      return cast<SpecificClause>(*this->I);
174
28
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLinearClause>::operator*() const
Line
Count
Source
172
1.24k
    const SpecificClause *operator*() const {
173
1.24k
      return cast<SpecificClause>(*this->I);
174
1.24k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyprivateClause>::operator*() const
Line
Count
Source
172
18
    const SpecificClause *operator*() const {
173
18
      return cast<SpecificClause>(*this->I);
174
18
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPHintClause>::operator*() const
Line
Count
Source
172
5
    const SpecificClause *operator*() const {
173
5
      return cast<SpecificClause>(*this->I);
174
5
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFinalClause>::operator*() const
Line
Count
Source
172
8
    const SpecificClause *operator*() const {
173
8
      return cast<SpecificClause>(*this->I);
174
8
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPriorityClause>::operator*() const
Line
Count
Source
172
6
    const SpecificClause *operator*() const {
173
6
      return cast<SpecificClause>(*this->I);
174
6
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDependClause>::operator*() const
Line
Count
Source
172
386
    const SpecificClause *operator*() const {
173
386
      return cast<SpecificClause>(*this->I);
174
386
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPInReductionClause>::operator*() const
Line
Count
Source
172
12
    const SpecificClause *operator*() const {
173
12
      return cast<SpecificClause>(*this->I);
174
12
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUntiedClause>::operator*() const
Line
Count
Source
172
8
    const SpecificClause *operator*() const {
173
8
      return cast<SpecificClause>(*this->I);
174
8
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPTaskReductionClause>::operator*() const
Line
Count
Source
172
18
    const SpecificClause *operator*() const {
173
18
      return cast<SpecificClause>(*this->I);
174
18
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDistScheduleClause>::operator*() const
Line
Count
Source
172
358
    const SpecificClause *operator*() const {
173
358
      return cast<SpecificClause>(*this->I);
174
358
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSIMDClause>::operator*() const
Line
Count
Source
172
4
    const SpecificClause *operator*() const {
173
4
      return cast<SpecificClause>(*this->I);
174
4
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSeqCstClause>::operator*() const
Line
Count
Source
172
32
    const SpecificClause *operator*() const {
173
32
      return cast<SpecificClause>(*this->I);
174
32
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNogroupClause>::operator*() const
Line
Count
Source
172
4
    const SpecificClause *operator*() const {
173
4
      return cast<SpecificClause>(*this->I);
174
4
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPGrainsizeClause>::operator*() const
Line
Count
Source
172
4
    const SpecificClause *operator*() const {
173
4
      return cast<SpecificClause>(*this->I);
174
4
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTasksClause>::operator*() const
Line
Count
Source
172
8
    const SpecificClause *operator*() const {
173
8
      return cast<SpecificClause>(*this->I);
174
8
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCollapseClause>::operator*() const
Line
Count
Source
172
3.70k
    const SpecificClause *operator*() const {
173
3.70k
      return cast<SpecificClause>(*this->I);
174
3.70k
    }
175
    const SpecificClause *operator->() const { return **this; }
176
177
18.7k
    specific_clause_iterator &operator++() {
178
18.7k
      ++this->I;
179
18.7k
      SkipToNextClause();
180
18.7k
      return *this;
181
18.7k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPOrderedClause>::operator++()
Line
Count
Source
177
86
    specific_clause_iterator &operator++() {
178
86
      ++this->I;
179
86
      SkipToNextClause();
180
86
      return *this;
181
86
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFirstprivateClause>::operator++()
Line
Count
Source
177
6.90k
    specific_clause_iterator &operator++() {
178
6.90k
      ++this->I;
179
6.90k
      SkipToNextClause();
180
6.90k
      return *this;
181
6.90k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIsDevicePtrClause>::operator++()
Line
Count
Source
177
52
    specific_clause_iterator &operator++() {
178
52
      ++this->I;
179
52
      SkipToNextClause();
180
52
      return *this;
181
52
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPMapClause>::operator++()
Line
Count
Source
177
5.45k
    specific_clause_iterator &operator++() {
178
5.45k
      ++this->I;
179
5.45k
      SkipToNextClause();
180
5.45k
      return *this;
181
5.45k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIfClause>::operator++()
Line
Count
Source
177
513
    specific_clause_iterator &operator++() {
178
513
      ++this->I;
179
513
      SkipToNextClause();
180
513
      return *this;
181
513
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPToClause>::operator++()
Line
Count
Source
177
20
    specific_clause_iterator &operator++() {
178
20
      ++this->I;
179
20
      SkipToNextClause();
180
20
      return *this;
181
20
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFromClause>::operator++()
Line
Count
Source
177
30
    specific_clause_iterator &operator++() {
178
30
      ++this->I;
179
30
      SkipToNextClause();
180
30
      return *this;
181
30
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUseDevicePtrClause>::operator++()
Line
Count
Source
177
136
    specific_clause_iterator &operator++() {
178
136
      ++this->I;
179
136
      SkipToNextClause();
180
136
      return *this;
181
136
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPScheduleClause>::operator++()
Line
Count
Source
177
108
    specific_clause_iterator &operator++() {
178
108
      ++this->I;
179
108
      SkipToNextClause();
180
108
      return *this;
181
108
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPReductionClause>::operator++()
Line
Count
Source
177
1.48k
    specific_clause_iterator &operator++() {
178
1.48k
      ++this->I;
179
1.48k
      SkipToNextClause();
180
1.48k
      return *this;
181
1.48k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLastprivateClause>::operator++()
Line
Count
Source
177
1.19k
    specific_clause_iterator &operator++() {
178
1.19k
      ++this->I;
179
1.19k
      SkipToNextClause();
180
1.19k
      return *this;
181
1.19k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPAlignedClause>::operator++()
Line
Count
Source
177
250
    specific_clause_iterator &operator++() {
178
250
      ++this->I;
179
250
      SkipToNextClause();
180
250
      return *this;
181
250
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPrivateClause>::operator++()
Line
Count
Source
177
766
    specific_clause_iterator &operator++() {
178
766
      ++this->I;
179
766
      SkipToNextClause();
180
766
      return *this;
181
766
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyinClause>::operator++()
Line
Count
Source
177
23
    specific_clause_iterator &operator++() {
178
23
      ++this->I;
179
23
      SkipToNextClause();
180
23
      return *this;
181
23
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLinearClause>::operator++()
Line
Count
Source
177
1.24k
    specific_clause_iterator &operator++() {
178
1.24k
      ++this->I;
179
1.24k
      SkipToNextClause();
180
1.24k
      return *this;
181
1.24k
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyprivateClause>::operator++()
Line
Count
Source
177
18
    specific_clause_iterator &operator++() {
178
18
      ++this->I;
179
18
      SkipToNextClause();
180
18
      return *this;
181
18
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDependClause>::operator++()
Line
Count
Source
177
386
    specific_clause_iterator &operator++() {
178
386
      ++this->I;
179
386
      SkipToNextClause();
180
386
      return *this;
181
386
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPInReductionClause>::operator++()
Line
Count
Source
177
12
    specific_clause_iterator &operator++() {
178
12
      ++this->I;
179
12
      SkipToNextClause();
180
12
      return *this;
181
12
    }
clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPTaskReductionClause>::operator++()
Line
Count
Source
177
18
    specific_clause_iterator &operator++() {
178
18
      ++this->I;
179
18
      SkipToNextClause();
180
18
      return *this;
181
18
    }
182
  };
183
184
  template <typename SpecificClause>
185
  static llvm::iterator_range<specific_clause_iterator<SpecificClause>>
186
326k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
326k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
326k
            specific_clause_iterator<SpecificClause>(
189
326k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
326k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPOrderedClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPOrderedClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
47.6k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
47.6k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
47.6k
            specific_clause_iterator<SpecificClause>(
189
47.6k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
47.6k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNowaitClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNowaitClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
6.10k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
6.10k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
6.10k
            specific_clause_iterator<SpecificClause>(
189
6.10k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
6.10k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDeviceClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPDeviceClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
4.97k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
4.97k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
4.97k
            specific_clause_iterator<SpecificClause>(
189
4.97k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
4.97k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDependClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPDependClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
5.28k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
5.28k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
5.28k
            specific_clause_iterator<SpecificClause>(
189
5.28k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
5.28k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFirstprivateClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPFirstprivateClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
16.2k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
16.2k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
16.2k
            specific_clause_iterator<SpecificClause>(
189
16.2k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
16.2k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIsDevicePtrClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPIsDevicePtrClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
4.50k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
4.50k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
4.50k
            specific_clause_iterator<SpecificClause>(
189
4.50k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
4.50k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPMapClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPMapClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
11.7k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
11.7k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
11.7k
            specific_clause_iterator<SpecificClause>(
189
11.7k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
11.7k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTeamsClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNumTeamsClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
6.30k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
6.30k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
6.30k
            specific_clause_iterator<SpecificClause>(
189
6.30k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
6.30k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPThreadLimitClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPThreadLimitClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
6.05k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
6.05k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
6.05k
            specific_clause_iterator<SpecificClause>(
189
6.05k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
6.05k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIfClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPIfClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
10.8k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
10.8k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
10.8k
            specific_clause_iterator<SpecificClause>(
189
10.8k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
10.8k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumThreadsClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNumThreadsClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
5.56k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
5.56k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
5.56k
            specific_clause_iterator<SpecificClause>(
189
5.56k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
5.56k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPToClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPToClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
212
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
212
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
212
            specific_clause_iterator<SpecificClause>(
189
212
                llvm::makeArrayRef(Clauses.end(), 0))};
190
212
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFromClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPFromClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
212
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
212
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
212
            specific_clause_iterator<SpecificClause>(
189
212
                llvm::makeArrayRef(Clauses.end(), 0))};
190
212
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUseDevicePtrClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPUseDevicePtrClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
276
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
276
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
276
            specific_clause_iterator<SpecificClause>(
189
276
                llvm::makeArrayRef(Clauses.end(), 0))};
190
276
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPScheduleClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPScheduleClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
3.40k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
3.40k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
3.40k
            specific_clause_iterator<SpecificClause>(
189
3.40k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
3.40k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPReductionClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPReductionClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
31.3k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
31.3k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
31.3k
            specific_clause_iterator<SpecificClause>(
189
31.3k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
31.3k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLastprivateClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPLastprivateClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
20.7k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
20.7k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
20.7k
            specific_clause_iterator<SpecificClause>(
189
20.7k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
20.7k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPProcBindClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPProcBindClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
3.78k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
3.78k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
3.78k
            specific_clause_iterator<SpecificClause>(
189
3.78k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
3.78k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSimdlenClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPSimdlenClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
5.46k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
5.46k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
5.46k
            specific_clause_iterator<SpecificClause>(
189
5.46k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
5.46k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSafelenClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPSafelenClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
5.38k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
5.38k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
5.38k
            specific_clause_iterator<SpecificClause>(
189
5.38k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
5.38k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPAlignedClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPAlignedClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
8.47k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
8.47k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
8.47k
            specific_clause_iterator<SpecificClause>(
189
8.47k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
8.47k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFlushClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPFlushClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
8
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
8
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
8
            specific_clause_iterator<SpecificClause>(
189
8
                llvm::makeArrayRef(Clauses.end(), 0))};
190
8
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPrivateClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPPrivateClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
21.1k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
21.1k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
21.1k
            specific_clause_iterator<SpecificClause>(
189
21.1k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
21.1k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyinClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPCopyinClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
648
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
648
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
648
            specific_clause_iterator<SpecificClause>(
189
648
                llvm::makeArrayRef(Clauses.end(), 0))};
190
648
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLinearClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPLinearClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
18.9k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
18.9k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
18.9k
            specific_clause_iterator<SpecificClause>(
189
18.9k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
18.9k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyprivateClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPCopyprivateClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
39
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
39
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
39
            specific_clause_iterator<SpecificClause>(
189
39
                llvm::makeArrayRef(Clauses.end(), 0))};
190
39
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPHintClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPHintClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
28
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
28
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
28
            specific_clause_iterator<SpecificClause>(
189
28
                llvm::makeArrayRef(Clauses.end(), 0))};
190
28
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFinalClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPFinalClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
150
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
150
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
150
            specific_clause_iterator<SpecificClause>(
189
150
                llvm::makeArrayRef(Clauses.end(), 0))};
190
150
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPriorityClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPPriorityClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
150
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
150
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
150
            specific_clause_iterator<SpecificClause>(
189
150
                llvm::makeArrayRef(Clauses.end(), 0))};
190
150
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPInReductionClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPInReductionClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
150
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
150
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
150
            specific_clause_iterator<SpecificClause>(
189
150
                llvm::makeArrayRef(Clauses.end(), 0))};
190
150
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUntiedClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPUntiedClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
85
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
85
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
85
            specific_clause_iterator<SpecificClause>(
189
85
                llvm::makeArrayRef(Clauses.end(), 0))};
190
85
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPTaskReductionClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPTaskReductionClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
18
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
18
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
18
            specific_clause_iterator<SpecificClause>(
189
18
                llvm::makeArrayRef(Clauses.end(), 0))};
190
18
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDistScheduleClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPDistScheduleClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
2.96k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
2.96k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
2.96k
            specific_clause_iterator<SpecificClause>(
189
2.96k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
2.96k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSIMDClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPSIMDClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
12
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
12
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
12
            specific_clause_iterator<SpecificClause>(
189
12
                llvm::makeArrayRef(Clauses.end(), 0))};
190
12
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSeqCstClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPSeqCstClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
418
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
418
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
418
            specific_clause_iterator<SpecificClause>(
189
418
                llvm::makeArrayRef(Clauses.end(), 0))};
190
418
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNogroupClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNogroupClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
65
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
65
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
65
            specific_clause_iterator<SpecificClause>(
189
65
                llvm::makeArrayRef(Clauses.end(), 0))};
190
65
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPGrainsizeClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPGrainsizeClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
65
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
65
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
65
            specific_clause_iterator<SpecificClause>(
189
65
                llvm::makeArrayRef(Clauses.end(), 0))};
190
65
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTasksClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNumTasksClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
61
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
61
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
61
            specific_clause_iterator<SpecificClause>(
189
61
                llvm::makeArrayRef(Clauses.end(), 0))};
190
61
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCollapseClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPCollapseClause>(llvm::ArrayRef<clang::OMPClause*>)
Line
Count
Source
186
76.9k
  getClausesOfKind(ArrayRef<OMPClause *> Clauses) {
187
76.9k
    return {specific_clause_iterator<SpecificClause>(Clauses),
188
76.9k
            specific_clause_iterator<SpecificClause>(
189
76.9k
                llvm::makeArrayRef(Clauses.end(), 0))};
190
76.9k
  }
191
192
  template <typename SpecificClause>
193
  llvm::iterator_range<specific_clause_iterator<SpecificClause>>
194
219k
  getClausesOfKind() const {
195
219k
    return getClausesOfKind<SpecificClause>(clauses());
196
219k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPOrderedClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPOrderedClause>() const
Line
Count
Source
194
17.3k
  getClausesOfKind() const {
195
17.3k
    return getClausesOfKind<SpecificClause>(clauses());
196
17.3k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNowaitClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNowaitClause>() const
Line
Count
Source
194
6.10k
  getClausesOfKind() const {
195
6.10k
    return getClausesOfKind<SpecificClause>(clauses());
196
6.10k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDeviceClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPDeviceClause>() const
Line
Count
Source
194
4.97k
  getClausesOfKind() const {
195
4.97k
    return getClausesOfKind<SpecificClause>(clauses());
196
4.97k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDependClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPDependClause>() const
Line
Count
Source
194
5.28k
  getClausesOfKind() const {
195
5.28k
    return getClausesOfKind<SpecificClause>(clauses());
196
5.28k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFirstprivateClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPFirstprivateClause>() const
Line
Count
Source
194
16.2k
  getClausesOfKind() const {
195
16.2k
    return getClausesOfKind<SpecificClause>(clauses());
196
16.2k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIsDevicePtrClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPIsDevicePtrClause>() const
Line
Count
Source
194
4.50k
  getClausesOfKind() const {
195
4.50k
    return getClausesOfKind<SpecificClause>(clauses());
196
4.50k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPMapClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPMapClause>() const
Line
Count
Source
194
11.7k
  getClausesOfKind() const {
195
11.7k
    return getClausesOfKind<SpecificClause>(clauses());
196
11.7k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTeamsClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNumTeamsClause>() const
Line
Count
Source
194
6.30k
  getClausesOfKind() const {
195
6.30k
    return getClausesOfKind<SpecificClause>(clauses());
196
6.30k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPThreadLimitClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPThreadLimitClause>() const
Line
Count
Source
194
6.05k
  getClausesOfKind() const {
195
6.05k
    return getClausesOfKind<SpecificClause>(clauses());
196
6.05k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPIfClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPIfClause>() const
Line
Count
Source
194
10.8k
  getClausesOfKind() const {
195
10.8k
    return getClausesOfKind<SpecificClause>(clauses());
196
10.8k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumThreadsClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNumThreadsClause>() const
Line
Count
Source
194
5.56k
  getClausesOfKind() const {
195
5.56k
    return getClausesOfKind<SpecificClause>(clauses());
196
5.56k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPToClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPToClause>() const
Line
Count
Source
194
212
  getClausesOfKind() const {
195
212
    return getClausesOfKind<SpecificClause>(clauses());
196
212
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFromClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPFromClause>() const
Line
Count
Source
194
212
  getClausesOfKind() const {
195
212
    return getClausesOfKind<SpecificClause>(clauses());
196
212
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUseDevicePtrClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPUseDevicePtrClause>() const
Line
Count
Source
194
276
  getClausesOfKind() const {
195
276
    return getClausesOfKind<SpecificClause>(clauses());
196
276
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPScheduleClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPScheduleClause>() const
Line
Count
Source
194
3.40k
  getClausesOfKind() const {
195
3.40k
    return getClausesOfKind<SpecificClause>(clauses());
196
3.40k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPReductionClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPReductionClause>() const
Line
Count
Source
194
31.3k
  getClausesOfKind() const {
195
31.3k
    return getClausesOfKind<SpecificClause>(clauses());
196
31.3k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLastprivateClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPLastprivateClause>() const
Line
Count
Source
194
20.7k
  getClausesOfKind() const {
195
20.7k
    return getClausesOfKind<SpecificClause>(clauses());
196
20.7k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPProcBindClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPProcBindClause>() const
Line
Count
Source
194
3.78k
  getClausesOfKind() const {
195
3.78k
    return getClausesOfKind<SpecificClause>(clauses());
196
3.78k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSimdlenClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPSimdlenClause>() const
Line
Count
Source
194
5.46k
  getClausesOfKind() const {
195
5.46k
    return getClausesOfKind<SpecificClause>(clauses());
196
5.46k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSafelenClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPSafelenClause>() const
Line
Count
Source
194
5.38k
  getClausesOfKind() const {
195
5.38k
    return getClausesOfKind<SpecificClause>(clauses());
196
5.38k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPAlignedClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPAlignedClause>() const
Line
Count
Source
194
8.47k
  getClausesOfKind() const {
195
8.47k
    return getClausesOfKind<SpecificClause>(clauses());
196
8.47k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFlushClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPFlushClause>() const
Line
Count
Source
194
8
  getClausesOfKind() const {
195
8
    return getClausesOfKind<SpecificClause>(clauses());
196
8
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPrivateClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPPrivateClause>() const
Line
Count
Source
194
21.1k
  getClausesOfKind() const {
195
21.1k
    return getClausesOfKind<SpecificClause>(clauses());
196
21.1k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyinClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPCopyinClause>() const
Line
Count
Source
194
648
  getClausesOfKind() const {
195
648
    return getClausesOfKind<SpecificClause>(clauses());
196
648
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPLinearClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPLinearClause>() const
Line
Count
Source
194
18.9k
  getClausesOfKind() const {
195
18.9k
    return getClausesOfKind<SpecificClause>(clauses());
196
18.9k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPCopyprivateClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPCopyprivateClause>() const
Line
Count
Source
194
39
  getClausesOfKind() const {
195
39
    return getClausesOfKind<SpecificClause>(clauses());
196
39
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPHintClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPHintClause>() const
Line
Count
Source
194
28
  getClausesOfKind() const {
195
28
    return getClausesOfKind<SpecificClause>(clauses());
196
28
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPFinalClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPFinalClause>() const
Line
Count
Source
194
150
  getClausesOfKind() const {
195
150
    return getClausesOfKind<SpecificClause>(clauses());
196
150
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPPriorityClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPPriorityClause>() const
Line
Count
Source
194
150
  getClausesOfKind() const {
195
150
    return getClausesOfKind<SpecificClause>(clauses());
196
150
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPInReductionClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPInReductionClause>() const
Line
Count
Source
194
150
  getClausesOfKind() const {
195
150
    return getClausesOfKind<SpecificClause>(clauses());
196
150
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPUntiedClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPUntiedClause>() const
Line
Count
Source
194
85
  getClausesOfKind() const {
195
85
    return getClausesOfKind<SpecificClause>(clauses());
196
85
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPTaskReductionClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPTaskReductionClause>() const
Line
Count
Source
194
18
  getClausesOfKind() const {
195
18
    return getClausesOfKind<SpecificClause>(clauses());
196
18
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPDistScheduleClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPDistScheduleClause>() const
Line
Count
Source
194
2.96k
  getClausesOfKind() const {
195
2.96k
    return getClausesOfKind<SpecificClause>(clauses());
196
2.96k
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSIMDClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPSIMDClause>() const
Line
Count
Source
194
12
  getClausesOfKind() const {
195
12
    return getClausesOfKind<SpecificClause>(clauses());
196
12
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPSeqCstClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPSeqCstClause>() const
Line
Count
Source
194
418
  getClausesOfKind() const {
195
418
    return getClausesOfKind<SpecificClause>(clauses());
196
418
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNogroupClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNogroupClause>() const
Line
Count
Source
194
65
  getClausesOfKind() const {
195
65
    return getClausesOfKind<SpecificClause>(clauses());
196
65
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPGrainsizeClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPGrainsizeClause>() const
Line
Count
Source
194
65
  getClausesOfKind() const {
195
65
    return getClausesOfKind<SpecificClause>(clauses());
196
65
  }
llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPNumTasksClause> > clang::OMPExecutableDirective::getClausesOfKind<clang::OMPNumTasksClause>() const
Line
Count
Source
194
61
  getClausesOfKind() const {
195
61
    return getClausesOfKind<SpecificClause>(clauses());
196
61
  }
197
198
  /// Gets a single clause of the specified kind associated with the
199
  /// current directive iff there is only one clause of this kind (and assertion
200
  /// is fired if there is more than one clause is associated with the
201
  /// directive). Returns nullptr if no clause of this kind is associated with
202
  /// the directive.
203
  template <typename SpecificClause>
204
42.0k
  const SpecificClause *getSingleClause() const {
205
42.0k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
42.0k
207
42.0k
    if (Clauses.begin() != Clauses.end()) {
208
3.22k
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
3.22k
             "There are at least 2 clauses of the specified kind");
210
3.22k
      return *Clauses.begin();
211
3.22k
    }
212
38.8k
    return nullptr;
213
38.8k
  }
clang::OMPDeviceClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPDeviceClause>() const
Line
Count
Source
204
4.97k
  const SpecificClause *getSingleClause() const {
205
4.97k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
4.97k
207
4.97k
    if (Clauses.begin() != Clauses.end()) {
208
352
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
352
             "There are at least 2 clauses of the specified kind");
210
352
      return *Clauses.begin();
211
352
    }
212
4.62k
    return nullptr;
213
4.62k
  }
clang::OMPNumTeamsClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPNumTeamsClause>() const
Line
Count
Source
204
3.70k
  const SpecificClause *getSingleClause() const {
205
3.70k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
3.70k
207
3.70k
    if (Clauses.begin() != Clauses.end()) {
208
379
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
379
             "There are at least 2 clauses of the specified kind");
210
379
      return *Clauses.begin();
211
379
    }
212
3.32k
    return nullptr;
213
3.32k
  }
clang::OMPThreadLimitClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPThreadLimitClause>() const
Line
Count
Source
204
3.66k
  const SpecificClause *getSingleClause() const {
205
3.66k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
3.66k
207
3.66k
    if (Clauses.begin() != Clauses.end()) {
208
315
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
315
             "There are at least 2 clauses of the specified kind");
210
315
      return *Clauses.begin();
211
315
    }
212
3.34k
    return nullptr;
213
3.34k
  }
clang::OMPNumThreadsClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPNumThreadsClause>() const
Line
Count
Source
204
3.84k
  const SpecificClause *getSingleClause() const {
205
3.84k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
3.84k
207
3.84k
    if (Clauses.begin() != Clauses.end()) {
208
202
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
202
             "There are at least 2 clauses of the specified kind");
210
202
      return *Clauses.begin();
211
202
    }
212
3.64k
    return nullptr;
213
3.64k
  }
clang::OMPProcBindClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPProcBindClause>() const
Line
Count
Source
204
3.78k
  const SpecificClause *getSingleClause() const {
205
3.78k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
3.78k
207
3.78k
    if (Clauses.begin() != Clauses.end()) {
208
68
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
68
             "There are at least 2 clauses of the specified kind");
210
68
      return *Clauses.begin();
211
68
    }
212
3.71k
    return nullptr;
213
3.71k
  }
clang::OMPSimdlenClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPSimdlenClause>() const
Line
Count
Source
204
5.46k
  const SpecificClause *getSingleClause() const {
205
5.46k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
5.46k
207
5.46k
    if (Clauses.begin() != Clauses.end()) {
208
172
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
172
             "There are at least 2 clauses of the specified kind");
210
172
      return *Clauses.begin();
211
172
    }
212
5.29k
    return nullptr;
213
5.29k
  }
clang::OMPSafelenClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPSafelenClause>() const
Line
Count
Source
204
5.38k
  const SpecificClause *getSingleClause() const {
205
5.38k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
5.38k
207
5.38k
    if (Clauses.begin() != Clauses.end()) {
208
142
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
142
             "There are at least 2 clauses of the specified kind");
210
142
      return *Clauses.begin();
211
142
    }
212
5.24k
    return nullptr;
213
5.24k
  }
clang::OMPFlushClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPFlushClause>() const
Line
Count
Source
204
8
  const SpecificClause *getSingleClause() const {
205
8
    auto Clauses = getClausesOfKind<SpecificClause>();
206
8
207
8
    if (Clauses.begin() != Clauses.end()) {
208
4
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
4
             "There are at least 2 clauses of the specified kind");
210
4
      return *Clauses.begin();
211
4
    }
212
4
    return nullptr;
213
4
  }
clang::OMPNowaitClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPNowaitClause>() const
Line
Count
Source
204
943
  const SpecificClause *getSingleClause() const {
205
943
    auto Clauses = getClausesOfKind<SpecificClause>();
206
943
207
943
    if (Clauses.begin() != Clauses.end()) {
208
28
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
28
             "There are at least 2 clauses of the specified kind");
210
28
      return *Clauses.begin();
211
28
    }
212
915
    return nullptr;
213
915
  }
clang::OMPOrderedClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPOrderedClause>() const
Line
Count
Source
204
3.00k
  const SpecificClause *getSingleClause() const {
205
3.00k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
3.00k
207
3.00k
    if (Clauses.begin() != Clauses.end()) {
208
39
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
39
             "There are at least 2 clauses of the specified kind");
210
39
      return *Clauses.begin();
211
39
    }
212
2.96k
    return nullptr;
213
2.96k
  }
clang::OMPScheduleClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPScheduleClause>() const
Line
Count
Source
204
3.00k
  const SpecificClause *getSingleClause() const {
205
3.00k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
3.00k
207
3.00k
    if (Clauses.begin() != Clauses.end()) {
208
958
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
958
             "There are at least 2 clauses of the specified kind");
210
958
      return *Clauses.begin();
211
958
    }
212
2.04k
    return nullptr;
213
2.04k
  }
clang::OMPHintClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPHintClause>() const
Line
Count
Source
204
28
  const SpecificClause *getSingleClause() const {
205
28
    auto Clauses = getClausesOfKind<SpecificClause>();
206
28
207
28
    if (Clauses.begin() != Clauses.end()) {
208
5
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
5
             "There are at least 2 clauses of the specified kind");
210
5
      return *Clauses.begin();
211
5
    }
212
23
    return nullptr;
213
23
  }
clang::OMPFinalClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPFinalClause>() const
Line
Count
Source
204
150
  const SpecificClause *getSingleClause() const {
205
150
    auto Clauses = getClausesOfKind<SpecificClause>();
206
150
207
150
    if (Clauses.begin() != Clauses.end()) {
208
8
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
8
             "There are at least 2 clauses of the specified kind");
210
8
      return *Clauses.begin();
211
8
    }
212
142
    return nullptr;
213
142
  }
clang::OMPPriorityClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPPriorityClause>() const
Line
Count
Source
204
150
  const SpecificClause *getSingleClause() const {
205
150
    auto Clauses = getClausesOfKind<SpecificClause>();
206
150
207
150
    if (Clauses.begin() != Clauses.end()) {
208
6
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
6
             "There are at least 2 clauses of the specified kind");
210
6
      return *Clauses.begin();
211
6
    }
212
144
    return nullptr;
213
144
  }
clang::OMPUntiedClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPUntiedClause>() const
Line
Count
Source
204
85
  const SpecificClause *getSingleClause() const {
205
85
    auto Clauses = getClausesOfKind<SpecificClause>();
206
85
207
85
    if (Clauses.begin() != Clauses.end()) {
208
8
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
8
             "There are at least 2 clauses of the specified kind");
210
8
      return *Clauses.begin();
211
8
    }
212
77
    return nullptr;
213
77
  }
clang::OMPDistScheduleClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPDistScheduleClause>() const
Line
Count
Source
204
2.96k
  const SpecificClause *getSingleClause() const {
205
2.96k
    auto Clauses = getClausesOfKind<SpecificClause>();
206
2.96k
207
2.96k
    if (Clauses.begin() != Clauses.end()) {
208
358
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
358
             "There are at least 2 clauses of the specified kind");
210
358
      return *Clauses.begin();
211
358
    }
212
2.60k
    return nullptr;
213
2.60k
  }
clang::OMPSIMDClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPSIMDClause>() const
Line
Count
Source
204
12
  const SpecificClause *getSingleClause() const {
205
12
    auto Clauses = getClausesOfKind<SpecificClause>();
206
12
207
12
    if (Clauses.begin() != Clauses.end()) {
208
4
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
4
             "There are at least 2 clauses of the specified kind");
210
4
      return *Clauses.begin();
211
4
    }
212
8
    return nullptr;
213
8
  }
clang::OMPSeqCstClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPSeqCstClause>() const
Line
Count
Source
204
418
  const SpecificClause *getSingleClause() const {
205
418
    auto Clauses = getClausesOfKind<SpecificClause>();
206
418
207
418
    if (Clauses.begin() != Clauses.end()) {
208
32
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
32
             "There are at least 2 clauses of the specified kind");
210
32
      return *Clauses.begin();
211
32
    }
212
386
    return nullptr;
213
386
  }
clang::OMPIfClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPIfClause>() const
Line
Count
Source
204
244
  const SpecificClause *getSingleClause() const {
205
244
    auto Clauses = getClausesOfKind<SpecificClause>();
206
244
207
244
    if (Clauses.begin() != Clauses.end()) {
208
124
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
124
             "There are at least 2 clauses of the specified kind");
210
124
      return *Clauses.begin();
211
124
    }
212
120
    return nullptr;
213
120
  }
clang::OMPNogroupClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPNogroupClause>() const
Line
Count
Source
204
65
  const SpecificClause *getSingleClause() const {
205
65
    auto Clauses = getClausesOfKind<SpecificClause>();
206
65
207
65
    if (Clauses.begin() != Clauses.end()) {
208
4
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
4
             "There are at least 2 clauses of the specified kind");
210
4
      return *Clauses.begin();
211
4
    }
212
61
    return nullptr;
213
61
  }
clang::OMPGrainsizeClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPGrainsizeClause>() const
Line
Count
Source
204
65
  const SpecificClause *getSingleClause() const {
205
65
    auto Clauses = getClausesOfKind<SpecificClause>();
206
65
207
65
    if (Clauses.begin() != Clauses.end()) {
208
4
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
4
             "There are at least 2 clauses of the specified kind");
210
4
      return *Clauses.begin();
211
4
    }
212
61
    return nullptr;
213
61
  }
clang::OMPNumTasksClause const* clang::OMPExecutableDirective::getSingleClause<clang::OMPNumTasksClause>() const
Line
Count
Source
204
61
  const SpecificClause *getSingleClause() const {
205
61
    auto Clauses = getClausesOfKind<SpecificClause>();
206
61
207
61
    if (Clauses.begin() != Clauses.end()) {
208
8
      assert(std::next(Clauses.begin()) == Clauses.end() &&
209
8
             "There are at least 2 clauses of the specified kind");
210
8
      return *Clauses.begin();
211
8
    }
212
53
    return nullptr;
213
53
  }
214
215
  /// Returns true if the current directive has one or more clauses of a
216
  /// specific kind.
217
  template <typename SpecificClause>
218
18.9k
  bool hasClausesOfKind() const {
219
18.9k
    auto Clauses = getClausesOfKind<SpecificClause>();
220
18.9k
    return Clauses.begin() != Clauses.end();
221
18.9k
  }
bool clang::OMPExecutableDirective::hasClausesOfKind<clang::OMPNowaitClause>() const
Line
Count
Source
218
5.15k
  bool hasClausesOfKind() const {
219
5.15k
    auto Clauses = getClausesOfKind<SpecificClause>();
220
5.15k
    return Clauses.begin() != Clauses.end();
221
5.15k
  }
bool clang::OMPExecutableDirective::hasClausesOfKind<clang::OMPDependClause>() const
Line
Count
Source
218
4.83k
  bool hasClausesOfKind() const {
219
4.83k
    auto Clauses = getClausesOfKind<SpecificClause>();
220
4.83k
    return Clauses.begin() != Clauses.end();
221
4.83k
  }
bool clang::OMPExecutableDirective::hasClausesOfKind<clang::OMPNumTeamsClause>() const
Line
Count
Source
218
2.60k
  bool hasClausesOfKind() const {
219
2.60k
    auto Clauses = getClausesOfKind<SpecificClause>();
220
2.60k
    return Clauses.begin() != Clauses.end();
221
2.60k
  }
bool clang::OMPExecutableDirective::hasClausesOfKind<clang::OMPThreadLimitClause>() const
Line
Count
Source
218
2.39k
  bool hasClausesOfKind() const {
219
2.39k
    auto Clauses = getClausesOfKind<SpecificClause>();
220
2.39k
    return Clauses.begin() != Clauses.end();
221
2.39k
  }
bool clang::OMPExecutableDirective::hasClausesOfKind<clang::OMPIfClause>() const
Line
Count
Source
218
1.74k
  bool hasClausesOfKind() const {
219
1.74k
    auto Clauses = getClausesOfKind<SpecificClause>();
220
1.74k
    return Clauses.begin() != Clauses.end();
221
1.74k
  }
bool clang::OMPExecutableDirective::hasClausesOfKind<clang::OMPNumThreadsClause>() const
Line
Count
Source
218
1.72k
  bool hasClausesOfKind() const {
219
1.72k
    auto Clauses = getClausesOfKind<SpecificClause>();
220
1.72k
    return Clauses.begin() != Clauses.end();
221
1.72k
  }
bool clang::OMPExecutableDirective::hasClausesOfKind<clang::OMPOrderedClause>() const
Line
Count
Source
218
234
  bool hasClausesOfKind() const {
219
234
    auto Clauses = getClausesOfKind<SpecificClause>();
220
234
    return Clauses.begin() != Clauses.end();
221
234
  }
bool clang::OMPExecutableDirective::hasClausesOfKind<clang::OMPScheduleClause>() const
Line
Count
Source
218
231
  bool hasClausesOfKind() const {
219
231
    auto Clauses = getClausesOfKind<SpecificClause>();
220
231
    return Clauses.begin() != Clauses.end();
221
231
  }
222
223
  /// Returns starting location of directive kind.
224
196k
  SourceLocation getBeginLoc() const { return StartLoc; }
225
  /// Returns ending location of directive.
226
95.7k
  SourceLocation getEndLoc() const { return EndLoc; }
227
228
  /// Set starting location of directive kind.
229
  ///
230
  /// \param Loc New starting location of directive.
231
  ///
232
9.98k
  void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
233
  /// Set ending location of directive.
234
  ///
235
  /// \param Loc New ending location of directive.
236
  ///
237
9.98k
  void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
238
239
  /// Get number of clauses.
240
56.8k
  unsigned getNumClauses() const { return NumClauses; }
241
242
  /// Returns specified clause.
243
  ///
244
  /// \param i Number of clause.
245
  ///
246
13.1k
  OMPClause *getClause(unsigned i) const { return clauses()[i]; }
247
248
  /// Returns true if directive has associated statement.
249
3.23M
  bool hasAssociatedStmt() const { return NumChildren > 0; }
250
251
  /// Returns statement associated with the directive.
252
215k
  const Stmt *getAssociatedStmt() const {
253
215k
    assert(hasAssociatedStmt() && "no associated statement.");
254
215k
    return *child_begin();
255
215k
  }
256
380k
  Stmt *getAssociatedStmt() {
257
380k
    assert(hasAssociatedStmt() && "no associated statement.");
258
380k
    return *child_begin();
259
380k
  }
260
261
  /// Returns the captured statement associated with the
262
  /// component region within the (combined) directive.
263
  //
264
  // \param RegionKind Component region kind.
265
39.8k
  const CapturedStmt *getCapturedStmt(OpenMPDirectiveKind RegionKind) const {
266
39.8k
    SmallVector<OpenMPDirectiveKind, 4> CaptureRegions;
267
39.8k
    getOpenMPCaptureRegions(CaptureRegions, getDirectiveKind());
268
39.8k
    assert(std::any_of(
269
39.8k
               CaptureRegions.begin(), CaptureRegions.end(),
270
39.8k
               [=](const OpenMPDirectiveKind K) { return K == RegionKind; }) &&
271
39.8k
           "RegionKind not found in OpenMP CaptureRegions.");
272
39.8k
    auto *CS = cast<CapturedStmt>(getAssociatedStmt());
273
75.6k
    for (auto ThisCaptureRegion : CaptureRegions) {
274
75.6k
      if (ThisCaptureRegion == RegionKind)
275
39.8k
        return CS;
276
35.7k
      CS = cast<CapturedStmt>(CS->getCapturedStmt());
277
35.7k
    }
278
39.8k
    
llvm_unreachable0
("Incorrect RegionKind specified for directive.");
279
39.8k
  }
280
281
  /// Get innermost captured statement for the construct.
282
278k
  CapturedStmt *getInnermostCapturedStmt() {
283
278k
    assert(hasAssociatedStmt() && getAssociatedStmt() &&
284
278k
           "Must have associated statement.");
285
278k
    SmallVector<OpenMPDirectiveKind, 4> CaptureRegions;
286
278k
    getOpenMPCaptureRegions(CaptureRegions, getDirectiveKind());
287
278k
    assert(!CaptureRegions.empty() &&
288
278k
           "At least one captured statement must be provided.");
289
278k
    auto *CS = cast<CapturedStmt>(getAssociatedStmt());
290
490k
    for (unsigned Level = CaptureRegions.size(); Level > 1; 
--Level211k
)
291
211k
      CS = cast<CapturedStmt>(CS->getCapturedStmt());
292
278k
    return CS;
293
278k
  }
294
295
181k
  const CapturedStmt *getInnermostCapturedStmt() const {
296
181k
    return const_cast<OMPExecutableDirective *>(this)
297
181k
        ->getInnermostCapturedStmt();
298
181k
  }
299
300
1.27M
  OpenMPDirectiveKind getDirectiveKind() const { return Kind; }
301
302
594k
  static bool classof(const Stmt *S) {
303
594k
    return S->getStmtClass() >= firstOMPExecutableDirectiveConstant &&
304
594k
           
S->getStmtClass() <= lastOMPExecutableDirectiveConstant528k
;
305
594k
  }
306
307
2.94M
  child_range children() {
308
2.94M
    if (!hasAssociatedStmt())
309
234
      return child_range(child_iterator(), child_iterator());
310
2.94M
    Stmt **ChildStorage = reinterpret_cast<Stmt **>(getClauses().end());
311
2.94M
    /// Do not mark all the special expression/statements as children, except
312
2.94M
    /// for the associated statement.
313
2.94M
    return child_range(ChildStorage, ChildStorage + 1);
314
2.94M
  }
315
316
0
  const_child_range children() const {
317
0
    if (!hasAssociatedStmt())
318
0
      return const_child_range(const_child_iterator(), const_child_iterator());
319
0
    Stmt **ChildStorage = reinterpret_cast<Stmt **>(
320
0
        const_cast<OMPExecutableDirective *>(this)->getClauses().end());
321
0
    return const_child_range(ChildStorage, ChildStorage + 1);
322
0
  }
323
324
114k
  ArrayRef<OMPClause *> clauses() { return getClauses(); }
325
326
514k
  ArrayRef<OMPClause *> clauses() const {
327
514k
    return const_cast<OMPExecutableDirective *>(this)->getClauses();
328
514k
  }
329
330
  /// Returns whether or not this is a Standalone directive.
331
  ///
332
  /// Stand-alone directives are executable directives
333
  /// that have no associated user code.
334
  bool isStandaloneDirective() const;
335
336
  /// Returns the AST node representing OpenMP structured-block of this
337
  /// OpenMP executable directive,
338
  /// Prerequisite: Executable Directive must not be Standalone directive.
339
  const Stmt *getStructuredBlock() const;
340
341
156k
  Stmt *getStructuredBlock() {
342
156k
    return const_cast<Stmt *>(
343
156k
        const_cast<const OMPExecutableDirective *>(this)->getStructuredBlock());
344
156k
  }
345
};
346
347
/// This represents '#pragma omp parallel' directive.
348
///
349
/// \code
350
/// #pragma omp parallel private(a,b) reduction(+: c,d)
351
/// \endcode
352
/// In this example directive '#pragma omp parallel' has clauses 'private'
353
/// with the variables 'a' and 'b' and 'reduction' with operator '+' and
354
/// variables 'c' and 'd'.
355
///
356
class OMPParallelDirective : public OMPExecutableDirective {
357
  friend class ASTStmtReader;
358
  /// true if the construct has inner cancel directive.
359
  bool HasCancel;
360
361
  /// Build directive with the given start and end location.
362
  ///
363
  /// \param StartLoc Starting location of the directive (directive keyword).
364
  /// \param EndLoc Ending Location of the directive.
365
  ///
366
  OMPParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc,
367
                       unsigned NumClauses)
368
      : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
369
                               StartLoc, EndLoc, NumClauses, 1),
370
11.1k
        HasCancel(false) {}
371
372
  /// Build an empty directive.
373
  ///
374
  /// \param NumClauses Number of clauses.
375
  ///
376
  explicit OMPParallelDirective(unsigned NumClauses)
377
      : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
378
                               SourceLocation(), SourceLocation(), NumClauses,
379
                               1),
380
461
        HasCancel(false) {}
381
382
  /// Set cancel state.
383
11.6k
  void setHasCancel(bool Has) { HasCancel = Has; }
384
385
public:
386
  /// Creates directive with a list of \a Clauses.
387
  ///
388
  /// \param C AST context.
389
  /// \param StartLoc Starting location of the directive kind.
390
  /// \param EndLoc Ending Location of the directive.
391
  /// \param Clauses List of clauses.
392
  /// \param AssociatedStmt Statement associated with the directive.
393
  /// \param HasCancel true if this directive has inner cancel directive.
394
  ///
395
  static OMPParallelDirective *
396
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
397
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel);
398
399
  /// Creates an empty directive with the place for \a N clauses.
400
  ///
401
  /// \param C AST context.
402
  /// \param NumClauses Number of clauses.
403
  ///
404
  static OMPParallelDirective *CreateEmpty(const ASTContext &C,
405
                                           unsigned NumClauses, EmptyShell);
406
407
  /// Return true if current directive has inner cancel directive.
408
1.10k
  bool hasCancel() const { return HasCancel; }
409
410
7.33k
  static bool classof(const Stmt *T) {
411
7.33k
    return T->getStmtClass() == OMPParallelDirectiveClass;
412
7.33k
  }
413
};
414
415
/// This is a common base class for loop directives ('omp simd', 'omp
416
/// for', 'omp for simd' etc.). It is responsible for the loop code generation.
417
///
418
class OMPLoopDirective : public OMPExecutableDirective {
419
  friend class ASTStmtReader;
420
  /// Number of collapsed loops as specified by 'collapse' clause.
421
  unsigned CollapsedNum;
422
423
  /// Offsets to the stored exprs.
424
  /// This enumeration contains offsets to all the pointers to children
425
  /// expressions stored in OMPLoopDirective.
426
  /// The first 9 children are necessary for all the loop directives,
427
  /// the next 8 are specific to the worksharing ones, and the next 11 are
428
  /// used for combined constructs containing two pragmas associated to loops.
429
  /// After the fixed children, three arrays of length CollapsedNum are
430
  /// allocated: loop counters, their updates and final values.
431
  /// PrevLowerBound and PrevUpperBound are used to communicate blocking
432
  /// information in composite constructs which require loop blocking
433
  /// DistInc is used to generate the increment expression for the distribute
434
  /// loop when combined with a further nested loop
435
  /// PrevEnsureUpperBound is used as the EnsureUpperBound expression for the
436
  /// for loop when combined with a previous distribute loop in the same pragma
437
  /// (e.g. 'distribute parallel for')
438
  ///
439
  enum {
440
    AssociatedStmtOffset = 0,
441
    IterationVariableOffset = 1,
442
    LastIterationOffset = 2,
443
    CalcLastIterationOffset = 3,
444
    PreConditionOffset = 4,
445
    CondOffset = 5,
446
    InitOffset = 6,
447
    IncOffset = 7,
448
    PreInitsOffset = 8,
449
    // The '...End' enumerators do not correspond to child expressions - they
450
    // specify the offset to the end (and start of the following counters/
451
    // updates/finals arrays).
452
    DefaultEnd = 9,
453
    // The following 8 exprs are used by worksharing and distribute loops only.
454
    IsLastIterVariableOffset = 9,
455
    LowerBoundVariableOffset = 10,
456
    UpperBoundVariableOffset = 11,
457
    StrideVariableOffset = 12,
458
    EnsureUpperBoundOffset = 13,
459
    NextLowerBoundOffset = 14,
460
    NextUpperBoundOffset = 15,
461
    NumIterationsOffset = 16,
462
    // Offset to the end for worksharing loop directives.
463
    WorksharingEnd = 17,
464
    PrevLowerBoundVariableOffset = 17,
465
    PrevUpperBoundVariableOffset = 18,
466
    DistIncOffset = 19,
467
    PrevEnsureUpperBoundOffset = 20,
468
    CombinedLowerBoundVariableOffset = 21,
469
    CombinedUpperBoundVariableOffset = 22,
470
    CombinedEnsureUpperBoundOffset = 23,
471
    CombinedInitOffset = 24,
472
    CombinedConditionOffset = 25,
473
    CombinedNextLowerBoundOffset = 26,
474
    CombinedNextUpperBoundOffset = 27,
475
    CombinedDistConditionOffset = 28,
476
    CombinedParForInDistConditionOffset = 29,
477
    // Offset to the end (and start of the following counters/updates/finals
478
    // arrays) for combined distribute loop directives.
479
    CombinedDistributeEnd = 30,
480
  };
481
482
  /// Get the counters storage.
483
119k
  MutableArrayRef<Expr *> getCounters() {
484
119k
    Expr **Storage = reinterpret_cast<Expr **>(
485
119k
        &(*(std::next(child_begin(), getArraysOffset(getDirectiveKind())))));
486
119k
    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
487
119k
  }
488
489
  /// Get the private counters storage.
490
97.0k
  MutableArrayRef<Expr *> getPrivateCounters() {
491
97.0k
    Expr **Storage = reinterpret_cast<Expr **>(&*std::next(
492
97.0k
        child_begin(), getArraysOffset(getDirectiveKind()) + CollapsedNum));
493
97.0k
    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
494
97.0k
  }
495
496
  /// Get the updates storage.
497
83.1k
  MutableArrayRef<Expr *> getInits() {
498
83.1k
    Expr **Storage = reinterpret_cast<Expr **>(
499
83.1k
        &*std::next(child_begin(),
500
83.1k
                    getArraysOffset(getDirectiveKind()) + 2 * CollapsedNum));
501
83.1k
    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
502
83.1k
  }
503
504
  /// Get the updates storage.
505
88.0k
  MutableArrayRef<Expr *> getUpdates() {
506
88.0k
    Expr **Storage = reinterpret_cast<Expr **>(
507
88.0k
        &*std::next(child_begin(),
508
88.0k
                    getArraysOffset(getDirectiveKind()) + 3 * CollapsedNum));
509
88.0k
    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
510
88.0k
  }
511
512
  /// Get the final counter updates storage.
513
87.1k
  MutableArrayRef<Expr *> getFinals() {
514
87.1k
    Expr **Storage = reinterpret_cast<Expr **>(
515
87.1k
        &*std::next(child_begin(),
516
87.1k
                    getArraysOffset(getDirectiveKind()) + 4 * CollapsedNum));
517
87.1k
    return MutableArrayRef<Expr *>(Storage, CollapsedNum);
518
87.1k
  }
519
520
protected:
521
  /// Build instance of loop directive of class \a Kind.
522
  ///
523
  /// \param SC Statement class.
524
  /// \param Kind Kind of OpenMP directive.
525
  /// \param StartLoc Starting location of the directive (directive keyword).
526
  /// \param EndLoc Ending location of the directive.
527
  /// \param CollapsedNum Number of collapsed loops from 'collapse' clause.
528
  /// \param NumClauses Number of clauses.
529
  /// \param NumSpecialChildren Number of additional directive-specific stmts.
530
  ///
531
  template <typename T>
532
  OMPLoopDirective(const T *That, StmtClass SC, OpenMPDirectiveKind Kind,
533
                   SourceLocation StartLoc, SourceLocation EndLoc,
534
                   unsigned CollapsedNum, unsigned NumClauses,
535
                   unsigned NumSpecialChildren = 0)
536
      : OMPExecutableDirective(That, SC, Kind, StartLoc, EndLoc, NumClauses,
537
                               numLoopChildren(CollapsedNum, Kind) +
538
                                   NumSpecialChildren),
539
77.0k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPSimdDirective>(clang::OMPSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
3.17k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPForDirective>(clang::OMPForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
3.72k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPForSimdDirective>(clang::OMPForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
3.10k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPParallelForDirective>(clang::OMPParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
2.99k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPParallelForSimdDirective>(clang::OMPParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
3.43k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTargetParallelForDirective>(clang::OMPTargetParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
4.47k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTaskLoopDirective>(clang::OMPTaskLoopDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
2.84k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTaskLoopSimdDirective>(clang::OMPTaskLoopSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
3.20k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPDistributeDirective>(clang::OMPDistributeDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
1.23k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPDistributeParallelForDirective>(clang::OMPDistributeParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
3.11k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPDistributeParallelForSimdDirective>(clang::OMPDistributeParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
3.82k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPDistributeSimdDirective>(clang::OMPDistributeSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
2.73k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTargetParallelForSimdDirective>(clang::OMPTargetParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
4.72k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTargetSimdDirective>(clang::OMPTargetSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
4.36k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTeamsDistributeDirective>(clang::OMPTeamsDistributeDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
2.38k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTeamsDistributeSimdDirective>(clang::OMPTeamsDistributeSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
2.89k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTeamsDistributeParallelForSimdDirective>(clang::OMPTeamsDistributeParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
3.50k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTeamsDistributeParallelForDirective>(clang::OMPTeamsDistributeParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
2.96k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTargetTeamsDistributeDirective>(clang::OMPTargetTeamsDistributeDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
3.72k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTargetTeamsDistributeParallelForDirective>(clang::OMPTargetTeamsDistributeParallelForDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
4.34k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTargetTeamsDistributeParallelForSimdDirective>(clang::OMPTargetTeamsDistributeParallelForSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
5.45k
        CollapsedNum(CollapsedNum) {}
clang::OMPLoopDirective::OMPLoopDirective<clang::OMPTargetTeamsDistributeSimdDirective>(clang::OMPTargetTeamsDistributeSimdDirective const*, clang::Stmt::StmtClass, clang::OpenMPDirectiveKind, clang::SourceLocation, clang::SourceLocation, unsigned int, unsigned int, unsigned int)
Line
Count
Source
539
4.82k
        CollapsedNum(CollapsedNum) {}
540
541
  /// Offset to the start of children expression arrays.
542
629k
  static unsigned getArraysOffset(OpenMPDirectiveKind Kind) {
543
629k
    if (isOpenMPLoopBoundSharingDirective(Kind))
544
204k
      return CombinedDistributeEnd;
545
424k
    if (isOpenMPWorksharingDirective(Kind) || 
isOpenMPTaskLoopDirective(Kind)250k
||
546
424k
        
isOpenMPDistributeDirective(Kind)207k
)
547
362k
      return WorksharingEnd;
548
62.0k
    return DefaultEnd;
549
62.0k
  }
550
551
  /// Children number.
552
  static unsigned numLoopChildren(unsigned CollapsedNum,
553
154k
                                  OpenMPDirectiveKind Kind) {
554
154k
    return getArraysOffset(Kind) + 5 * CollapsedNum; // Counters,
555
154k
                                                     // PrivateCounters, Inits,
556
154k
                                                     // Updates and Finals
557
154k
  }
558
559
77.0k
  void setIterationVariable(Expr *IV) {
560
77.0k
    *std::next(child_begin(), IterationVariableOffset) = IV;
561
77.0k
  }
562
77.0k
  void setLastIteration(Expr *LI) {
563
77.0k
    *std::next(child_begin(), LastIterationOffset) = LI;
564
77.0k
  }
565
77.0k
  void setCalcLastIteration(Expr *CLI) {
566
77.0k
    *std::next(child_begin(), CalcLastIterationOffset) = CLI;
567
77.0k
  }
568
77.0k
  void setPreCond(Expr *PC) {
569
77.0k
    *std::next(child_begin(), PreConditionOffset) = PC;
570
77.0k
  }
571
77.0k
  void setCond(Expr *Cond) {
572
77.0k
    *std::next(child_begin(), CondOffset) = Cond;
573
77.0k
  }
574
77.0k
  void setInit(Expr *Init) { *std::next(child_begin(), InitOffset) = Init; }
575
77.0k
  void setInc(Expr *Inc) { *std::next(child_begin(), IncOffset) = Inc; }
576
77.0k
  void setPreInits(Stmt *PreInits) {
577
77.0k
    *std::next(child_begin(), PreInitsOffset) = PreInits;
578
77.0k
  }
579
69.4k
  void setIsLastIterVariable(Expr *IL) {
580
69.4k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
581
69.4k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
582
69.4k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
583
69.4k
           "expected worksharing loop directive");
584
69.4k
    *std::next(child_begin(), IsLastIterVariableOffset) = IL;
585
69.4k
  }
586
69.4k
  void setLowerBoundVariable(Expr *LB) {
587
69.4k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
588
69.4k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
589
69.4k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
590
69.4k
           "expected worksharing loop directive");
591
69.4k
    *std::next(child_begin(), LowerBoundVariableOffset) = LB;
592
69.4k
  }
593
69.4k
  void setUpperBoundVariable(Expr *UB) {
594
69.4k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
595
69.4k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
596
69.4k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
597
69.4k
           "expected worksharing loop directive");
598
69.4k
    *std::next(child_begin(), UpperBoundVariableOffset) = UB;
599
69.4k
  }
600
69.4k
  void setStrideVariable(Expr *ST) {
601
69.4k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
602
69.4k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
603
69.4k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
604
69.4k
           "expected worksharing loop directive");
605
69.4k
    *std::next(child_begin(), StrideVariableOffset) = ST;
606
69.4k
  }
607
69.4k
  void setEnsureUpperBound(Expr *EUB) {
608
69.4k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
609
69.4k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
610
69.4k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
611
69.4k
           "expected worksharing loop directive");
612
69.4k
    *std::next(child_begin(), EnsureUpperBoundOffset) = EUB;
613
69.4k
  }
614
69.4k
  void setNextLowerBound(Expr *NLB) {
615
69.4k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
616
69.4k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
617
69.4k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
618
69.4k
           "expected worksharing loop directive");
619
69.4k
    *std::next(child_begin(), NextLowerBoundOffset) = NLB;
620
69.4k
  }
621
69.4k
  void setNextUpperBound(Expr *NUB) {
622
69.4k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
623
69.4k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
624
69.4k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
625
69.4k
           "expected worksharing loop directive");
626
69.4k
    *std::next(child_begin(), NextUpperBoundOffset) = NUB;
627
69.4k
  }
628
69.4k
  void setNumIterations(Expr *NI) {
629
69.4k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
630
69.4k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
631
69.4k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
632
69.4k
           "expected worksharing loop directive");
633
69.4k
    *std::next(child_begin(), NumIterationsOffset) = NI;
634
69.4k
  }
635
23.2k
  void setPrevLowerBoundVariable(Expr *PrevLB) {
636
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
637
23.2k
           "expected loop bound sharing directive");
638
23.2k
    *std::next(child_begin(), PrevLowerBoundVariableOffset) = PrevLB;
639
23.2k
  }
640
23.2k
  void setPrevUpperBoundVariable(Expr *PrevUB) {
641
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
642
23.2k
           "expected loop bound sharing directive");
643
23.2k
    *std::next(child_begin(), PrevUpperBoundVariableOffset) = PrevUB;
644
23.2k
  }
645
23.2k
  void setDistInc(Expr *DistInc) {
646
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
647
23.2k
           "expected loop bound sharing directive");
648
23.2k
    *std::next(child_begin(), DistIncOffset) = DistInc;
649
23.2k
  }
650
23.2k
  void setPrevEnsureUpperBound(Expr *PrevEUB) {
651
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
652
23.2k
           "expected loop bound sharing directive");
653
23.2k
    *std::next(child_begin(), PrevEnsureUpperBoundOffset) = PrevEUB;
654
23.2k
  }
655
23.2k
  void setCombinedLowerBoundVariable(Expr *CombLB) {
656
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
657
23.2k
           "expected loop bound sharing directive");
658
23.2k
    *std::next(child_begin(), CombinedLowerBoundVariableOffset) = CombLB;
659
23.2k
  }
660
23.2k
  void setCombinedUpperBoundVariable(Expr *CombUB) {
661
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
662
23.2k
           "expected loop bound sharing directive");
663
23.2k
    *std::next(child_begin(), CombinedUpperBoundVariableOffset) = CombUB;
664
23.2k
  }
665
23.2k
  void setCombinedEnsureUpperBound(Expr *CombEUB) {
666
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
667
23.2k
           "expected loop bound sharing directive");
668
23.2k
    *std::next(child_begin(), CombinedEnsureUpperBoundOffset) = CombEUB;
669
23.2k
  }
670
23.2k
  void setCombinedInit(Expr *CombInit) {
671
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
672
23.2k
           "expected loop bound sharing directive");
673
23.2k
    *std::next(child_begin(), CombinedInitOffset) = CombInit;
674
23.2k
  }
675
23.2k
  void setCombinedCond(Expr *CombCond) {
676
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
677
23.2k
           "expected loop bound sharing directive");
678
23.2k
    *std::next(child_begin(), CombinedConditionOffset) = CombCond;
679
23.2k
  }
680
23.2k
  void setCombinedNextLowerBound(Expr *CombNLB) {
681
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
682
23.2k
           "expected loop bound sharing directive");
683
23.2k
    *std::next(child_begin(), CombinedNextLowerBoundOffset) = CombNLB;
684
23.2k
  }
685
23.2k
  void setCombinedNextUpperBound(Expr *CombNUB) {
686
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
687
23.2k
           "expected loop bound sharing directive");
688
23.2k
    *std::next(child_begin(), CombinedNextUpperBoundOffset) = CombNUB;
689
23.2k
  }
690
23.2k
  void setCombinedDistCond(Expr *CombDistCond) {
691
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
692
23.2k
           "expected loop bound distribute sharing directive");
693
23.2k
    *std::next(child_begin(), CombinedDistConditionOffset) = CombDistCond;
694
23.2k
  }
695
23.2k
  void setCombinedParForInDistCond(Expr *CombParForInDistCond) {
696
23.2k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
697
23.2k
           "expected loop bound distribute sharing directive");
698
23.2k
    *std::next(child_begin(),
699
23.2k
               CombinedParForInDistConditionOffset) = CombParForInDistCond;
700
23.2k
  }
701
  void setCounters(ArrayRef<Expr *> A);
702
  void setPrivateCounters(ArrayRef<Expr *> A);
703
  void setInits(ArrayRef<Expr *> A);
704
  void setUpdates(ArrayRef<Expr *> A);
705
  void setFinals(ArrayRef<Expr *> A);
706
707
public:
708
  /// The expressions built to support OpenMP loops in combined/composite
709
  /// pragmas (e.g. pragma omp distribute parallel for)
710
  struct DistCombinedHelperExprs {
711
    /// DistributeLowerBound - used when composing 'omp distribute' with
712
    /// 'omp for' in a same construct.
713
    Expr *LB;
714
    /// DistributeUpperBound - used when composing 'omp distribute' with
715
    /// 'omp for' in a same construct.
716
    Expr *UB;
717
    /// DistributeEnsureUpperBound - used when composing 'omp distribute'
718
    ///  with 'omp for' in a same construct, EUB depends on DistUB
719
    Expr *EUB;
720
    /// Distribute loop iteration variable init used when composing 'omp
721
    /// distribute'
722
    ///  with 'omp for' in a same construct
723
    Expr *Init;
724
    /// Distribute Loop condition used when composing 'omp distribute'
725
    ///  with 'omp for' in a same construct
726
    Expr *Cond;
727
    /// Update of LowerBound for statically scheduled omp loops for
728
    /// outer loop in combined constructs (e.g. 'distribute parallel for')
729
    Expr *NLB;
730
    /// Update of UpperBound for statically scheduled omp loops for
731
    /// outer loop in combined constructs (e.g. 'distribute parallel for')
732
    Expr *NUB;
733
    /// Distribute Loop condition used when composing 'omp distribute'
734
    ///  with 'omp for' in a same construct when schedule is chunked.
735
    Expr *DistCond;
736
    /// 'omp parallel for' loop condition used when composed with
737
    /// 'omp distribute' in the same construct and when schedule is
738
    /// chunked and the chunk size is 1.
739
    Expr *ParForInDistCond;
740
  };
741
742
  /// The expressions built for the OpenMP loop CodeGen for the
743
  /// whole collapsed loop nest.
744
  struct HelperExprs {
745
    /// Loop iteration variable.
746
    Expr *IterationVarRef;
747
    /// Loop last iteration number.
748
    Expr *LastIteration;
749
    /// Loop number of iterations.
750
    Expr *NumIterations;
751
    /// Calculation of last iteration.
752
    Expr *CalcLastIteration;
753
    /// Loop pre-condition.
754
    Expr *PreCond;
755
    /// Loop condition.
756
    Expr *Cond;
757
    /// Loop iteration variable init.
758
    Expr *Init;
759
    /// Loop increment.
760
    Expr *Inc;
761
    /// IsLastIteration - local flag variable passed to runtime.
762
    Expr *IL;
763
    /// LowerBound - local variable passed to runtime.
764
    Expr *LB;
765
    /// UpperBound - local variable passed to runtime.
766
    Expr *UB;
767
    /// Stride - local variable passed to runtime.
768
    Expr *ST;
769
    /// EnsureUpperBound -- expression UB = min(UB, NumIterations).
770
    Expr *EUB;
771
    /// Update of LowerBound for statically scheduled 'omp for' loops.
772
    Expr *NLB;
773
    /// Update of UpperBound for statically scheduled 'omp for' loops.
774
    Expr *NUB;
775
    /// PreviousLowerBound - local variable passed to runtime in the
776
    /// enclosing schedule or null if that does not apply.
777
    Expr *PrevLB;
778
    /// PreviousUpperBound - local variable passed to runtime in the
779
    /// enclosing schedule or null if that does not apply.
780
    Expr *PrevUB;
781
    /// DistInc - increment expression for distribute loop when found
782
    /// combined with a further loop level (e.g. in 'distribute parallel for')
783
    /// expression IV = IV + ST
784
    Expr *DistInc;
785
    /// PrevEUB - expression similar to EUB but to be used when loop
786
    /// scheduling uses PrevLB and PrevUB (e.g.  in 'distribute parallel for'
787
    /// when ensuring that the UB is either the calculated UB by the runtime or
788
    /// the end of the assigned distribute chunk)
789
    /// expression UB = min (UB, PrevUB)
790
    Expr *PrevEUB;
791
    /// Counters Loop counters.
792
    SmallVector<Expr *, 4> Counters;
793
    /// PrivateCounters Loop counters.
794
    SmallVector<Expr *, 4> PrivateCounters;
795
    /// Expressions for loop counters inits for CodeGen.
796
    SmallVector<Expr *, 4> Inits;
797
    /// Expressions for loop counters update for CodeGen.
798
    SmallVector<Expr *, 4> Updates;
799
    /// Final loop counter values for GodeGen.
800
    SmallVector<Expr *, 4> Finals;
801
    /// Init statement for all captured expressions.
802
    Stmt *PreInits;
803
804
    /// Expressions used when combining OpenMP loop pragmas
805
    DistCombinedHelperExprs DistCombinedFields;
806
807
    /// Check if all the expressions are built (does not check the
808
    /// worksharing ones).
809
0
    bool builtAll() {
810
0
      return IterationVarRef != nullptr && LastIteration != nullptr &&
811
0
             NumIterations != nullptr && PreCond != nullptr &&
812
0
             Cond != nullptr && Init != nullptr && Inc != nullptr;
813
0
    }
814
815
    /// Initialize all the fields to null.
816
    /// \param Size Number of elements in the counters/finals/updates arrays.
817
73.3k
    void clear(unsigned Size) {
818
73.3k
      IterationVarRef = nullptr;
819
73.3k
      LastIteration = nullptr;
820
73.3k
      CalcLastIteration = nullptr;
821
73.3k
      PreCond = nullptr;
822
73.3k
      Cond = nullptr;
823
73.3k
      Init = nullptr;
824
73.3k
      Inc = nullptr;
825
73.3k
      IL = nullptr;
826
73.3k
      LB = nullptr;
827
73.3k
      UB = nullptr;
828
73.3k
      ST = nullptr;
829
73.3k
      EUB = nullptr;
830
73.3k
      NLB = nullptr;
831
73.3k
      NUB = nullptr;
832
73.3k
      NumIterations = nullptr;
833
73.3k
      PrevLB = nullptr;
834
73.3k
      PrevUB = nullptr;
835
73.3k
      DistInc = nullptr;
836
73.3k
      PrevEUB = nullptr;
837
73.3k
      Counters.resize(Size);
838
73.3k
      PrivateCounters.resize(Size);
839
73.3k
      Inits.resize(Size);
840
73.3k
      Updates.resize(Size);
841
73.3k
      Finals.resize(Size);
842
147k
      for (unsigned i = 0; i < Size; 
++i74.4k
) {
843
74.4k
        Counters[i] = nullptr;
844
74.4k
        PrivateCounters[i] = nullptr;
845
74.4k
        Inits[i] = nullptr;
846
74.4k
        Updates[i] = nullptr;
847
74.4k
        Finals[i] = nullptr;
848
74.4k
      }
849
73.3k
      PreInits = nullptr;
850
73.3k
      DistCombinedFields.LB = nullptr;
851
73.3k
      DistCombinedFields.UB = nullptr;
852
73.3k
      DistCombinedFields.EUB = nullptr;
853
73.3k
      DistCombinedFields.Init = nullptr;
854
73.3k
      DistCombinedFields.Cond = nullptr;
855
73.3k
      DistCombinedFields.NLB = nullptr;
856
73.3k
      DistCombinedFields.NUB = nullptr;
857
73.3k
      DistCombinedFields.DistCond = nullptr;
858
73.3k
      DistCombinedFields.ParForInDistCond = nullptr;
859
73.3k
    }
860
  };
861
862
  /// Get number of collapsed loops.
863
8.40k
  unsigned getCollapsedNumber() const { return CollapsedNum; }
864
865
19.7k
  Expr *getIterationVariable() const {
866
19.7k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
867
19.7k
        *std::next(child_begin(), IterationVariableOffset)));
868
19.7k
  }
869
13.1k
  Expr *getLastIteration() const {
870
13.1k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
871
13.1k
        *std::next(child_begin(), LastIterationOffset)));
872
13.1k
  }
873
4.28k
  Expr *getCalcLastIteration() const {
874
4.28k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
875
4.28k
        *std::next(child_begin(), CalcLastIterationOffset)));
876
4.28k
  }
877
14.6k
  Expr *getPreCond() const {
878
14.6k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
879
14.6k
        *std::next(child_begin(), PreConditionOffset)));
880
14.6k
  }
881
10.8k
  Expr *getCond() const {
882
10.8k
    return const_cast<Expr *>(
883
10.8k
        reinterpret_cast<const Expr *>(*std::next(child_begin(), CondOffset)));
884
10.8k
  }
885
11.0k
  Expr *getInit() const {
886
11.0k
    return const_cast<Expr *>(
887
11.0k
        reinterpret_cast<const Expr *>(*std::next(child_begin(), InitOffset)));
888
11.0k
  }
889
11.0k
  Expr *getInc() const {
890
11.0k
    return const_cast<Expr *>(
891
11.0k
        reinterpret_cast<const Expr *>(*std::next(child_begin(), IncOffset)));
892
11.0k
  }
893
10.9k
  const Stmt *getPreInits() const {
894
10.9k
    return *std::next(child_begin(), PreInitsOffset);
895
10.9k
  }
896
4.28k
  Stmt *getPreInits() { return *std::next(child_begin(), PreInitsOffset); }
897
9.96k
  Expr *getIsLastIterVariable() const {
898
9.96k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
899
9.96k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
900
9.96k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
901
9.96k
           "expected worksharing loop directive");
902
9.96k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
903
9.96k
        *std::next(child_begin(), IsLastIterVariableOffset)));
904
9.96k
  }
905
9.97k
  Expr *getLowerBoundVariable() const {
906
9.97k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
907
9.97k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
908
9.97k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
909
9.97k
           "expected worksharing loop directive");
910
9.97k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
911
9.97k
        *std::next(child_begin(), LowerBoundVariableOffset)));
912
9.97k
  }
913
9.97k
  Expr *getUpperBoundVariable() const {
914
9.97k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
915
9.97k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
916
9.97k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
917
9.97k
           "expected worksharing loop directive");
918
9.97k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
919
9.97k
        *std::next(child_begin(), UpperBoundVariableOffset)));
920
9.97k
  }
921
10.0k
  Expr *getStrideVariable() const {
922
10.0k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
923
10.0k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
924
10.0k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
925
10.0k
           "expected worksharing loop directive");
926
10.0k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
927
10.0k
        *std::next(child_begin(), StrideVariableOffset)));
928
10.0k
  }
929
8.38k
  Expr *getEnsureUpperBound() const {
930
8.38k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
931
8.38k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
932
8.38k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
933
8.38k
           "expected worksharing loop directive");
934
8.38k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
935
8.38k
        *std::next(child_begin(), EnsureUpperBoundOffset)));
936
8.38k
  }
937
4.84k
  Expr *getNextLowerBound() const {
938
4.84k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
939
4.84k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
940
4.84k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
941
4.84k
           "expected worksharing loop directive");
942
4.84k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
943
4.84k
        *std::next(child_begin(), NextLowerBoundOffset)));
944
4.84k
  }
945
4.84k
  Expr *getNextUpperBound() const {
946
4.84k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
947
4.84k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
948
4.84k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
949
4.84k
           "expected worksharing loop directive");
950
4.84k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
951
4.84k
        *std::next(child_begin(), NextUpperBoundOffset)));
952
4.84k
  }
953
6.21k
  Expr *getNumIterations() const {
954
6.21k
    assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
955
6.21k
            isOpenMPTaskLoopDirective(getDirectiveKind()) ||
956
6.21k
            isOpenMPDistributeDirective(getDirectiveKind())) &&
957
6.21k
           "expected worksharing loop directive");
958
6.21k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
959
6.21k
        *std::next(child_begin(), NumIterationsOffset)));
960
6.21k
  }
961
8.94k
  Expr *getPrevLowerBoundVariable() const {
962
8.94k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
963
8.94k
           "expected loop bound sharing directive");
964
8.94k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
965
8.94k
        *std::next(child_begin(), PrevLowerBoundVariableOffset)));
966
8.94k
  }
967
8.94k
  Expr *getPrevUpperBoundVariable() const {
968
8.94k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
969
8.94k
           "expected loop bound sharing directive");
970
8.94k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
971
8.94k
        *std::next(child_begin(), PrevUpperBoundVariableOffset)));
972
8.94k
  }
973
3.60k
  Expr *getDistInc() const {
974
3.60k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
975
3.60k
           "expected loop bound sharing directive");
976
3.60k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
977
3.60k
        *std::next(child_begin(), DistIncOffset)));
978
3.60k
  }
979
3.48k
  Expr *getPrevEnsureUpperBound() const {
980
3.48k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
981
3.48k
           "expected loop bound sharing directive");
982
3.48k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
983
3.48k
        *std::next(child_begin(), PrevEnsureUpperBoundOffset)));
984
3.48k
  }
985
5.30k
  Expr *getCombinedLowerBoundVariable() const {
986
5.30k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
987
5.30k
           "expected loop bound sharing directive");
988
5.30k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
989
5.30k
        *std::next(child_begin(), CombinedLowerBoundVariableOffset)));
990
5.30k
  }
991
5.30k
  Expr *getCombinedUpperBoundVariable() const {
992
5.30k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
993
5.30k
           "expected loop bound sharing directive");
994
5.30k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
995
5.30k
        *std::next(child_begin(), CombinedUpperBoundVariableOffset)));
996
5.30k
  }
997
3.83k
  Expr *getCombinedEnsureUpperBound() const {
998
3.83k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
999
3.83k
           "expected loop bound sharing directive");
1000
3.83k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
1001
3.83k
        *std::next(child_begin(), CombinedEnsureUpperBoundOffset)));
1002
3.83k
  }
1003
3.83k
  Expr *getCombinedInit() const {
1004
3.83k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1005
3.83k
           "expected loop bound sharing directive");
1006
3.83k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
1007
3.83k
        *std::next(child_begin(), CombinedInitOffset)));
1008
3.83k
  }
1009
3.48k
  Expr *getCombinedCond() const {
1010
3.48k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1011
3.48k
           "expected loop bound sharing directive");
1012
3.48k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
1013
3.48k
        *std::next(child_begin(), CombinedConditionOffset)));
1014
3.48k
  }
1015
2.01k
  Expr *getCombinedNextLowerBound() const {
1016
2.01k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1017
2.01k
           "expected loop bound sharing directive");
1018
2.01k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
1019
2.01k
        *std::next(child_begin(), CombinedNextLowerBoundOffset)));
1020
2.01k
  }
1021
2.01k
  Expr *getCombinedNextUpperBound() const {
1022
2.01k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1023
2.01k
           "expected loop bound sharing directive");
1024
2.01k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
1025
2.01k
        *std::next(child_begin(), CombinedNextUpperBoundOffset)));
1026
2.01k
  }
1027
2.01k
  Expr *getCombinedDistCond() const {
1028
2.01k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1029
2.01k
           "expected loop bound distribute sharing directive");
1030
2.01k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
1031
2.01k
        *std::next(child_begin(), CombinedDistConditionOffset)));
1032
2.01k
  }
1033
1.78k
  Expr *getCombinedParForInDistCond() const {
1034
1.78k
    assert(isOpenMPLoopBoundSharingDirective(getDirectiveKind()) &&
1035
1.78k
           "expected loop bound distribute sharing directive");
1036
1.78k
    return const_cast<Expr *>(reinterpret_cast<const Expr *>(
1037
1.78k
        *std::next(child_begin(), CombinedParForInDistConditionOffset)));
1038
1.78k
  }
1039
86.4k
  const Stmt *getBody() const {
1040
86.4k
    // This relies on the loop form is already checked by Sema.
1041
86.4k
    const Stmt *Body =
1042
86.4k
        getInnermostCapturedStmt()->getCapturedStmt()->IgnoreContainers();
1043
86.4k
    Body = cast<ForStmt>(Body)->getBody();
1044
88.2k
    for (unsigned Cnt = 1; Cnt < CollapsedNum; 
++Cnt1.79k
) {
1045
1.79k
      Body = Body->IgnoreContainers();
1046
1.79k
      Body = cast<ForStmt>(Body)->getBody();
1047
1.79k
    }
1048
86.4k
    return Body;
1049
86.4k
  }
1050
1051
4.28k
  ArrayRef<Expr *> counters() { return getCounters(); }
1052
1053
38.2k
  ArrayRef<Expr *> counters() const {
1054
38.2k
    return const_cast<OMPLoopDirective *>(this)->getCounters();
1055
38.2k
  }
1056
1057
4.28k
  ArrayRef<Expr *> private_counters() { return getPrivateCounters(); }
1058
1059
15.7k
  ArrayRef<Expr *> private_counters() const {
1060
15.7k
    return const_cast<OMPLoopDirective *>(this)->getPrivateCounters();
1061
15.7k
  }
1062
1063
4.28k
  ArrayRef<Expr *> inits() { return getInits(); }
1064
1065
1.78k
  ArrayRef<Expr *> inits() const {
1066
1.78k
    return const_cast<OMPLoopDirective *>(this)->getInits();
1067
1.78k
  }
1068
1069
4.28k
  ArrayRef<Expr *> updates() { return getUpdates(); }
1070
1071
6.72k
  ArrayRef<Expr *> updates() const {
1072
6.72k
    return const_cast<OMPLoopDirective *>(this)->getUpdates();
1073
6.72k
  }
1074
1075
4.28k
  ArrayRef<Expr *> finals() { return getFinals(); }
1076
1077
5.85k
  ArrayRef<Expr *> finals() const {
1078
5.85k
    return const_cast<OMPLoopDirective *>(this)->getFinals();
1079
5.85k
  }
1080
1081
164k
  static bool classof(const Stmt *T) {
1082
164k
    return T->getStmtClass() == OMPSimdDirectiveClass ||
1083
164k
           
T->getStmtClass() == OMPForDirectiveClass160k
||
1084
164k
           
T->getStmtClass() == OMPForSimdDirectiveClass157k
||
1085
164k
           
T->getStmtClass() == OMPParallelForDirectiveClass153k
||
1086
164k
           
T->getStmtClass() == OMPParallelForSimdDirectiveClass150k
||
1087
164k
           
T->getStmtClass() == OMPTaskLoopDirectiveClass147k
||
1088
164k
           
T->getStmtClass() == OMPTaskLoopSimdDirectiveClass144k
||
1089
164k
           
T->getStmtClass() == OMPDistributeDirectiveClass140k
||
1090
164k
           
T->getStmtClass() == OMPTargetParallelForDirectiveClass139k
||
1091
164k
           
T->getStmtClass() == OMPDistributeParallelForDirectiveClass134k
||
1092
164k
           
T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass131k
||
1093
164k
           
T->getStmtClass() == OMPDistributeSimdDirectiveClass127k
||
1094
164k
           
T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass124k
||
1095
164k
           
T->getStmtClass() == OMPTargetSimdDirectiveClass119k
||
1096
164k
           
T->getStmtClass() == OMPTeamsDistributeDirectiveClass114k
||
1097
164k
           
T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass112k
||
1098
164k
           T->getStmtClass() ==
1099
109k
               OMPTeamsDistributeParallelForSimdDirectiveClass ||
1100
164k
           
T->getStmtClass() == OMPTeamsDistributeParallelForDirectiveClass105k
||
1101
164k
           T->getStmtClass() ==
1102
102k
               OMPTargetTeamsDistributeParallelForDirectiveClass ||
1103
164k
           T->getStmtClass() ==
1104
97.6k
               OMPTargetTeamsDistributeParallelForSimdDirectiveClass ||
1105
164k
           
T->getStmtClass() == OMPTargetTeamsDistributeDirectiveClass91.4k
||
1106
164k
           
T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass87.1k
;
1107
164k
  }
1108
};
1109
1110
/// This represents '#pragma omp simd' directive.
1111
///
1112
/// \code
1113
/// #pragma omp simd private(a,b) linear(i,j:s) reduction(+:c,d)
1114
/// \endcode
1115
/// In this example directive '#pragma omp simd' has clauses 'private'
1116
/// with the variables 'a' and 'b', 'linear' with variables 'i', 'j' and
1117
/// linear step 's', 'reduction' with operator '+' and variables 'c' and 'd'.
1118
///
1119
class OMPSimdDirective : public OMPLoopDirective {
1120
  friend class ASTStmtReader;
1121
  /// Build directive with the given start and end location.
1122
  ///
1123
  /// \param StartLoc Starting location of the directive kind.
1124
  /// \param EndLoc Ending location of the directive.
1125
  /// \param CollapsedNum Number of collapsed nested loops.
1126
  /// \param NumClauses Number of clauses.
1127
  ///
1128
  OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1129
                   unsigned CollapsedNum, unsigned NumClauses)
1130
      : OMPLoopDirective(this, OMPSimdDirectiveClass, OMPD_simd, StartLoc,
1131
3.09k
                         EndLoc, CollapsedNum, NumClauses) {}
1132
1133
  /// Build an empty directive.
1134
  ///
1135
  /// \param CollapsedNum Number of collapsed nested loops.
1136
  /// \param NumClauses Number of clauses.
1137
  ///
1138
  explicit OMPSimdDirective(unsigned CollapsedNum, unsigned NumClauses)
1139
      : OMPLoopDirective(this, OMPSimdDirectiveClass, OMPD_simd,
1140
                         SourceLocation(), SourceLocation(), CollapsedNum,
1141
84
                         NumClauses) {}
1142
1143
public:
1144
  /// Creates directive with a list of \a Clauses.
1145
  ///
1146
  /// \param C AST context.
1147
  /// \param StartLoc Starting location of the directive kind.
1148
  /// \param EndLoc Ending Location of the directive.
1149
  /// \param CollapsedNum Number of collapsed loops.
1150
  /// \param Clauses List of clauses.
1151
  /// \param AssociatedStmt Statement, associated with the directive.
1152
  /// \param Exprs Helper expressions for CodeGen.
1153
  ///
1154
  static OMPSimdDirective *Create(const ASTContext &C, SourceLocation StartLoc,
1155
                                  SourceLocation EndLoc, unsigned CollapsedNum,
1156
                                  ArrayRef<OMPClause *> Clauses,
1157
                                  Stmt *AssociatedStmt,
1158
                                  const HelperExprs &Exprs);
1159
1160
  /// Creates an empty directive with the place
1161
  /// for \a NumClauses clauses.
1162
  ///
1163
  /// \param C AST context.
1164
  /// \param CollapsedNum Number of collapsed nested loops.
1165
  /// \param NumClauses Number of clauses.
1166
  ///
1167
  static OMPSimdDirective *CreateEmpty(const ASTContext &C, unsigned NumClauses,
1168
                                       unsigned CollapsedNum, EmptyShell);
1169
1170
0
  static bool classof(const Stmt *T) {
1171
0
    return T->getStmtClass() == OMPSimdDirectiveClass;
1172
0
  }
1173
};
1174
1175
/// This represents '#pragma omp for' directive.
1176
///
1177
/// \code
1178
/// #pragma omp for private(a,b) reduction(+:c,d)
1179
/// \endcode
1180
/// In this example directive '#pragma omp for' has clauses 'private' with the
1181
/// variables 'a' and 'b' and 'reduction' with operator '+' and variables 'c'
1182
/// and 'd'.
1183
///
1184
class OMPForDirective : public OMPLoopDirective {
1185
  friend class ASTStmtReader;
1186
1187
  /// true if current directive has inner cancel directive.
1188
  bool HasCancel;
1189
1190
  /// Build directive with the given start and end location.
1191
  ///
1192
  /// \param StartLoc Starting location of the directive kind.
1193
  /// \param EndLoc Ending location of the directive.
1194
  /// \param CollapsedNum Number of collapsed nested loops.
1195
  /// \param NumClauses Number of clauses.
1196
  ///
1197
  OMPForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1198
                  unsigned CollapsedNum, unsigned NumClauses)
1199
      : OMPLoopDirective(this, OMPForDirectiveClass, OMPD_for, StartLoc, EndLoc,
1200
                         CollapsedNum, NumClauses),
1201
3.52k
        HasCancel(false) {}
1202
1203
  /// Build an empty directive.
1204
  ///
1205
  /// \param CollapsedNum Number of collapsed nested loops.
1206
  /// \param NumClauses Number of clauses.
1207
  ///
1208
  explicit OMPForDirective(unsigned CollapsedNum, unsigned NumClauses)
1209
      : OMPLoopDirective(this, OMPForDirectiveClass, OMPD_for, SourceLocation(),
1210
                         SourceLocation(), CollapsedNum, NumClauses),
1211
202
        HasCancel(false) {}
1212
1213
  /// Set cancel state.
1214
3.72k
  void setHasCancel(bool Has) { HasCancel = Has; }
1215
1216
public:
1217
  /// Creates directive with a list of \a Clauses.
1218
  ///
1219
  /// \param C AST context.
1220
  /// \param StartLoc Starting location of the directive kind.
1221
  /// \param EndLoc Ending Location of the directive.
1222
  /// \param CollapsedNum Number of collapsed loops.
1223
  /// \param Clauses List of clauses.
1224
  /// \param AssociatedStmt Statement, associated with the directive.
1225
  /// \param Exprs Helper expressions for CodeGen.
1226
  /// \param HasCancel true if current directive has inner cancel directive.
1227
  ///
1228
  static OMPForDirective *Create(const ASTContext &C, SourceLocation StartLoc,
1229
                                 SourceLocation EndLoc, unsigned CollapsedNum,
1230
                                 ArrayRef<OMPClause *> Clauses,
1231
                                 Stmt *AssociatedStmt, const HelperExprs &Exprs,
1232
                                 bool HasCancel);
1233
1234
  /// Creates an empty directive with the place
1235
  /// for \a NumClauses clauses.
1236
  ///
1237
  /// \param C AST context.
1238
  /// \param CollapsedNum Number of collapsed nested loops.
1239
  /// \param NumClauses Number of clauses.
1240
  ///
1241
  static OMPForDirective *CreateEmpty(const ASTContext &C, unsigned NumClauses,
1242
                                      unsigned CollapsedNum, EmptyShell);
1243
1244
  /// Return true if current directive has inner cancel directive.
1245
668
  bool hasCancel() const { return HasCancel; }
1246
1247
0
  static bool classof(const Stmt *T) {
1248
0
    return T->getStmtClass() == OMPForDirectiveClass;
1249
0
  }
1250
};
1251
1252
/// This represents '#pragma omp for simd' directive.
1253
///
1254
/// \code
1255
/// #pragma omp for simd private(a,b) linear(i,j:s) reduction(+:c,d)
1256
/// \endcode
1257
/// In this example directive '#pragma omp for simd' has clauses 'private'
1258
/// with the variables 'a' and 'b', 'linear' with variables 'i', 'j' and
1259
/// linear step 's', 'reduction' with operator '+' and variables 'c' and 'd'.
1260
///
1261
class OMPForSimdDirective : public OMPLoopDirective {
1262
  friend class ASTStmtReader;
1263
  /// Build directive with the given start and end location.
1264
  ///
1265
  /// \param StartLoc Starting location of the directive kind.
1266
  /// \param EndLoc Ending location of the directive.
1267
  /// \param CollapsedNum Number of collapsed nested loops.
1268
  /// \param NumClauses Number of clauses.
1269
  ///
1270
  OMPForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1271
                      unsigned CollapsedNum, unsigned NumClauses)
1272
      : OMPLoopDirective(this, OMPForSimdDirectiveClass, OMPD_for_simd,
1273
3.05k
                         StartLoc, EndLoc, CollapsedNum, NumClauses) {}
1274
1275
  /// Build an empty directive.
1276
  ///
1277
  /// \param CollapsedNum Number of collapsed nested loops.
1278
  /// \param NumClauses Number of clauses.
1279
  ///
1280
  explicit OMPForSimdDirective(unsigned CollapsedNum, unsigned NumClauses)
1281
      : OMPLoopDirective(this, OMPForSimdDirectiveClass, OMPD_for_simd,
1282
                         SourceLocation(), SourceLocation(), CollapsedNum,
1283
54
                         NumClauses) {}
1284
1285
public:
1286
  /// Creates directive with a list of \a Clauses.
1287
  ///
1288
  /// \param C AST context.
1289
  /// \param StartLoc Starting location of the directive kind.
1290
  /// \param EndLoc Ending Location of the directive.
1291
  /// \param CollapsedNum Number of collapsed loops.
1292
  /// \param Clauses List of clauses.
1293
  /// \param AssociatedStmt Statement, associated with the directive.
1294
  /// \param Exprs Helper expressions for CodeGen.
1295
  ///
1296
  static OMPForSimdDirective *
1297
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1298
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1299
         Stmt *AssociatedStmt, const HelperExprs &Exprs);
1300
1301
  /// Creates an empty directive with the place
1302
  /// for \a NumClauses clauses.
1303
  ///
1304
  /// \param C AST context.
1305
  /// \param CollapsedNum Number of collapsed nested loops.
1306
  /// \param NumClauses Number of clauses.
1307
  ///
1308
  static OMPForSimdDirective *CreateEmpty(const ASTContext &C,
1309
                                          unsigned NumClauses,
1310
                                          unsigned CollapsedNum, EmptyShell);
1311
1312
0
  static bool classof(const Stmt *T) {
1313
0
    return T->getStmtClass() == OMPForSimdDirectiveClass;
1314
0
  }
1315
};
1316
1317
/// This represents '#pragma omp sections' directive.
1318
///
1319
/// \code
1320
/// #pragma omp sections private(a,b) reduction(+:c,d)
1321
/// \endcode
1322
/// In this example directive '#pragma omp sections' has clauses 'private' with
1323
/// the variables 'a' and 'b' and 'reduction' with operator '+' and variables
1324
/// 'c' and 'd'.
1325
///
1326
class OMPSectionsDirective : public OMPExecutableDirective {
1327
  friend class ASTStmtReader;
1328
1329
  /// true if current directive has inner cancel directive.
1330
  bool HasCancel;
1331
1332
  /// Build directive with the given start and end location.
1333
  ///
1334
  /// \param StartLoc Starting location of the directive kind.
1335
  /// \param EndLoc Ending location of the directive.
1336
  /// \param NumClauses Number of clauses.
1337
  ///
1338
  OMPSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1339
                       unsigned NumClauses)
1340
      : OMPExecutableDirective(this, OMPSectionsDirectiveClass, OMPD_sections,
1341
                               StartLoc, EndLoc, NumClauses, 1),
1342
1.66k
        HasCancel(false) {}
1343
1344
  /// Build an empty directive.
1345
  ///
1346
  /// \param NumClauses Number of clauses.
1347
  ///
1348
  explicit OMPSectionsDirective(unsigned NumClauses)
1349
      : OMPExecutableDirective(this, OMPSectionsDirectiveClass, OMPD_sections,
1350
                               SourceLocation(), SourceLocation(), NumClauses,
1351
                               1),
1352
40
        HasCancel(false) {}
1353
1354
  /// Set cancel state.
1355
1.70k
  void setHasCancel(bool Has) { HasCancel = Has; }
1356
1357
public:
1358
  /// Creates directive with a list of \a Clauses.
1359
  ///
1360
  /// \param C AST context.
1361
  /// \param StartLoc Starting location of the directive kind.
1362
  /// \param EndLoc Ending Location of the directive.
1363
  /// \param Clauses List of clauses.
1364
  /// \param AssociatedStmt Statement, associated with the directive.
1365
  /// \param HasCancel true if current directive has inner directive.
1366
  ///
1367
  static OMPSectionsDirective *
1368
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1369
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel);
1370
1371
  /// Creates an empty directive with the place for \a NumClauses
1372
  /// clauses.
1373
  ///
1374
  /// \param C AST context.
1375
  /// \param NumClauses Number of clauses.
1376
  ///
1377
  static OMPSectionsDirective *CreateEmpty(const ASTContext &C,
1378
                                           unsigned NumClauses, EmptyShell);
1379
1380
  /// Return true if current directive has inner cancel directive.
1381
80
  bool hasCancel() const { return HasCancel; }
1382
1383
52
  static bool classof(const Stmt *T) {
1384
52
    return T->getStmtClass() == OMPSectionsDirectiveClass;
1385
52
  }
1386
};
1387
1388
/// This represents '#pragma omp section' directive.
1389
///
1390
/// \code
1391
/// #pragma omp section
1392
/// \endcode
1393
///
1394
class OMPSectionDirective : public OMPExecutableDirective {
1395
  friend class ASTStmtReader;
1396
1397
  /// true if current directive has inner cancel directive.
1398
  bool HasCancel;
1399
1400
  /// Build directive with the given start and end location.
1401
  ///
1402
  /// \param StartLoc Starting location of the directive kind.
1403
  /// \param EndLoc Ending location of the directive.
1404
  ///
1405
  OMPSectionDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1406
      : OMPExecutableDirective(this, OMPSectionDirectiveClass, OMPD_section,
1407
                               StartLoc, EndLoc, 0, 1),
1408
359
        HasCancel(false) {}
1409
1410
  /// Build an empty directive.
1411
  ///
1412
  explicit OMPSectionDirective()
1413
      : OMPExecutableDirective(this, OMPSectionDirectiveClass, OMPD_section,
1414
                               SourceLocation(), SourceLocation(), 0, 1),
1415
38
        HasCancel(false) {}
1416
1417
public:
1418
  /// Creates directive.
1419
  ///
1420
  /// \param C AST context.
1421
  /// \param StartLoc Starting location of the directive kind.
1422
  /// \param EndLoc Ending Location of the directive.
1423
  /// \param AssociatedStmt Statement, associated with the directive.
1424
  /// \param HasCancel true if current directive has inner directive.
1425
  ///
1426
  static OMPSectionDirective *Create(const ASTContext &C,
1427
                                     SourceLocation StartLoc,
1428
                                     SourceLocation EndLoc,
1429
                                     Stmt *AssociatedStmt, bool HasCancel);
1430
1431
  /// Creates an empty directive.
1432
  ///
1433
  /// \param C AST context.
1434
  ///
1435
  static OMPSectionDirective *CreateEmpty(const ASTContext &C, EmptyShell);
1436
1437
  /// Set cancel state.
1438
527
  void setHasCancel(bool Has) { HasCancel = Has; }
1439
1440
  /// Return true if current directive has inner cancel directive.
1441
74
  bool hasCancel() const { return HasCancel; }
1442
1443
136
  static bool classof(const Stmt *T) {
1444
136
    return T->getStmtClass() == OMPSectionDirectiveClass;
1445
136
  }
1446
};
1447
1448
/// This represents '#pragma omp single' directive.
1449
///
1450
/// \code
1451
/// #pragma omp single private(a,b) copyprivate(c,d)
1452
/// \endcode
1453
/// In this example directive '#pragma omp single' has clauses 'private' with
1454
/// the variables 'a' and 'b' and 'copyprivate' with variables 'c' and 'd'.
1455
///
1456
class OMPSingleDirective : public OMPExecutableDirective {
1457
  friend class ASTStmtReader;
1458
  /// Build directive with the given start and end location.
1459
  ///
1460
  /// \param StartLoc Starting location of the directive kind.
1461
  /// \param EndLoc Ending location of the directive.
1462
  /// \param NumClauses Number of clauses.
1463
  ///
1464
  OMPSingleDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1465
                     unsigned NumClauses)
1466
      : OMPExecutableDirective(this, OMPSingleDirectiveClass, OMPD_single,
1467
939
                               StartLoc, EndLoc, NumClauses, 1) {}
1468
1469
  /// Build an empty directive.
1470
  ///
1471
  /// \param NumClauses Number of clauses.
1472
  ///
1473
  explicit OMPSingleDirective(unsigned NumClauses)
1474
      : OMPExecutableDirective(this, OMPSingleDirectiveClass, OMPD_single,
1475
                               SourceLocation(), SourceLocation(), NumClauses,
1476
36
                               1) {}
1477
1478
public:
1479
  /// Creates directive with a list of \a Clauses.
1480
  ///
1481
  /// \param C AST context.
1482
  /// \param StartLoc Starting location of the directive kind.
1483
  /// \param EndLoc Ending Location of the directive.
1484
  /// \param Clauses List of clauses.
1485
  /// \param AssociatedStmt Statement, associated with the directive.
1486
  ///
1487
  static OMPSingleDirective *
1488
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1489
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
1490
1491
  /// Creates an empty directive with the place for \a NumClauses
1492
  /// clauses.
1493
  ///
1494
  /// \param C AST context.
1495
  /// \param NumClauses Number of clauses.
1496
  ///
1497
  static OMPSingleDirective *CreateEmpty(const ASTContext &C,
1498
                                         unsigned NumClauses, EmptyShell);
1499
1500
0
  static bool classof(const Stmt *T) {
1501
0
    return T->getStmtClass() == OMPSingleDirectiveClass;
1502
0
  }
1503
};
1504
1505
/// This represents '#pragma omp master' directive.
1506
///
1507
/// \code
1508
/// #pragma omp master
1509
/// \endcode
1510
///
1511
class OMPMasterDirective : public OMPExecutableDirective {
1512
  friend class ASTStmtReader;
1513
  /// Build directive with the given start and end location.
1514
  ///
1515
  /// \param StartLoc Starting location of the directive kind.
1516
  /// \param EndLoc Ending location of the directive.
1517
  ///
1518
  OMPMasterDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1519
      : OMPExecutableDirective(this, OMPMasterDirectiveClass, OMPD_master,
1520
367
                               StartLoc, EndLoc, 0, 1) {}
1521
1522
  /// Build an empty directive.
1523
  ///
1524
  explicit OMPMasterDirective()
1525
      : OMPExecutableDirective(this, OMPMasterDirectiveClass, OMPD_master,
1526
8
                               SourceLocation(), SourceLocation(), 0, 1) {}
1527
1528
public:
1529
  /// Creates directive.
1530
  ///
1531
  /// \param C AST context.
1532
  /// \param StartLoc Starting location of the directive kind.
1533
  /// \param EndLoc Ending Location of the directive.
1534
  /// \param AssociatedStmt Statement, associated with the directive.
1535
  ///
1536
  static OMPMasterDirective *Create(const ASTContext &C,
1537
                                    SourceLocation StartLoc,
1538
                                    SourceLocation EndLoc,
1539
                                    Stmt *AssociatedStmt);
1540
1541
  /// Creates an empty directive.
1542
  ///
1543
  /// \param C AST context.
1544
  ///
1545
  static OMPMasterDirective *CreateEmpty(const ASTContext &C, EmptyShell);
1546
1547
0
  static bool classof(const Stmt *T) {
1548
0
    return T->getStmtClass() == OMPMasterDirectiveClass;
1549
0
  }
1550
};
1551
1552
/// This represents '#pragma omp critical' directive.
1553
///
1554
/// \code
1555
/// #pragma omp critical
1556
/// \endcode
1557
///
1558
class OMPCriticalDirective : public OMPExecutableDirective {
1559
  friend class ASTStmtReader;
1560
  /// Name of the directive.
1561
  DeclarationNameInfo DirName;
1562
  /// Build directive with the given start and end location.
1563
  ///
1564
  /// \param Name Name of the directive.
1565
  /// \param StartLoc Starting location of the directive kind.
1566
  /// \param EndLoc Ending location of the directive.
1567
  /// \param NumClauses Number of clauses.
1568
  ///
1569
  OMPCriticalDirective(const DeclarationNameInfo &Name, SourceLocation StartLoc,
1570
                       SourceLocation EndLoc, unsigned NumClauses)
1571
      : OMPExecutableDirective(this, OMPCriticalDirectiveClass, OMPD_critical,
1572
                               StartLoc, EndLoc, NumClauses, 1),
1573
653
        DirName(Name) {}
1574
1575
  /// Build an empty directive.
1576
  ///
1577
  /// \param NumClauses Number of clauses.
1578
  ///
1579
  explicit OMPCriticalDirective(unsigned NumClauses)
1580
      : OMPExecutableDirective(this, OMPCriticalDirectiveClass, OMPD_critical,
1581
                               SourceLocation(), SourceLocation(), NumClauses,
1582
                               1),
1583
24
        DirName() {}
1584
1585
  /// Set name of the directive.
1586
  ///
1587
  /// \param Name Name of the directive.
1588
  ///
1589
0
  void setDirectiveName(const DeclarationNameInfo &Name) { DirName = Name; }
1590
1591
public:
1592
  /// Creates directive.
1593
  ///
1594
  /// \param C AST context.
1595
  /// \param Name Name of the directive.
1596
  /// \param StartLoc Starting location of the directive kind.
1597
  /// \param EndLoc Ending Location of the directive.
1598
  /// \param Clauses List of clauses.
1599
  /// \param AssociatedStmt Statement, associated with the directive.
1600
  ///
1601
  static OMPCriticalDirective *
1602
  Create(const ASTContext &C, const DeclarationNameInfo &Name,
1603
         SourceLocation StartLoc, SourceLocation EndLoc,
1604
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
1605
1606
  /// Creates an empty directive.
1607
  ///
1608
  /// \param C AST context.
1609
  /// \param NumClauses Number of clauses.
1610
  ///
1611
  static OMPCriticalDirective *CreateEmpty(const ASTContext &C,
1612
                                           unsigned NumClauses, EmptyShell);
1613
1614
  /// Return name of the directive.
1615
  ///
1616
603
  DeclarationNameInfo getDirectiveName() const { return DirName; }
1617
1618
0
  static bool classof(const Stmt *T) {
1619
0
    return T->getStmtClass() == OMPCriticalDirectiveClass;
1620
0
  }
1621
};
1622
1623
/// This represents '#pragma omp parallel for' directive.
1624
///
1625
/// \code
1626
/// #pragma omp parallel for private(a,b) reduction(+:c,d)
1627
/// \endcode
1628
/// In this example directive '#pragma omp parallel for' has clauses 'private'
1629
/// with the variables 'a' and 'b' and 'reduction' with operator '+' and
1630
/// variables 'c' and 'd'.
1631
///
1632
class OMPParallelForDirective : public OMPLoopDirective {
1633
  friend class ASTStmtReader;
1634
1635
  /// true if current region has inner cancel directive.
1636
  bool HasCancel;
1637
1638
  /// Build directive with the given start and end location.
1639
  ///
1640
  /// \param StartLoc Starting location of the directive kind.
1641
  /// \param EndLoc Ending location of the directive.
1642
  /// \param CollapsedNum Number of collapsed nested loops.
1643
  /// \param NumClauses Number of clauses.
1644
  ///
1645
  OMPParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1646
                          unsigned CollapsedNum, unsigned NumClauses)
1647
      : OMPLoopDirective(this, OMPParallelForDirectiveClass, OMPD_parallel_for,
1648
                         StartLoc, EndLoc, CollapsedNum, NumClauses),
1649
2.93k
        HasCancel(false) {}
1650
1651
  /// Build an empty directive.
1652
  ///
1653
  /// \param CollapsedNum Number of collapsed nested loops.
1654
  /// \param NumClauses Number of clauses.
1655
  ///
1656
  explicit OMPParallelForDirective(unsigned CollapsedNum, unsigned NumClauses)
1657
      : OMPLoopDirective(this, OMPParallelForDirectiveClass, OMPD_parallel_for,
1658
                         SourceLocation(), SourceLocation(), CollapsedNum,
1659
                         NumClauses),
1660
60
        HasCancel(false) {}
1661
1662
  /// Set cancel state.
1663
2.99k
  void setHasCancel(bool Has) { HasCancel = Has; }
1664
1665
public:
1666
  /// Creates directive with a list of \a Clauses.
1667
  ///
1668
  /// \param C AST context.
1669
  /// \param StartLoc Starting location of the directive kind.
1670
  /// \param EndLoc Ending Location of the directive.
1671
  /// \param CollapsedNum Number of collapsed loops.
1672
  /// \param Clauses List of clauses.
1673
  /// \param AssociatedStmt Statement, associated with the directive.
1674
  /// \param Exprs Helper expressions for CodeGen.
1675
  /// \param HasCancel true if current directive has inner cancel directive.
1676
  ///
1677
  static OMPParallelForDirective *
1678
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1679
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1680
         Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel);
1681
1682
  /// Creates an empty directive with the place
1683
  /// for \a NumClauses clauses.
1684
  ///
1685
  /// \param C AST context.
1686
  /// \param CollapsedNum Number of collapsed nested loops.
1687
  /// \param NumClauses Number of clauses.
1688
  ///
1689
  static OMPParallelForDirective *CreateEmpty(const ASTContext &C,
1690
                                              unsigned NumClauses,
1691
                                              unsigned CollapsedNum,
1692
                                              EmptyShell);
1693
1694
  /// Return true if current directive has inner cancel directive.
1695
334
  bool hasCancel() const { return HasCancel; }
1696
1697
6.67k
  static bool classof(const Stmt *T) {
1698
6.67k
    return T->getStmtClass() == OMPParallelForDirectiveClass;
1699
6.67k
  }
1700
};
1701
1702
/// This represents '#pragma omp parallel for simd' directive.
1703
///
1704
/// \code
1705
/// #pragma omp parallel for simd private(a,b) linear(i,j:s) reduction(+:c,d)
1706
/// \endcode
1707
/// In this example directive '#pragma omp parallel for simd' has clauses
1708
/// 'private' with the variables 'a' and 'b', 'linear' with variables 'i', 'j'
1709
/// and linear step 's', 'reduction' with operator '+' and variables 'c' and
1710
/// 'd'.
1711
///
1712
class OMPParallelForSimdDirective : public OMPLoopDirective {
1713
  friend class ASTStmtReader;
1714
  /// Build directive with the given start and end location.
1715
  ///
1716
  /// \param StartLoc Starting location of the directive kind.
1717
  /// \param EndLoc Ending location of the directive.
1718
  /// \param CollapsedNum Number of collapsed nested loops.
1719
  /// \param NumClauses Number of clauses.
1720
  ///
1721
  OMPParallelForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1722
                              unsigned CollapsedNum, unsigned NumClauses)
1723
      : OMPLoopDirective(this, OMPParallelForSimdDirectiveClass,
1724
                         OMPD_parallel_for_simd, StartLoc, EndLoc, CollapsedNum,
1725
3.38k
                         NumClauses) {}
1726
1727
  /// Build an empty directive.
1728
  ///
1729
  /// \param CollapsedNum Number of collapsed nested loops.
1730
  /// \param NumClauses Number of clauses.
1731
  ///
1732
  explicit OMPParallelForSimdDirective(unsigned CollapsedNum,
1733
                                       unsigned NumClauses)
1734
      : OMPLoopDirective(this, OMPParallelForSimdDirectiveClass,
1735
                         OMPD_parallel_for_simd, SourceLocation(),
1736
52
                         SourceLocation(), CollapsedNum, NumClauses) {}
1737
1738
public:
1739
  /// Creates directive with a list of \a Clauses.
1740
  ///
1741
  /// \param C AST context.
1742
  /// \param StartLoc Starting location of the directive kind.
1743
  /// \param EndLoc Ending Location of the directive.
1744
  /// \param CollapsedNum Number of collapsed loops.
1745
  /// \param Clauses List of clauses.
1746
  /// \param AssociatedStmt Statement, associated with the directive.
1747
  /// \param Exprs Helper expressions for CodeGen.
1748
  ///
1749
  static OMPParallelForSimdDirective *
1750
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1751
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
1752
         Stmt *AssociatedStmt, const HelperExprs &Exprs);
1753
1754
  /// Creates an empty directive with the place
1755
  /// for \a NumClauses clauses.
1756
  ///
1757
  /// \param C AST context.
1758
  /// \param CollapsedNum Number of collapsed nested loops.
1759
  /// \param NumClauses Number of clauses.
1760
  ///
1761
  static OMPParallelForSimdDirective *CreateEmpty(const ASTContext &C,
1762
                                                  unsigned NumClauses,
1763
                                                  unsigned CollapsedNum,
1764
                                                  EmptyShell);
1765
1766
0
  static bool classof(const Stmt *T) {
1767
0
    return T->getStmtClass() == OMPParallelForSimdDirectiveClass;
1768
0
  }
1769
};
1770
1771
/// This represents '#pragma omp parallel sections' directive.
1772
///
1773
/// \code
1774
/// #pragma omp parallel sections private(a,b) reduction(+:c,d)
1775
/// \endcode
1776
/// In this example directive '#pragma omp parallel sections' has clauses
1777
/// 'private' with the variables 'a' and 'b' and 'reduction' with operator '+'
1778
/// and variables 'c' and 'd'.
1779
///
1780
class OMPParallelSectionsDirective : public OMPExecutableDirective {
1781
  friend class ASTStmtReader;
1782
1783
  /// true if current directive has inner cancel directive.
1784
  bool HasCancel;
1785
1786
  /// Build directive with the given start and end location.
1787
  ///
1788
  /// \param StartLoc Starting location of the directive kind.
1789
  /// \param EndLoc Ending location of the directive.
1790
  /// \param NumClauses Number of clauses.
1791
  ///
1792
  OMPParallelSectionsDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1793
                               unsigned NumClauses)
1794
      : OMPExecutableDirective(this, OMPParallelSectionsDirectiveClass,
1795
                               OMPD_parallel_sections, StartLoc, EndLoc,
1796
                               NumClauses, 1),
1797
1.76k
        HasCancel(false) {}
1798
1799
  /// Build an empty directive.
1800
  ///
1801
  /// \param NumClauses Number of clauses.
1802
  ///
1803
  explicit OMPParallelSectionsDirective(unsigned NumClauses)
1804
      : OMPExecutableDirective(this, OMPParallelSectionsDirectiveClass,
1805
                               OMPD_parallel_sections, SourceLocation(),
1806
                               SourceLocation(), NumClauses, 1),
1807
22
        HasCancel(false) {}
1808
1809
  /// Set cancel state.
1810
1.78k
  void setHasCancel(bool Has) { HasCancel = Has; }
1811
1812
public:
1813
  /// Creates directive with a list of \a Clauses.
1814
  ///
1815
  /// \param C AST context.
1816
  /// \param StartLoc Starting location of the directive kind.
1817
  /// \param EndLoc Ending Location of the directive.
1818
  /// \param Clauses List of clauses.
1819
  /// \param AssociatedStmt Statement, associated with the directive.
1820
  /// \param HasCancel true if current directive has inner cancel directive.
1821
  ///
1822
  static OMPParallelSectionsDirective *
1823
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
1824
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel);
1825
1826
  /// Creates an empty directive with the place for \a NumClauses
1827
  /// clauses.
1828
  ///
1829
  /// \param C AST context.
1830
  /// \param NumClauses Number of clauses.
1831
  ///
1832
  static OMPParallelSectionsDirective *
1833
  CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell);
1834
1835
  /// Return true if current directive has inner cancel directive.
1836
46
  bool hasCancel() const { return HasCancel; }
1837
1838
6.69k
  static bool classof(const Stmt *T) {
1839
6.69k
    return T->getStmtClass() == OMPParallelSectionsDirectiveClass;
1840
6.69k
  }
1841
};
1842
1843
/// This represents '#pragma omp task' directive.
1844
///
1845
/// \code
1846
/// #pragma omp task private(a,b) final(d)
1847
/// \endcode
1848
/// In this example directive '#pragma omp task' has clauses 'private' with the
1849
/// variables 'a' and 'b' and 'final' with condition 'd'.
1850
///
1851
class OMPTaskDirective : public OMPExecutableDirective {
1852
  friend class ASTStmtReader;
1853
  /// true if this directive has inner cancel directive.
1854
  bool HasCancel;
1855
1856
  /// Build directive with the given start and end location.
1857
  ///
1858
  /// \param StartLoc Starting location of the directive kind.
1859
  /// \param EndLoc Ending location of the directive.
1860
  /// \param NumClauses Number of clauses.
1861
  ///
1862
  OMPTaskDirective(SourceLocation StartLoc, SourceLocation EndLoc,
1863
                   unsigned NumClauses)
1864
      : OMPExecutableDirective(this, OMPTaskDirectiveClass, OMPD_task, StartLoc,
1865
                               EndLoc, NumClauses, 1),
1866
1.84k
        HasCancel(false) {}
1867
1868
  /// Build an empty directive.
1869
  ///
1870
  /// \param NumClauses Number of clauses.
1871
  ///
1872
  explicit OMPTaskDirective(unsigned NumClauses)
1873
      : OMPExecutableDirective(this, OMPTaskDirectiveClass, OMPD_task,
1874
                               SourceLocation(), SourceLocation(), NumClauses,
1875
                               1),
1876
100
        HasCancel(false) {}
1877
1878
  /// Set cancel state.
1879
1.94k
  void setHasCancel(bool Has) { HasCancel = Has; }
1880
1881
public:
1882
  /// Creates directive with a list of \a Clauses.
1883
  ///
1884
  /// \param C AST context.
1885
  /// \param StartLoc Starting location of the directive kind.
1886
  /// \param EndLoc Ending Location of the directive.
1887
  /// \param Clauses List of clauses.
1888
  /// \param AssociatedStmt Statement, associated with the directive.
1889
  /// \param HasCancel true, if current directive has inner cancel directive.
1890
  ///
1891
  static OMPTaskDirective *Create(const ASTContext &C, SourceLocation StartLoc,
1892
                                  SourceLocation EndLoc,
1893
                                  ArrayRef<OMPClause *> Clauses,
1894
                                  Stmt *AssociatedStmt, bool HasCancel);
1895
1896
  /// Creates an empty directive with the place for \a NumClauses
1897
  /// clauses.
1898
  ///
1899
  /// \param C AST context.
1900
  /// \param NumClauses Number of clauses.
1901
  ///
1902
  static OMPTaskDirective *CreateEmpty(const ASTContext &C, unsigned NumClauses,
1903
                                       EmptyShell);
1904
1905
  /// Return true if current directive has inner cancel directive.
1906
185
  bool hasCancel() const { return HasCancel; }
1907
1908
442
  static bool classof(const Stmt *T) {
1909
442
    return T->getStmtClass() == OMPTaskDirectiveClass;
1910
442
  }
1911
};
1912
1913
/// This represents '#pragma omp taskyield' directive.
1914
///
1915
/// \code
1916
/// #pragma omp taskyield
1917
/// \endcode
1918
///
1919
class OMPTaskyieldDirective : public OMPExecutableDirective {
1920
  friend class ASTStmtReader;
1921
  /// Build directive with the given start and end location.
1922
  ///
1923
  /// \param StartLoc Starting location of the directive kind.
1924
  /// \param EndLoc Ending location of the directive.
1925
  ///
1926
  OMPTaskyieldDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1927
      : OMPExecutableDirective(this, OMPTaskyieldDirectiveClass, OMPD_taskyield,
1928
290
                               StartLoc, EndLoc, 0, 0) {}
1929
1930
  /// Build an empty directive.
1931
  ///
1932
  explicit OMPTaskyieldDirective()
1933
      : OMPExecutableDirective(this, OMPTaskyieldDirectiveClass, OMPD_taskyield,
1934
10
                               SourceLocation(), SourceLocation(), 0, 0) {}
1935
1936
public:
1937
  /// Creates directive.
1938
  ///
1939
  /// \param C AST context.
1940
  /// \param StartLoc Starting location of the directive kind.
1941
  /// \param EndLoc Ending Location of the directive.
1942
  ///
1943
  static OMPTaskyieldDirective *
1944
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
1945
1946
  /// Creates an empty directive.
1947
  ///
1948
  /// \param C AST context.
1949
  ///
1950
  static OMPTaskyieldDirective *CreateEmpty(const ASTContext &C, EmptyShell);
1951
1952
1.79k
  static bool classof(const Stmt *T) {
1953
1.79k
    return T->getStmtClass() == OMPTaskyieldDirectiveClass;
1954
1.79k
  }
1955
};
1956
1957
/// This represents '#pragma omp barrier' directive.
1958
///
1959
/// \code
1960
/// #pragma omp barrier
1961
/// \endcode
1962
///
1963
class OMPBarrierDirective : public OMPExecutableDirective {
1964
  friend class ASTStmtReader;
1965
  /// Build directive with the given start and end location.
1966
  ///
1967
  /// \param StartLoc Starting location of the directive kind.
1968
  /// \param EndLoc Ending location of the directive.
1969
  ///
1970
  OMPBarrierDirective(SourceLocation StartLoc, SourceLocation EndLoc)
1971
      : OMPExecutableDirective(this, OMPBarrierDirectiveClass, OMPD_barrier,
1972
254
                               StartLoc, EndLoc, 0, 0) {}
1973
1974
  /// Build an empty directive.
1975
  ///
1976
  explicit OMPBarrierDirective()
1977
      : OMPExecutableDirective(this, OMPBarrierDirectiveClass, OMPD_barrier,
1978
22
                               SourceLocation(), SourceLocation(), 0, 0) {}
1979
1980
public:
1981
  /// Creates directive.
1982
  ///
1983
  /// \param C AST context.
1984
  /// \param StartLoc Starting location of the directive kind.
1985
  /// \param EndLoc Ending Location of the directive.
1986
  ///
1987
  static OMPBarrierDirective *
1988
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
1989
1990
  /// Creates an empty directive.
1991
  ///
1992
  /// \param C AST context.
1993
  ///
1994
  static OMPBarrierDirective *CreateEmpty(const ASTContext &C, EmptyShell);
1995
1996
1.79k
  static bool classof(const Stmt *T) {
1997
1.79k
    return T->getStmtClass() == OMPBarrierDirectiveClass;
1998
1.79k
  }
1999
};
2000
2001
/// This represents '#pragma omp taskwait' directive.
2002
///
2003
/// \code
2004
/// #pragma omp taskwait
2005
/// \endcode
2006
///
2007
class OMPTaskwaitDirective : public OMPExecutableDirective {
2008
  friend class ASTStmtReader;
2009
  /// Build directive with the given start and end location.
2010
  ///
2011
  /// \param StartLoc Starting location of the directive kind.
2012
  /// \param EndLoc Ending location of the directive.
2013
  ///
2014
  OMPTaskwaitDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2015
      : OMPExecutableDirective(this, OMPTaskwaitDirectiveClass, OMPD_taskwait,
2016
276
                               StartLoc, EndLoc, 0, 0) {}
2017
2018
  /// Build an empty directive.
2019
  ///
2020
  explicit OMPTaskwaitDirective()
2021
      : OMPExecutableDirective(this, OMPTaskwaitDirectiveClass, OMPD_taskwait,
2022
10
                               SourceLocation(), SourceLocation(), 0, 0) {}
2023
2024
public:
2025
  /// Creates directive.
2026
  ///
2027
  /// \param C AST context.
2028
  /// \param StartLoc Starting location of the directive kind.
2029
  /// \param EndLoc Ending Location of the directive.
2030
  ///
2031
  static OMPTaskwaitDirective *
2032
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
2033
2034
  /// Creates an empty directive.
2035
  ///
2036
  /// \param C AST context.
2037
  ///
2038
  static OMPTaskwaitDirective *CreateEmpty(const ASTContext &C, EmptyShell);
2039
2040
0
  static bool classof(const Stmt *T) {
2041
0
    return T->getStmtClass() == OMPTaskwaitDirectiveClass;
2042
0
  }
2043
};
2044
2045
/// This represents '#pragma omp taskgroup' directive.
2046
///
2047
/// \code
2048
/// #pragma omp taskgroup
2049
/// \endcode
2050
///
2051
class OMPTaskgroupDirective : public OMPExecutableDirective {
2052
  friend class ASTStmtReader;
2053
  /// Build directive with the given start and end location.
2054
  ///
2055
  /// \param StartLoc Starting location of the directive kind.
2056
  /// \param EndLoc Ending location of the directive.
2057
  /// \param NumClauses Number of clauses.
2058
  ///
2059
  OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2060
                        unsigned NumClauses)
2061
      : OMPExecutableDirective(this, OMPTaskgroupDirectiveClass, OMPD_taskgroup,
2062
1.77k
                               StartLoc, EndLoc, NumClauses, 2) {}
2063
2064
  /// Build an empty directive.
2065
  /// \param NumClauses Number of clauses.
2066
  ///
2067
  explicit OMPTaskgroupDirective(unsigned NumClauses)
2068
      : OMPExecutableDirective(this, OMPTaskgroupDirectiveClass, OMPD_taskgroup,
2069
                               SourceLocation(), SourceLocation(), NumClauses,
2070
52
                               2) {}
2071
2072
  /// Sets the task_reduction return variable.
2073
1.82k
  void setReductionRef(Expr *RR) {
2074
1.82k
    *std::next(child_begin(), 1) = RR;
2075
1.82k
  }
2076
2077
public:
2078
  /// Creates directive.
2079
  ///
2080
  /// \param C AST context.
2081
  /// \param StartLoc Starting location of the directive kind.
2082
  /// \param EndLoc Ending Location of the directive.
2083
  /// \param Clauses List of clauses.
2084
  /// \param AssociatedStmt Statement, associated with the directive.
2085
  /// \param ReductionRef Reference to the task_reduction return variable.
2086
  ///
2087
  static OMPTaskgroupDirective *
2088
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2089
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
2090
         Expr *ReductionRef);
2091
2092
  /// Creates an empty directive.
2093
  ///
2094
  /// \param C AST context.
2095
  /// \param NumClauses Number of clauses.
2096
  ///
2097
  static OMPTaskgroupDirective *CreateEmpty(const ASTContext &C,
2098
                                            unsigned NumClauses, EmptyShell);
2099
2100
2101
  /// Returns reference to the task_reduction return variable.
2102
100
  const Expr *getReductionRef() const {
2103
100
    return static_cast<const Expr *>(*std::next(child_begin(), 1));
2104
100
  }
2105
52
  Expr *getReductionRef() {
2106
52
    return static_cast<Expr *>(*std::next(child_begin(), 1));
2107
52
  }
2108
2109
9.29k
  static bool classof(const Stmt *T) {
2110
9.29k
    return T->getStmtClass() == OMPTaskgroupDirectiveClass;
2111
9.29k
  }
2112
};
2113
2114
/// This represents '#pragma omp flush' directive.
2115
///
2116
/// \code
2117
/// #pragma omp flush(a,b)
2118
/// \endcode
2119
/// In this example directive '#pragma omp flush' has 2 arguments- variables 'a'
2120
/// and 'b'.
2121
/// 'omp flush' directive does not have clauses but have an optional list of
2122
/// variables to flush. This list of variables is stored within some fake clause
2123
/// FlushClause.
2124
class OMPFlushDirective : public OMPExecutableDirective {
2125
  friend class ASTStmtReader;
2126
  /// Build directive with the given start and end location.
2127
  ///
2128
  /// \param StartLoc Starting location of the directive kind.
2129
  /// \param EndLoc Ending location of the directive.
2130
  /// \param NumClauses Number of clauses.
2131
  ///
2132
  OMPFlushDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2133
                    unsigned NumClauses)
2134
      : OMPExecutableDirective(this, OMPFlushDirectiveClass, OMPD_flush,
2135
344
                               StartLoc, EndLoc, NumClauses, 0) {}
2136
2137
  /// Build an empty directive.
2138
  ///
2139
  /// \param NumClauses Number of clauses.
2140
  ///
2141
  explicit OMPFlushDirective(unsigned NumClauses)
2142
      : OMPExecutableDirective(this, OMPFlushDirectiveClass, OMPD_flush,
2143
                               SourceLocation(), SourceLocation(), NumClauses,
2144
16
                               0) {}
2145
2146
public:
2147
  /// Creates directive with a list of \a Clauses.
2148
  ///
2149
  /// \param C AST context.
2150
  /// \param StartLoc Starting location of the directive kind.
2151
  /// \param EndLoc Ending Location of the directive.
2152
  /// \param Clauses List of clauses (only single OMPFlushClause clause is
2153
  /// allowed).
2154
  ///
2155
  static OMPFlushDirective *Create(const ASTContext &C, SourceLocation StartLoc,
2156
                                   SourceLocation EndLoc,
2157
                                   ArrayRef<OMPClause *> Clauses);
2158
2159
  /// Creates an empty directive with the place for \a NumClauses
2160
  /// clauses.
2161
  ///
2162
  /// \param C AST context.
2163
  /// \param NumClauses Number of clauses.
2164
  ///
2165
  static OMPFlushDirective *CreateEmpty(const ASTContext &C,
2166
                                        unsigned NumClauses, EmptyShell);
2167
2168
1.79k
  static bool classof(const Stmt *T) {
2169
1.79k
    return T->getStmtClass() == OMPFlushDirectiveClass;
2170
1.79k
  }
2171
};
2172
2173
/// This represents '#pragma omp ordered' directive.
2174
///
2175
/// \code
2176
/// #pragma omp ordered
2177
/// \endcode
2178
///
2179
class OMPOrderedDirective : public OMPExecutableDirective {
2180
  friend class ASTStmtReader;
2181
  /// Build directive with the given start and end location.
2182
  ///
2183
  /// \param StartLoc Starting location of the directive kind.
2184
  /// \param EndLoc Ending location of the directive.
2185
  /// \param NumClauses Number of clauses.
2186
  ///
2187
  OMPOrderedDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2188
                      unsigned NumClauses)
2189
      : OMPExecutableDirective(this, OMPOrderedDirectiveClass, OMPD_ordered,
2190
666
                               StartLoc, EndLoc, NumClauses, 1) {}
2191
2192
  /// Build an empty directive.
2193
  ///
2194
  /// \param NumClauses Number of clauses.
2195
  ///
2196
  explicit OMPOrderedDirective(unsigned NumClauses)
2197
      : OMPExecutableDirective(this, OMPOrderedDirectiveClass, OMPD_ordered,
2198
                               SourceLocation(), SourceLocation(), NumClauses,
2199
52
                               1) {}
2200
2201
public:
2202
  /// Creates directive.
2203
  ///
2204
  /// \param C AST context.
2205
  /// \param StartLoc Starting location of the directive kind.
2206
  /// \param EndLoc Ending Location of the directive.
2207
  /// \param Clauses List of clauses.
2208
  /// \param AssociatedStmt Statement, associated with the directive.
2209
  ///
2210
  static OMPOrderedDirective *
2211
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2212
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2213
2214
  /// Creates an empty directive.
2215
  ///
2216
  /// \param C AST context.
2217
  /// \param NumClauses Number of clauses.
2218
  ///
2219
  static OMPOrderedDirective *CreateEmpty(const ASTContext &C,
2220
                                          unsigned NumClauses, EmptyShell);
2221
2222
0
  static bool classof(const Stmt *T) {
2223
0
    return T->getStmtClass() == OMPOrderedDirectiveClass;
2224
0
  }
2225
};
2226
2227
/// This represents '#pragma omp atomic' directive.
2228
///
2229
/// \code
2230
/// #pragma omp atomic capture
2231
/// \endcode
2232
/// In this example directive '#pragma omp atomic' has clause 'capture'.
2233
///
2234
class OMPAtomicDirective : public OMPExecutableDirective {
2235
  friend class ASTStmtReader;
2236
  /// Used for 'atomic update' or 'atomic capture' constructs. They may
2237
  /// have atomic expressions of forms
2238
  /// \code
2239
  /// x = x binop expr;
2240
  /// x = expr binop x;
2241
  /// \endcode
2242
  /// This field is true for the first form of the expression and false for the
2243
  /// second. Required for correct codegen of non-associative operations (like
2244
  /// << or >>).
2245
  bool IsXLHSInRHSPart;
2246
  /// Used for 'atomic update' or 'atomic capture' constructs. They may
2247
  /// have atomic expressions of forms
2248
  /// \code
2249
  /// v = x; <update x>;
2250
  /// <update x>; v = x;
2251
  /// \endcode
2252
  /// This field is true for the first(postfix) form of the expression and false
2253
  /// otherwise.
2254
  bool IsPostfixUpdate;
2255
2256
  /// Build directive with the given start and end location.
2257
  ///
2258
  /// \param StartLoc Starting location of the directive kind.
2259
  /// \param EndLoc Ending location of the directive.
2260
  /// \param NumClauses Number of clauses.
2261
  ///
2262
  OMPAtomicDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2263
                     unsigned NumClauses)
2264
      : OMPExecutableDirective(this, OMPAtomicDirectiveClass, OMPD_atomic,
2265
                               StartLoc, EndLoc, NumClauses, 5),
2266
1.81k
        IsXLHSInRHSPart(false), IsPostfixUpdate(false) {}
2267
2268
  /// Build an empty directive.
2269
  ///
2270
  /// \param NumClauses Number of clauses.
2271
  ///
2272
  explicit OMPAtomicDirective(unsigned NumClauses)
2273
      : OMPExecutableDirective(this, OMPAtomicDirectiveClass, OMPD_atomic,
2274
                               SourceLocation(), SourceLocation(), NumClauses,
2275
                               5),
2276
430
        IsXLHSInRHSPart(false), IsPostfixUpdate(false) {}
2277
2278
  /// Set 'x' part of the associated expression/statement.
2279
2.24k
  void setX(Expr *X) { *std::next(child_begin()) = X; }
2280
  /// Set helper expression of the form
2281
  /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or
2282
  /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
2283
2.24k
  void setUpdateExpr(Expr *UE) { *std::next(child_begin(), 2) = UE; }
2284
  /// Set 'v' part of the associated expression/statement.
2285
2.24k
  void setV(Expr *V) { *std::next(child_begin(), 3) = V; }
2286
  /// Set 'expr' part of the associated expression/statement.
2287
2.24k
  void setExpr(Expr *E) { *std::next(child_begin(), 4) = E; }
2288
2289
public:
2290
  /// Creates directive with a list of \a Clauses and 'x', 'v' and 'expr'
2291
  /// parts of the atomic construct (see Section 2.12.6, atomic Construct, for
2292
  /// detailed description of 'x', 'v' and 'expr').
2293
  ///
2294
  /// \param C AST context.
2295
  /// \param StartLoc Starting location of the directive kind.
2296
  /// \param EndLoc Ending Location of the directive.
2297
  /// \param Clauses List of clauses.
2298
  /// \param AssociatedStmt Statement, associated with the directive.
2299
  /// \param X 'x' part of the associated expression/statement.
2300
  /// \param V 'v' part of the associated expression/statement.
2301
  /// \param E 'expr' part of the associated expression/statement.
2302
  /// \param UE Helper expression of the form
2303
  /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or
2304
  /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
2305
  /// \param IsXLHSInRHSPart true if \a UE has the first form and false if the
2306
  /// second.
2307
  /// \param IsPostfixUpdate true if original value of 'x' must be stored in
2308
  /// 'v', not an updated one.
2309
  static OMPAtomicDirective *
2310
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2311
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
2312
         Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate);
2313
2314
  /// Creates an empty directive with the place for \a NumClauses
2315
  /// clauses.
2316
  ///
2317
  /// \param C AST context.
2318
  /// \param NumClauses Number of clauses.
2319
  ///
2320
  static OMPAtomicDirective *CreateEmpty(const ASTContext &C,
2321
                                         unsigned NumClauses, EmptyShell);
2322
2323
  /// Get 'x' part of the associated expression/statement.
2324
430
  Expr *getX() { return cast_or_null<Expr>(*std::next(child_begin())); }
2325
418
  const Expr *getX() const {
2326
418
    return cast_or_null<Expr>(*std::next(child_begin()));
2327
418
  }
2328
  /// Get helper expression of the form
2329
  /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or
2330
  /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
2331
430
  Expr *getUpdateExpr() {
2332
430
    return cast_or_null<Expr>(*std::next(child_begin(), 2));
2333
430
  }
2334
418
  const Expr *getUpdateExpr() const {
2335
418
    return cast_or_null<Expr>(*std::next(child_begin(), 2));
2336
418
  }
2337
  /// Return true if helper update expression has form
2338
  /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and false if it has form
2339
  /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
2340
848
  bool isXLHSInRHSPart() const { return IsXLHSInRHSPart; }
2341
  /// Return true if 'v' expression must be updated to original value of
2342
  /// 'x', false if 'v' must be updated to the new value of 'x'.
2343
848
  bool isPostfixUpdate() const { return IsPostfixUpdate; }
2344
  /// Get 'v' part of the associated expression/statement.
2345
430
  Expr *getV() { return cast_or_null<Expr>(*std::next(child_begin(), 3)); }
2346
418
  const Expr *getV() const {
2347
418
    return cast_or_null<Expr>(*std::next(child_begin(), 3));
2348
418
  }
2349
  /// Get 'expr' part of the associated expression/statement.
2350
430
  Expr *getExpr() { return cast_or_null<Expr>(*std::next(child_begin(), 4)); }
2351
418
  const Expr *getExpr() const {
2352
418
    return cast_or_null<Expr>(*std::next(child_begin(), 4));
2353
418
  }
2354
2355
0
  static bool classof(const Stmt *T) {
2356
0
    return T->getStmtClass() == OMPAtomicDirectiveClass;
2357
0
  }
2358
};
2359
2360
/// This represents '#pragma omp target' directive.
2361
///
2362
/// \code
2363
/// #pragma omp target if(a)
2364
/// \endcode
2365
/// In this example directive '#pragma omp target' has clause 'if' with
2366
/// condition 'a'.
2367
///
2368
class OMPTargetDirective : public OMPExecutableDirective {
2369
  friend class ASTStmtReader;
2370
  /// Build directive with the given start and end location.
2371
  ///
2372
  /// \param StartLoc Starting location of the directive kind.
2373
  /// \param EndLoc Ending location of the directive.
2374
  /// \param NumClauses Number of clauses.
2375
  ///
2376
  OMPTargetDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2377
                     unsigned NumClauses)
2378
      : OMPExecutableDirective(this, OMPTargetDirectiveClass, OMPD_target,
2379
27.8k
                               StartLoc, EndLoc, NumClauses, 1) {}
2380
2381
  /// Build an empty directive.
2382
  ///
2383
  /// \param NumClauses Number of clauses.
2384
  ///
2385
  explicit OMPTargetDirective(unsigned NumClauses)
2386
      : OMPExecutableDirective(this, OMPTargetDirectiveClass, OMPD_target,
2387
                               SourceLocation(), SourceLocation(), NumClauses,
2388
2.51k
                               1) {}
2389
2390
public:
2391
  /// Creates directive with a list of \a Clauses.
2392
  ///
2393
  /// \param C AST context.
2394
  /// \param StartLoc Starting location of the directive kind.
2395
  /// \param EndLoc Ending Location of the directive.
2396
  /// \param Clauses List of clauses.
2397
  /// \param AssociatedStmt Statement, associated with the directive.
2398
  ///
2399
  static OMPTargetDirective *
2400
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2401
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2402
2403
  /// Creates an empty directive with the place for \a NumClauses
2404
  /// clauses.
2405
  ///
2406
  /// \param C AST context.
2407
  /// \param NumClauses Number of clauses.
2408
  ///
2409
  static OMPTargetDirective *CreateEmpty(const ASTContext &C,
2410
                                         unsigned NumClauses, EmptyShell);
2411
2412
0
  static bool classof(const Stmt *T) {
2413
0
    return T->getStmtClass() == OMPTargetDirectiveClass;
2414
0
  }
2415
};
2416
2417
/// This represents '#pragma omp target data' directive.
2418
///
2419
/// \code
2420
/// #pragma omp target data device(0) if(a) map(b[:])
2421
/// \endcode
2422
/// In this example directive '#pragma omp target data' has clauses 'device'
2423
/// with the value '0', 'if' with condition 'a' and 'map' with array
2424
/// section 'b[:]'.
2425
///
2426
class OMPTargetDataDirective : public OMPExecutableDirective {
2427
  friend class ASTStmtReader;
2428
  /// Build directive with the given start and end location.
2429
  ///
2430
  /// \param StartLoc Starting location of the directive kind.
2431
  /// \param EndLoc Ending Location of the directive.
2432
  /// \param NumClauses The number of clauses.
2433
  ///
2434
  OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2435
                         unsigned NumClauses)
2436
      : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
2437
                               OMPD_target_data, StartLoc, EndLoc, NumClauses,
2438
1.27k
                               1) {}
2439
2440
  /// Build an empty directive.
2441
  ///
2442
  /// \param NumClauses Number of clauses.
2443
  ///
2444
  explicit OMPTargetDataDirective(unsigned NumClauses)
2445
      : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
2446
                               OMPD_target_data, SourceLocation(),
2447
148
                               SourceLocation(), NumClauses, 1) {}
2448
2449
public:
2450
  /// Creates directive with a list of \a Clauses.
2451
  ///
2452
  /// \param C AST context.
2453
  /// \param StartLoc Starting location of the directive kind.
2454
  /// \param EndLoc Ending Location of the directive.
2455
  /// \param Clauses List of clauses.
2456
  /// \param AssociatedStmt Statement, associated with the directive.
2457
  ///
2458
  static OMPTargetDataDirective *
2459
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2460
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2461
2462
  /// Creates an empty directive with the place for \a N clauses.
2463
  ///
2464
  /// \param C AST context.
2465
  /// \param N The number of clauses.
2466
  ///
2467
  static OMPTargetDataDirective *CreateEmpty(const ASTContext &C, unsigned N,
2468
                                             EmptyShell);
2469
2470
0
  static bool classof(const Stmt *T) {
2471
0
    return T->getStmtClass() == OMPTargetDataDirectiveClass;
2472
0
  }
2473
};
2474
2475
/// This represents '#pragma omp target enter data' directive.
2476
///
2477
/// \code
2478
/// #pragma omp target enter data device(0) if(a) map(b[:])
2479
/// \endcode
2480
/// In this example directive '#pragma omp target enter data' has clauses
2481
/// 'device' with the value '0', 'if' with condition 'a' and 'map' with array
2482
/// section 'b[:]'.
2483
///
2484
class OMPTargetEnterDataDirective : public OMPExecutableDirective {
2485
  friend class ASTStmtReader;
2486
  /// Build directive with the given start and end location.
2487
  ///
2488
  /// \param StartLoc Starting location of the directive kind.
2489
  /// \param EndLoc Ending Location of the directive.
2490
  /// \param NumClauses The number of clauses.
2491
  ///
2492
  OMPTargetEnterDataDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2493
                              unsigned NumClauses)
2494
      : OMPExecutableDirective(this, OMPTargetEnterDataDirectiveClass,
2495
                               OMPD_target_enter_data, StartLoc, EndLoc,
2496
860
                               NumClauses, /*NumChildren=*/1) {}
2497
2498
  /// Build an empty directive.
2499
  ///
2500
  /// \param NumClauses Number of clauses.
2501
  ///
2502
  explicit OMPTargetEnterDataDirective(unsigned NumClauses)
2503
      : OMPExecutableDirective(this, OMPTargetEnterDataDirectiveClass,
2504
                               OMPD_target_enter_data, SourceLocation(),
2505
                               SourceLocation(), NumClauses,
2506
152
                               /*NumChildren=*/1) {}
2507
2508
public:
2509
  /// Creates directive with a list of \a Clauses.
2510
  ///
2511
  /// \param C AST context.
2512
  /// \param StartLoc Starting location of the directive kind.
2513
  /// \param EndLoc Ending Location of the directive.
2514
  /// \param Clauses List of clauses.
2515
  /// \param AssociatedStmt Statement, associated with the directive.
2516
  ///
2517
  static OMPTargetEnterDataDirective *
2518
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2519
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2520
2521
  /// Creates an empty directive with the place for \a N clauses.
2522
  ///
2523
  /// \param C AST context.
2524
  /// \param N The number of clauses.
2525
  ///
2526
  static OMPTargetEnterDataDirective *CreateEmpty(const ASTContext &C,
2527
                                                  unsigned N, EmptyShell);
2528
2529
161k
  static bool classof(const Stmt *T) {
2530
161k
    return T->getStmtClass() == OMPTargetEnterDataDirectiveClass;
2531
161k
  }
2532
};
2533
2534
/// This represents '#pragma omp target exit data' directive.
2535
///
2536
/// \code
2537
/// #pragma omp target exit data device(0) if(a) map(b[:])
2538
/// \endcode
2539
/// In this example directive '#pragma omp target exit data' has clauses
2540
/// 'device' with the value '0', 'if' with condition 'a' and 'map' with array
2541
/// section 'b[:]'.
2542
///
2543
class OMPTargetExitDataDirective : public OMPExecutableDirective {
2544
  friend class ASTStmtReader;
2545
  /// Build directive with the given start and end location.
2546
  ///
2547
  /// \param StartLoc Starting location of the directive kind.
2548
  /// \param EndLoc Ending Location of the directive.
2549
  /// \param NumClauses The number of clauses.
2550
  ///
2551
  OMPTargetExitDataDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2552
                             unsigned NumClauses)
2553
      : OMPExecutableDirective(this, OMPTargetExitDataDirectiveClass,
2554
                               OMPD_target_exit_data, StartLoc, EndLoc,
2555
872
                               NumClauses, /*NumChildren=*/1) {}
2556
2557
  /// Build an empty directive.
2558
  ///
2559
  /// \param NumClauses Number of clauses.
2560
  ///
2561
  explicit OMPTargetExitDataDirective(unsigned NumClauses)
2562
      : OMPExecutableDirective(this, OMPTargetExitDataDirectiveClass,
2563
                               OMPD_target_exit_data, SourceLocation(),
2564
                               SourceLocation(), NumClauses,
2565
152
                               /*NumChildren=*/1) {}
2566
2567
public:
2568
  /// Creates directive with a list of \a Clauses.
2569
  ///
2570
  /// \param C AST context.
2571
  /// \param StartLoc Starting location of the directive kind.
2572
  /// \param EndLoc Ending Location of the directive.
2573
  /// \param Clauses List of clauses.
2574
  /// \param AssociatedStmt Statement, associated with the directive.
2575
  ///
2576
  static OMPTargetExitDataDirective *
2577
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2578
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2579
2580
  /// Creates an empty directive with the place for \a N clauses.
2581
  ///
2582
  /// \param C AST context.
2583
  /// \param N The number of clauses.
2584
  ///
2585
  static OMPTargetExitDataDirective *CreateEmpty(const ASTContext &C,
2586
                                                 unsigned N, EmptyShell);
2587
2588
160k
  static bool classof(const Stmt *T) {
2589
160k
    return T->getStmtClass() == OMPTargetExitDataDirectiveClass;
2590
160k
  }
2591
};
2592
2593
/// This represents '#pragma omp target parallel' directive.
2594
///
2595
/// \code
2596
/// #pragma omp target parallel if(a)
2597
/// \endcode
2598
/// In this example directive '#pragma omp target parallel' has clause 'if' with
2599
/// condition 'a'.
2600
///
2601
class OMPTargetParallelDirective : public OMPExecutableDirective {
2602
  friend class ASTStmtReader;
2603
  /// Build directive with the given start and end location.
2604
  ///
2605
  /// \param StartLoc Starting location of the directive kind.
2606
  /// \param EndLoc Ending location of the directive.
2607
  /// \param NumClauses Number of clauses.
2608
  ///
2609
  OMPTargetParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2610
                             unsigned NumClauses)
2611
      : OMPExecutableDirective(this, OMPTargetParallelDirectiveClass,
2612
                               OMPD_target_parallel, StartLoc, EndLoc,
2613
3.79k
                               NumClauses, /*NumChildren=*/1) {}
2614
2615
  /// Build an empty directive.
2616
  ///
2617
  /// \param NumClauses Number of clauses.
2618
  ///
2619
  explicit OMPTargetParallelDirective(unsigned NumClauses)
2620
      : OMPExecutableDirective(this, OMPTargetParallelDirectiveClass,
2621
                               OMPD_target_parallel, SourceLocation(),
2622
                               SourceLocation(), NumClauses,
2623
380
                               /*NumChildren=*/1) {}
2624
2625
public:
2626
  /// Creates directive with a list of \a Clauses.
2627
  ///
2628
  /// \param C AST context.
2629
  /// \param StartLoc Starting location of the directive kind.
2630
  /// \param EndLoc Ending Location of the directive.
2631
  /// \param Clauses List of clauses.
2632
  /// \param AssociatedStmt Statement, associated with the directive.
2633
  ///
2634
  static OMPTargetParallelDirective *
2635
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2636
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
2637
2638
  /// Creates an empty directive with the place for \a NumClauses
2639
  /// clauses.
2640
  ///
2641
  /// \param C AST context.
2642
  /// \param NumClauses Number of clauses.
2643
  ///
2644
  static OMPTargetParallelDirective *
2645
  CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell);
2646
2647
0
  static bool classof(const Stmt *T) {
2648
0
    return T->getStmtClass() == OMPTargetParallelDirectiveClass;
2649
0
  }
2650
};
2651
2652
/// This represents '#pragma omp target parallel for' directive.
2653
///
2654
/// \code
2655
/// #pragma omp target parallel for private(a,b) reduction(+:c,d)
2656
/// \endcode
2657
/// In this example directive '#pragma omp target parallel for' has clauses
2658
/// 'private' with the variables 'a' and 'b' and 'reduction' with operator '+'
2659
/// and variables 'c' and 'd'.
2660
///
2661
class OMPTargetParallelForDirective : public OMPLoopDirective {
2662
  friend class ASTStmtReader;
2663
2664
  /// true if current region has inner cancel directive.
2665
  bool HasCancel;
2666
2667
  /// Build directive with the given start and end location.
2668
  ///
2669
  /// \param StartLoc Starting location of the directive kind.
2670
  /// \param EndLoc Ending location of the directive.
2671
  /// \param CollapsedNum Number of collapsed nested loops.
2672
  /// \param NumClauses Number of clauses.
2673
  ///
2674
  OMPTargetParallelForDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2675
                                unsigned CollapsedNum, unsigned NumClauses)
2676
      : OMPLoopDirective(this, OMPTargetParallelForDirectiveClass,
2677
                         OMPD_target_parallel_for, StartLoc, EndLoc,
2678
                         CollapsedNum, NumClauses),
2679
4.18k
        HasCancel(false) {}
2680
2681
  /// Build an empty directive.
2682
  ///
2683
  /// \param CollapsedNum Number of collapsed nested loops.
2684
  /// \param NumClauses Number of clauses.
2685
  ///
2686
  explicit OMPTargetParallelForDirective(unsigned CollapsedNum,
2687
                                         unsigned NumClauses)
2688
      : OMPLoopDirective(this, OMPTargetParallelForDirectiveClass,
2689
                         OMPD_target_parallel_for, SourceLocation(),
2690
                         SourceLocation(), CollapsedNum, NumClauses),
2691
290
        HasCancel(false) {}
2692
2693
  /// Set cancel state.
2694
4.47k
  void setHasCancel(bool Has) { HasCancel = Has; }
2695
2696
public:
2697
  /// Creates directive with a list of \a Clauses.
2698
  ///
2699
  /// \param C AST context.
2700
  /// \param StartLoc Starting location of the directive kind.
2701
  /// \param EndLoc Ending Location of the directive.
2702
  /// \param CollapsedNum Number of collapsed loops.
2703
  /// \param Clauses List of clauses.
2704
  /// \param AssociatedStmt Statement, associated with the directive.
2705
  /// \param Exprs Helper expressions for CodeGen.
2706
  /// \param HasCancel true if current directive has inner cancel directive.
2707
  ///
2708
  static OMPTargetParallelForDirective *
2709
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2710
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2711
         Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel);
2712
2713
  /// Creates an empty directive with the place
2714
  /// for \a NumClauses clauses.
2715
  ///
2716
  /// \param C AST context.
2717
  /// \param CollapsedNum Number of collapsed nested loops.
2718
  /// \param NumClauses Number of clauses.
2719
  ///
2720
  static OMPTargetParallelForDirective *CreateEmpty(const ASTContext &C,
2721
                                                    unsigned NumClauses,
2722
                                                    unsigned CollapsedNum,
2723
                                                    EmptyShell);
2724
2725
  /// Return true if current directive has inner cancel directive.
2726
964
  bool hasCancel() const { return HasCancel; }
2727
2728
6.53k
  static bool classof(const Stmt *T) {
2729
6.53k
    return T->getStmtClass() == OMPTargetParallelForDirectiveClass;
2730
6.53k
  }
2731
};
2732
2733
/// This represents '#pragma omp teams' directive.
2734
///
2735
/// \code
2736
/// #pragma omp teams if(a)
2737
/// \endcode
2738
/// In this example directive '#pragma omp teams' has clause 'if' with
2739
/// condition 'a'.
2740
///
2741
class OMPTeamsDirective : public OMPExecutableDirective {
2742
  friend class ASTStmtReader;
2743
  /// Build directive with the given start and end location.
2744
  ///
2745
  /// \param StartLoc Starting location of the directive kind.
2746
  /// \param EndLoc Ending location of the directive.
2747
  /// \param NumClauses Number of clauses.
2748
  ///
2749
  OMPTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2750
                    unsigned NumClauses)
2751
      : OMPExecutableDirective(this, OMPTeamsDirectiveClass, OMPD_teams,
2752
11.3k
                               StartLoc, EndLoc, NumClauses, 1) {}
2753
2754
  /// Build an empty directive.
2755
  ///
2756
  /// \param NumClauses Number of clauses.
2757
  ///
2758
  explicit OMPTeamsDirective(unsigned NumClauses)
2759
      : OMPExecutableDirective(this, OMPTeamsDirectiveClass, OMPD_teams,
2760
                               SourceLocation(), SourceLocation(), NumClauses,
2761
674
                               1) {}
2762
2763
public:
2764
  /// Creates directive with a list of \a Clauses.
2765
  ///
2766
  /// \param C AST context.
2767
  /// \param StartLoc Starting location of the directive kind.
2768
  /// \param EndLoc Ending Location of the directive.
2769
  /// \param Clauses List of clauses.
2770
  /// \param AssociatedStmt Statement, associated with the directive.
2771
  ///
2772
  static OMPTeamsDirective *Create(const ASTContext &C, SourceLocation StartLoc,
2773
                                   SourceLocation EndLoc,
2774
                                   ArrayRef<OMPClause *> Clauses,
2775
                                   Stmt *AssociatedStmt);
2776
2777
  /// Creates an empty directive with the place for \a NumClauses
2778
  /// clauses.
2779
  ///
2780
  /// \param C AST context.
2781
  /// \param NumClauses Number of clauses.
2782
  ///
2783
  static OMPTeamsDirective *CreateEmpty(const ASTContext &C,
2784
                                        unsigned NumClauses, EmptyShell);
2785
2786
0
  static bool classof(const Stmt *T) {
2787
0
    return T->getStmtClass() == OMPTeamsDirectiveClass;
2788
0
  }
2789
};
2790
2791
/// This represents '#pragma omp cancellation point' directive.
2792
///
2793
/// \code
2794
/// #pragma omp cancellation point for
2795
/// \endcode
2796
///
2797
/// In this example a cancellation point is created for innermost 'for' region.
2798
class OMPCancellationPointDirective : public OMPExecutableDirective {
2799
  friend class ASTStmtReader;
2800
  OpenMPDirectiveKind CancelRegion;
2801
  /// Build directive with the given start and end location.
2802
  ///
2803
  /// \param StartLoc Starting location of the directive kind.
2804
  /// \param EndLoc Ending location of the directive.
2805
  ///
2806
  OMPCancellationPointDirective(SourceLocation StartLoc, SourceLocation EndLoc)
2807
      : OMPExecutableDirective(this, OMPCancellationPointDirectiveClass,
2808
                               OMPD_cancellation_point, StartLoc, EndLoc, 0, 0),
2809
83
        CancelRegion(OMPD_unknown) {}
2810
2811
  /// Build an empty directive.
2812
  ///
2813
  explicit OMPCancellationPointDirective()
2814
      : OMPExecutableDirective(this, OMPCancellationPointDirectiveClass,
2815
                               OMPD_cancellation_point, SourceLocation(),
2816
                               SourceLocation(), 0, 0),
2817
38
        CancelRegion(OMPD_unknown) {}
2818
2819
  /// Set cancel region for current cancellation point.
2820
  /// \param CR Cancellation region.
2821
121
  void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
2822
2823
public:
2824
  /// Creates directive.
2825
  ///
2826
  /// \param C AST context.
2827
  /// \param StartLoc Starting location of the directive kind.
2828
  /// \param EndLoc Ending Location of the directive.
2829
  ///
2830
  static OMPCancellationPointDirective *
2831
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2832
         OpenMPDirectiveKind CancelRegion);
2833
2834
  /// Creates an empty directive.
2835
  ///
2836
  /// \param C AST context.
2837
  ///
2838
  static OMPCancellationPointDirective *CreateEmpty(const ASTContext &C,
2839
                                                    EmptyShell);
2840
2841
  /// Get cancellation region for the current cancellation point.
2842
88
  OpenMPDirectiveKind getCancelRegion() const { return CancelRegion; }
2843
2844
0
  static bool classof(const Stmt *T) {
2845
0
    return T->getStmtClass() == OMPCancellationPointDirectiveClass;
2846
0
  }
2847
};
2848
2849
/// This represents '#pragma omp cancel' directive.
2850
///
2851
/// \code
2852
/// #pragma omp cancel for
2853
/// \endcode
2854
///
2855
/// In this example a cancel is created for innermost 'for' region.
2856
class OMPCancelDirective : public OMPExecutableDirective {
2857
  friend class ASTStmtReader;
2858
  OpenMPDirectiveKind CancelRegion;
2859
  /// Build directive with the given start and end location.
2860
  ///
2861
  /// \param StartLoc Starting location of the directive kind.
2862
  /// \param EndLoc Ending location of the directive.
2863
  /// \param NumClauses Number of clauses.
2864
  ///
2865
  OMPCancelDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2866
                     unsigned NumClauses)
2867
      : OMPExecutableDirective(this, OMPCancelDirectiveClass, OMPD_cancel,
2868
                               StartLoc, EndLoc, NumClauses, 0),
2869
282
        CancelRegion(OMPD_unknown) {}
2870
2871
  /// Build an empty directive.
2872
  ///
2873
  /// \param NumClauses Number of clauses.
2874
  explicit OMPCancelDirective(unsigned NumClauses)
2875
      : OMPExecutableDirective(this, OMPCancelDirectiveClass, OMPD_cancel,
2876
                               SourceLocation(), SourceLocation(), NumClauses,
2877
                               0),
2878
70
        CancelRegion(OMPD_unknown) {}
2879
2880
  /// Set cancel region for current cancellation point.
2881
  /// \param CR Cancellation region.
2882
352
  void setCancelRegion(OpenMPDirectiveKind CR) { CancelRegion = CR; }
2883
2884
public:
2885
  /// Creates directive.
2886
  ///
2887
  /// \param C AST context.
2888
  /// \param StartLoc Starting location of the directive kind.
2889
  /// \param EndLoc Ending Location of the directive.
2890
  /// \param Clauses List of clauses.
2891
  ///
2892
  static OMPCancelDirective *
2893
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2894
         ArrayRef<OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion);
2895
2896
  /// Creates an empty directive.
2897
  ///
2898
  /// \param C AST context.
2899
  /// \param NumClauses Number of clauses.
2900
  ///
2901
  static OMPCancelDirective *CreateEmpty(const ASTContext &C,
2902
                                         unsigned NumClauses, EmptyShell);
2903
2904
  /// Get cancellation region for the current cancellation point.
2905
206
  OpenMPDirectiveKind getCancelRegion() const { return CancelRegion; }
2906
2907
0
  static bool classof(const Stmt *T) {
2908
0
    return T->getStmtClass() == OMPCancelDirectiveClass;
2909
0
  }
2910
};
2911
2912
/// This represents '#pragma omp taskloop' directive.
2913
///
2914
/// \code
2915
/// #pragma omp taskloop private(a,b) grainsize(val) num_tasks(num)
2916
/// \endcode
2917
/// In this example directive '#pragma omp taskloop' has clauses 'private'
2918
/// with the variables 'a' and 'b', 'grainsize' with expression 'val' and
2919
/// 'num_tasks' with expression 'num'.
2920
///
2921
class OMPTaskLoopDirective : public OMPLoopDirective {
2922
  friend class ASTStmtReader;
2923
  /// Build directive with the given start and end location.
2924
  ///
2925
  /// \param StartLoc Starting location of the directive kind.
2926
  /// \param EndLoc Ending location of the directive.
2927
  /// \param CollapsedNum Number of collapsed nested loops.
2928
  /// \param NumClauses Number of clauses.
2929
  ///
2930
  OMPTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2931
                       unsigned CollapsedNum, unsigned NumClauses)
2932
      : OMPLoopDirective(this, OMPTaskLoopDirectiveClass, OMPD_taskloop,
2933
2.81k
                         StartLoc, EndLoc, CollapsedNum, NumClauses) {}
2934
2935
  /// Build an empty directive.
2936
  ///
2937
  /// \param CollapsedNum Number of collapsed nested loops.
2938
  /// \param NumClauses Number of clauses.
2939
  ///
2940
  explicit OMPTaskLoopDirective(unsigned CollapsedNum, unsigned NumClauses)
2941
      : OMPLoopDirective(this, OMPTaskLoopDirectiveClass, OMPD_taskloop,
2942
                         SourceLocation(), SourceLocation(), CollapsedNum,
2943
30
                         NumClauses) {}
2944
2945
public:
2946
  /// Creates directive with a list of \a Clauses.
2947
  ///
2948
  /// \param C AST context.
2949
  /// \param StartLoc Starting location of the directive kind.
2950
  /// \param EndLoc Ending Location of the directive.
2951
  /// \param CollapsedNum Number of collapsed loops.
2952
  /// \param Clauses List of clauses.
2953
  /// \param AssociatedStmt Statement, associated with the directive.
2954
  /// \param Exprs Helper expressions for CodeGen.
2955
  ///
2956
  static OMPTaskLoopDirective *
2957
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
2958
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
2959
         Stmt *AssociatedStmt, const HelperExprs &Exprs);
2960
2961
  /// Creates an empty directive with the place
2962
  /// for \a NumClauses clauses.
2963
  ///
2964
  /// \param C AST context.
2965
  /// \param CollapsedNum Number of collapsed nested loops.
2966
  /// \param NumClauses Number of clauses.
2967
  ///
2968
  static OMPTaskLoopDirective *CreateEmpty(const ASTContext &C,
2969
                                           unsigned NumClauses,
2970
                                           unsigned CollapsedNum, EmptyShell);
2971
2972
0
  static bool classof(const Stmt *T) {
2973
0
    return T->getStmtClass() == OMPTaskLoopDirectiveClass;
2974
0
  }
2975
};
2976
2977
/// This represents '#pragma omp taskloop simd' directive.
2978
///
2979
/// \code
2980
/// #pragma omp taskloop simd private(a,b) grainsize(val) num_tasks(num)
2981
/// \endcode
2982
/// In this example directive '#pragma omp taskloop simd' has clauses 'private'
2983
/// with the variables 'a' and 'b', 'grainsize' with expression 'val' and
2984
/// 'num_tasks' with expression 'num'.
2985
///
2986
class OMPTaskLoopSimdDirective : public OMPLoopDirective {
2987
  friend class ASTStmtReader;
2988
  /// Build directive with the given start and end location.
2989
  ///
2990
  /// \param StartLoc Starting location of the directive kind.
2991
  /// \param EndLoc Ending location of the directive.
2992
  /// \param CollapsedNum Number of collapsed nested loops.
2993
  /// \param NumClauses Number of clauses.
2994
  ///
2995
  OMPTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
2996
                           unsigned CollapsedNum, unsigned NumClauses)
2997
      : OMPLoopDirective(this, OMPTaskLoopSimdDirectiveClass,
2998
                         OMPD_taskloop_simd, StartLoc, EndLoc, CollapsedNum,
2999
3.17k
                         NumClauses) {}
3000
3001
  /// Build an empty directive.
3002
  ///
3003
  /// \param CollapsedNum Number of collapsed nested loops.
3004
  /// \param NumClauses Number of clauses.
3005
  ///
3006
  explicit OMPTaskLoopSimdDirective(unsigned CollapsedNum, unsigned NumClauses)
3007
      : OMPLoopDirective(this, OMPTaskLoopSimdDirectiveClass,
3008
                         OMPD_taskloop_simd, SourceLocation(), SourceLocation(),
3009
30
                         CollapsedNum, NumClauses) {}
3010
3011
public:
3012
  /// Creates directive with a list of \a Clauses.
3013
  ///
3014
  /// \param C AST context.
3015
  /// \param StartLoc Starting location of the directive kind.
3016
  /// \param EndLoc Ending Location of the directive.
3017
  /// \param CollapsedNum Number of collapsed loops.
3018
  /// \param Clauses List of clauses.
3019
  /// \param AssociatedStmt Statement, associated with the directive.
3020
  /// \param Exprs Helper expressions for CodeGen.
3021
  ///
3022
  static OMPTaskLoopSimdDirective *
3023
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3024
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3025
         Stmt *AssociatedStmt, const HelperExprs &Exprs);
3026
3027
  /// Creates an empty directive with the place
3028
  /// for \a NumClauses clauses.
3029
  ///
3030
  /// \param C AST context.
3031
  /// \param CollapsedNum Number of collapsed nested loops.
3032
  /// \param NumClauses Number of clauses.
3033
  ///
3034
  static OMPTaskLoopSimdDirective *CreateEmpty(const ASTContext &C,
3035
                                               unsigned NumClauses,
3036
                                               unsigned CollapsedNum,
3037
                                               EmptyShell);
3038
3039
0
  static bool classof(const Stmt *T) {
3040
0
    return T->getStmtClass() == OMPTaskLoopSimdDirectiveClass;
3041
0
  }
3042
};
3043
3044
/// This represents '#pragma omp distribute' directive.
3045
///
3046
/// \code
3047
/// #pragma omp distribute private(a,b)
3048
/// \endcode
3049
/// In this example directive '#pragma omp distribute' has clauses 'private'
3050
/// with the variables 'a' and 'b'
3051
///
3052
class OMPDistributeDirective : public OMPLoopDirective {
3053
  friend class ASTStmtReader;
3054
3055
  /// Build directive with the given start and end location.
3056
  ///
3057
  /// \param StartLoc Starting location of the directive kind.
3058
  /// \param EndLoc Ending location of the directive.
3059
  /// \param CollapsedNum Number of collapsed nested loops.
3060
  /// \param NumClauses Number of clauses.
3061
  ///
3062
  OMPDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3063
                         unsigned CollapsedNum, unsigned NumClauses)
3064
      : OMPLoopDirective(this, OMPDistributeDirectiveClass, OMPD_distribute,
3065
                         StartLoc, EndLoc, CollapsedNum, NumClauses)
3066
1.11k
        {}
3067
3068
  /// Build an empty directive.
3069
  ///
3070
  /// \param CollapsedNum Number of collapsed nested loops.
3071
  /// \param NumClauses Number of clauses.
3072
  ///
3073
  explicit OMPDistributeDirective(unsigned CollapsedNum, unsigned NumClauses)
3074
      : OMPLoopDirective(this, OMPDistributeDirectiveClass, OMPD_distribute,
3075
                         SourceLocation(), SourceLocation(), CollapsedNum,
3076
                         NumClauses)
3077
120
        {}
3078
3079
public:
3080
  /// Creates directive with a list of \a Clauses.
3081
  ///
3082
  /// \param C AST context.
3083
  /// \param StartLoc Starting location of the directive kind.
3084
  /// \param EndLoc Ending Location of the directive.
3085
  /// \param CollapsedNum Number of collapsed loops.
3086
  /// \param Clauses List of clauses.
3087
  /// \param AssociatedStmt Statement, associated with the directive.
3088
  /// \param Exprs Helper expressions for CodeGen.
3089
  ///
3090
  static OMPDistributeDirective *
3091
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3092
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3093
         Stmt *AssociatedStmt, const HelperExprs &Exprs);
3094
3095
  /// Creates an empty directive with the place
3096
  /// for \a NumClauses clauses.
3097
  ///
3098
  /// \param C AST context.
3099
  /// \param CollapsedNum Number of collapsed nested loops.
3100
  /// \param NumClauses Number of clauses.
3101
  ///
3102
  static OMPDistributeDirective *CreateEmpty(const ASTContext &C,
3103
                                             unsigned NumClauses,
3104
                                             unsigned CollapsedNum, EmptyShell);
3105
3106
0
  static bool classof(const Stmt *T) {
3107
0
    return T->getStmtClass() == OMPDistributeDirectiveClass;
3108
0
  }
3109
};
3110
3111
/// This represents '#pragma omp target update' directive.
3112
///
3113
/// \code
3114
/// #pragma omp target update to(a) from(b) device(1)
3115
/// \endcode
3116
/// In this example directive '#pragma omp target update' has clause 'to' with
3117
/// argument 'a', clause 'from' with argument 'b' and clause 'device' with
3118
/// argument '1'.
3119
///
3120
class OMPTargetUpdateDirective : public OMPExecutableDirective {
3121
  friend class ASTStmtReader;
3122
  /// Build directive with the given start and end location.
3123
  ///
3124
  /// \param StartLoc Starting location of the directive kind.
3125
  /// \param EndLoc Ending Location of the directive.
3126
  /// \param NumClauses The number of clauses.
3127
  ///
3128
  OMPTargetUpdateDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3129
                           unsigned NumClauses)
3130
      : OMPExecutableDirective(this, OMPTargetUpdateDirectiveClass,
3131
                               OMPD_target_update, StartLoc, EndLoc, NumClauses,
3132
1.07k
                               1) {}
3133
3134
  /// Build an empty directive.
3135
  ///
3136
  /// \param NumClauses Number of clauses.
3137
  ///
3138
  explicit OMPTargetUpdateDirective(unsigned NumClauses)
3139
      : OMPExecutableDirective(this, OMPTargetUpdateDirectiveClass,
3140
                               OMPD_target_update, SourceLocation(),
3141
90
                               SourceLocation(), NumClauses, 1) {}
3142
3143
public:
3144
  /// Creates directive with a list of \a Clauses.
3145
  ///
3146
  /// \param C AST context.
3147
  /// \param StartLoc Starting location of the directive kind.
3148
  /// \param EndLoc Ending Location of the directive.
3149
  /// \param Clauses List of clauses.
3150
  /// \param AssociatedStmt Statement, associated with the directive.
3151
  ///
3152
  static OMPTargetUpdateDirective *
3153
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3154
         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt);
3155
3156
  /// Creates an empty directive with the place for \a NumClauses
3157
  /// clauses.
3158
  ///
3159
  /// \param C AST context.
3160
  /// \param NumClauses The number of clauses.
3161
  ///
3162
  static OMPTargetUpdateDirective *CreateEmpty(const ASTContext &C,
3163
                                               unsigned NumClauses, EmptyShell);
3164
3165
159k
  static bool classof(const Stmt *T) {
3166
159k
    return T->getStmtClass() == OMPTargetUpdateDirectiveClass;
3167
159k
  }
3168
};
3169
3170
/// This represents '#pragma omp distribute parallel for' composite
3171
///  directive.
3172
///
3173
/// \code
3174
/// #pragma omp distribute parallel for private(a,b)
3175
/// \endcode
3176
/// In this example directive '#pragma omp distribute parallel for' has clause
3177
/// 'private' with the variables 'a' and 'b'
3178
///
3179
class OMPDistributeParallelForDirective : public OMPLoopDirective {
3180
  friend class ASTStmtReader;
3181
  /// true if the construct has inner cancel directive.
3182
  bool HasCancel = false;
3183
3184
  /// Build directive with the given start and end location.
3185
  ///
3186
  /// \param StartLoc Starting location of the directive kind.
3187
  /// \param EndLoc Ending location of the directive.
3188
  /// \param CollapsedNum Number of collapsed nested loops.
3189
  /// \param NumClauses Number of clauses.
3190
  ///
3191
  OMPDistributeParallelForDirective(SourceLocation StartLoc,
3192
                                    SourceLocation EndLoc,
3193
                                    unsigned CollapsedNum, unsigned NumClauses)
3194
      : OMPLoopDirective(this, OMPDistributeParallelForDirectiveClass,
3195
                         OMPD_distribute_parallel_for, StartLoc, EndLoc,
3196
2.93k
                         CollapsedNum, NumClauses), HasCancel(false) {}
3197
3198
  /// Build an empty directive.
3199
  ///
3200
  /// \param CollapsedNum Number of collapsed nested loops.
3201
  /// \param NumClauses Number of clauses.
3202
  ///
3203
  explicit OMPDistributeParallelForDirective(unsigned CollapsedNum,
3204
                                             unsigned NumClauses)
3205
      : OMPLoopDirective(this, OMPDistributeParallelForDirectiveClass,
3206
                         OMPD_distribute_parallel_for, SourceLocation(),
3207
                         SourceLocation(), CollapsedNum, NumClauses),
3208
178
        HasCancel(false) {}
3209
3210
  /// Set cancel state.
3211
178
  void setHasCancel(bool Has) { HasCancel = Has; }
3212
3213
public:
3214
  /// Creates directive with a list of \a Clauses.
3215
  ///
3216
  /// \param C AST context.
3217
  /// \param StartLoc Starting location of the directive kind.
3218
  /// \param EndLoc Ending Location of the directive.
3219
  /// \param CollapsedNum Number of collapsed loops.
3220
  /// \param Clauses List of clauses.
3221
  /// \param AssociatedStmt Statement, associated with the directive.
3222
  /// \param Exprs Helper expressions for CodeGen.
3223
  /// \param HasCancel true if this directive has inner cancel directive.
3224
  ///
3225
  static OMPDistributeParallelForDirective *
3226
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3227
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3228
         Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel);
3229
3230
  /// Creates an empty directive with the place
3231
  /// for \a NumClauses clauses.
3232
  ///
3233
  /// \param C AST context.
3234
  /// \param CollapsedNum Number of collapsed nested loops.
3235
  /// \param NumClauses Number of clauses.
3236
  ///
3237
  static OMPDistributeParallelForDirective *CreateEmpty(const ASTContext &C,
3238
                                                        unsigned NumClauses,
3239
                                                        unsigned CollapsedNum,
3240
                                                        EmptyShell);
3241
3242
  /// Return true if current directive has inner cancel directive.
3243
832
  bool hasCancel() const { return HasCancel; }
3244
3245
6.87k
  static bool classof(const Stmt *T) {
3246
6.87k
    return T->getStmtClass() == OMPDistributeParallelForDirectiveClass;
3247
6.87k
  }
3248
};
3249
3250
/// This represents '#pragma omp distribute parallel for simd' composite
3251
/// directive.
3252
///
3253
/// \code
3254
/// #pragma omp distribute parallel for simd private(x)
3255
/// \endcode
3256
/// In this example directive '#pragma omp distribute parallel for simd' has
3257
/// clause 'private' with the variables 'x'
3258
///
3259
class OMPDistributeParallelForSimdDirective final : public OMPLoopDirective {
3260
  friend class ASTStmtReader;
3261
3262
  /// Build directive with the given start and end location.
3263
  ///
3264
  /// \param StartLoc Starting location of the directive kind.
3265
  /// \param EndLoc Ending location of the directive.
3266
  /// \param CollapsedNum Number of collapsed nested loops.
3267
  /// \param NumClauses Number of clauses.
3268
  ///
3269
  OMPDistributeParallelForSimdDirective(SourceLocation StartLoc,
3270
                                        SourceLocation EndLoc,
3271
                                        unsigned CollapsedNum,
3272
                                        unsigned NumClauses)
3273
      : OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass,
3274
                         OMPD_distribute_parallel_for_simd, StartLoc,
3275
3.65k
                         EndLoc, CollapsedNum, NumClauses) {}
3276
3277
  /// Build an empty directive.
3278
  ///
3279
  /// \param CollapsedNum Number of collapsed nested loops.
3280
  /// \param NumClauses Number of clauses.
3281
  ///
3282
  explicit OMPDistributeParallelForSimdDirective(unsigned CollapsedNum,
3283
                                                 unsigned NumClauses)
3284
      : OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass,
3285
                         OMPD_distribute_parallel_for_simd,
3286
                         SourceLocation(), SourceLocation(), CollapsedNum,
3287
168
                         NumClauses) {}
3288
3289
public:
3290
  /// Creates directive with a list of \a Clauses.
3291
  ///
3292
  /// \param C AST context.
3293
  /// \param StartLoc Starting location of the directive kind.
3294
  /// \param EndLoc Ending Location of the directive.
3295
  /// \param CollapsedNum Number of collapsed loops.
3296
  /// \param Clauses List of clauses.
3297
  /// \param AssociatedStmt Statement, associated with the directive.
3298
  /// \param Exprs Helper expressions for CodeGen.
3299
  ///
3300
  static OMPDistributeParallelForSimdDirective *Create(
3301
      const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3302
      unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3303
      Stmt *AssociatedStmt, const HelperExprs &Exprs);
3304
3305
  /// Creates an empty directive with the place for \a NumClauses clauses.
3306
  ///
3307
  /// \param C AST context.
3308
  /// \param CollapsedNum Number of collapsed nested loops.
3309
  /// \param NumClauses Number of clauses.
3310
  ///
3311
  static OMPDistributeParallelForSimdDirective *CreateEmpty(
3312
      const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
3313
      EmptyShell);
3314
3315
0
  static bool classof(const Stmt *T) {
3316
0
    return T->getStmtClass() == OMPDistributeParallelForSimdDirectiveClass;
3317
0
  }
3318
};
3319
3320
/// This represents '#pragma omp distribute simd' composite directive.
3321
///
3322
/// \code
3323
/// #pragma omp distribute simd private(x)
3324
/// \endcode
3325
/// In this example directive '#pragma omp distribute simd' has clause
3326
/// 'private' with the variables 'x'
3327
///
3328
class OMPDistributeSimdDirective final : public OMPLoopDirective {
3329
  friend class ASTStmtReader;
3330
3331
  /// Build directive with the given start and end location.
3332
  ///
3333
  /// \param StartLoc Starting location of the directive kind.
3334
  /// \param EndLoc Ending location of the directive.
3335
  /// \param CollapsedNum Number of collapsed nested loops.
3336
  /// \param NumClauses Number of clauses.
3337
  ///
3338
  OMPDistributeSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3339
                             unsigned CollapsedNum, unsigned NumClauses)
3340
      : OMPLoopDirective(this, OMPDistributeSimdDirectiveClass,
3341
                         OMPD_distribute_simd, StartLoc, EndLoc, CollapsedNum,
3342
2.63k
                         NumClauses) {}
3343
3344
  /// Build an empty directive.
3345
  ///
3346
  /// \param CollapsedNum Number of collapsed nested loops.
3347
  /// \param NumClauses Number of clauses.
3348
  ///
3349
  explicit OMPDistributeSimdDirective(unsigned CollapsedNum,
3350
                                      unsigned NumClauses)
3351
      : OMPLoopDirective(this, OMPDistributeSimdDirectiveClass,
3352
                         OMPD_distribute_simd, SourceLocation(),
3353
108
                         SourceLocation(), CollapsedNum, NumClauses) {}
3354
3355
public:
3356
  /// Creates directive with a list of \a Clauses.
3357
  ///
3358
  /// \param C AST context.
3359
  /// \param StartLoc Starting location of the directive kind.
3360
  /// \param EndLoc Ending Location of the directive.
3361
  /// \param CollapsedNum Number of collapsed loops.
3362
  /// \param Clauses List of clauses.
3363
  /// \param AssociatedStmt Statement, associated with the directive.
3364
  /// \param Exprs Helper expressions for CodeGen.
3365
  ///
3366
  static OMPDistributeSimdDirective *
3367
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3368
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3369
         Stmt *AssociatedStmt, const HelperExprs &Exprs);
3370
3371
  /// Creates an empty directive with the place for \a NumClauses clauses.
3372
  ///
3373
  /// \param C AST context.
3374
  /// \param CollapsedNum Number of collapsed nested loops.
3375
  /// \param NumClauses Number of clauses.
3376
  ///
3377
  static OMPDistributeSimdDirective *CreateEmpty(const ASTContext &C,
3378
                                                 unsigned NumClauses,
3379
                                                 unsigned CollapsedNum,
3380
                                                 EmptyShell);
3381
3382
0
  static bool classof(const Stmt *T) {
3383
0
    return T->getStmtClass() == OMPDistributeSimdDirectiveClass;
3384
0
  }
3385
};
3386
3387
/// This represents '#pragma omp target parallel for simd' directive.
3388
///
3389
/// \code
3390
/// #pragma omp target parallel for simd private(a) map(b) safelen(c)
3391
/// \endcode
3392
/// In this example directive '#pragma omp target parallel for simd' has clauses
3393
/// 'private' with the variable 'a', 'map' with the variable 'b' and 'safelen'
3394
/// with the variable 'c'.
3395
///
3396
class OMPTargetParallelForSimdDirective final : public OMPLoopDirective {
3397
  friend class ASTStmtReader;
3398
3399
  /// Build directive with the given start and end location.
3400
  ///
3401
  /// \param StartLoc Starting location of the directive kind.
3402
  /// \param EndLoc Ending location of the directive.
3403
  /// \param CollapsedNum Number of collapsed nested loops.
3404
  /// \param NumClauses Number of clauses.
3405
  ///
3406
  OMPTargetParallelForSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3407
                                unsigned CollapsedNum, unsigned NumClauses)
3408
      : OMPLoopDirective(this, OMPTargetParallelForSimdDirectiveClass,
3409
                         OMPD_target_parallel_for_simd, StartLoc, EndLoc,
3410
4.41k
                         CollapsedNum, NumClauses) {}
3411
3412
  /// Build an empty directive.
3413
  ///
3414
  /// \param CollapsedNum Number of collapsed nested loops.
3415
  /// \param NumClauses Number of clauses.
3416
  ///
3417
  explicit OMPTargetParallelForSimdDirective(unsigned CollapsedNum,
3418
                                             unsigned NumClauses)
3419
      : OMPLoopDirective(this, OMPTargetParallelForSimdDirectiveClass,
3420
                         OMPD_target_parallel_for_simd, SourceLocation(),
3421
302
                         SourceLocation(), CollapsedNum, NumClauses) {}
3422
3423
public:
3424
  /// Creates directive with a list of \a Clauses.
3425
  ///
3426
  /// \param C AST context.
3427
  /// \param StartLoc Starting location of the directive kind.
3428
  /// \param EndLoc Ending Location of the directive.
3429
  /// \param CollapsedNum Number of collapsed loops.
3430
  /// \param Clauses List of clauses.
3431
  /// \param AssociatedStmt Statement, associated with the directive.
3432
  /// \param Exprs Helper expressions for CodeGen.
3433
  ///
3434
  static OMPTargetParallelForSimdDirective *
3435
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3436
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3437
         Stmt *AssociatedStmt, const HelperExprs &Exprs);
3438
3439
  /// Creates an empty directive with the place for \a NumClauses clauses.
3440
  ///
3441
  /// \param C AST context.
3442
  /// \param CollapsedNum Number of collapsed nested loops.
3443
  /// \param NumClauses Number of clauses.
3444
  ///
3445
  static OMPTargetParallelForSimdDirective *CreateEmpty(const ASTContext &C,
3446
                                                        unsigned NumClauses,
3447
                                                        unsigned CollapsedNum,
3448
                                                        EmptyShell);
3449
3450
0
  static bool classof(const Stmt *T) {
3451
0
    return T->getStmtClass() == OMPTargetParallelForSimdDirectiveClass;
3452
0
  }
3453
};
3454
3455
/// This represents '#pragma omp target simd' directive.
3456
///
3457
/// \code
3458
/// #pragma omp target simd private(a) map(b) safelen(c)
3459
/// \endcode
3460
/// In this example directive '#pragma omp target simd' has clauses 'private'
3461
/// with the variable 'a', 'map' with the variable 'b' and 'safelen' with
3462
/// the variable 'c'.
3463
///
3464
class OMPTargetSimdDirective final : public OMPLoopDirective {
3465
  friend class ASTStmtReader;
3466
3467
  /// Build directive with the given start and end location.
3468
  ///
3469
  /// \param StartLoc Starting location of the directive kind.
3470
  /// \param EndLoc Ending location of the directive.
3471
  /// \param CollapsedNum Number of collapsed nested loops.
3472
  /// \param NumClauses Number of clauses.
3473
  ///
3474
  OMPTargetSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3475
                         unsigned CollapsedNum, unsigned NumClauses)
3476
      : OMPLoopDirective(this, OMPTargetSimdDirectiveClass,
3477
                         OMPD_target_simd, StartLoc, EndLoc, CollapsedNum,
3478
4.10k
                         NumClauses) {}
3479
3480
  /// Build an empty directive.
3481
  ///
3482
  /// \param CollapsedNum Number of collapsed nested loops.
3483
  /// \param NumClauses Number of clauses.
3484
  ///
3485
  explicit OMPTargetSimdDirective(unsigned CollapsedNum, unsigned NumClauses)
3486
      : OMPLoopDirective(this, OMPTargetSimdDirectiveClass, OMPD_target_simd,
3487
                         SourceLocation(),SourceLocation(), CollapsedNum,
3488
260
                         NumClauses) {}
3489
3490
public:
3491
  /// Creates directive with a list of \a Clauses.
3492
  ///
3493
  /// \param C AST context.
3494
  /// \param StartLoc Starting location of the directive kind.
3495
  /// \param EndLoc Ending Location of the directive.
3496
  /// \param CollapsedNum Number of collapsed loops.
3497
  /// \param Clauses List of clauses.
3498
  /// \param AssociatedStmt Statement, associated with the directive.
3499
  /// \param Exprs Helper expressions for CodeGen.
3500
  ///
3501
  static OMPTargetSimdDirective *
3502
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3503
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3504
         Stmt *AssociatedStmt, const HelperExprs &Exprs);
3505
3506
  /// Creates an empty directive with the place for \a NumClauses clauses.
3507
  ///
3508
  /// \param C AST context.
3509
  /// \param CollapsedNum Number of collapsed nested loops.
3510
  /// \param NumClauses Number of clauses.
3511
  ///
3512
  static OMPTargetSimdDirective *CreateEmpty(const ASTContext &C,
3513
                                             unsigned NumClauses,
3514
                                             unsigned CollapsedNum,
3515
                                             EmptyShell);
3516
3517
0
  static bool classof(const Stmt *T) {
3518
0
    return T->getStmtClass() == OMPTargetSimdDirectiveClass;
3519
0
  }
3520
};
3521
3522
/// This represents '#pragma omp teams distribute' directive.
3523
///
3524
/// \code
3525
/// #pragma omp teams distribute private(a,b)
3526
/// \endcode
3527
/// In this example directive '#pragma omp teams distribute' has clauses
3528
/// 'private' with the variables 'a' and 'b'
3529
///
3530
class OMPTeamsDistributeDirective final : public OMPLoopDirective {
3531
  friend class ASTStmtReader;
3532
3533
  /// Build directive with the given start and end location.
3534
  ///
3535
  /// \param StartLoc Starting location of the directive kind.
3536
  /// \param EndLoc Ending location of the directive.
3537
  /// \param CollapsedNum Number of collapsed nested loops.
3538
  /// \param NumClauses Number of clauses.
3539
  ///
3540
  OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
3541
                              unsigned CollapsedNum, unsigned NumClauses)
3542
      : OMPLoopDirective(this, OMPTeamsDistributeDirectiveClass,
3543
                         OMPD_teams_distribute, StartLoc, EndLoc,
3544
2.24k
                         CollapsedNum, NumClauses) {}
3545
3546
  /// Build an empty directive.
3547
  ///
3548
  /// \param CollapsedNum Number of collapsed nested loops.
3549
  /// \param NumClauses Number of clauses.
3550
  ///
3551
  explicit OMPTeamsDistributeDirective(unsigned CollapsedNum,
3552
                                       unsigned NumClauses)
3553
      : OMPLoopDirective(this, OMPTeamsDistributeDirectiveClass,
3554
                         OMPD_teams_distribute, SourceLocation(),
3555
142
                         SourceLocation(), CollapsedNum, NumClauses) {}
3556
3557
public:
3558
  /// Creates directive with a list of \a Clauses.
3559
  ///
3560
  /// \param C AST context.
3561
  /// \param StartLoc Starting location of the directive kind.
3562
  /// \param EndLoc Ending Location of the directive.
3563
  /// \param CollapsedNum Number of collapsed loops.
3564
  /// \param Clauses List of clauses.
3565
  /// \param AssociatedStmt Statement, associated with the directive.
3566
  /// \param Exprs Helper expressions for CodeGen.
3567
  ///
3568
  static OMPTeamsDistributeDirective *
3569
  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
3570
         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
3571
         Stmt *AssociatedStmt, const HelperExprs &Exprs);
3572
3573
  /// Creates an empty directive with the place for \a NumClauses clauses.
3574
  ///
3575
  /// \param C AST context.
3576
  /// \param CollapsedNum Number of collapsed nested loops.
3577
  /// \param NumClauses Number of clauses.
3578
  ///
3579
  static OMPTeamsDistributeDirective *CreateEmpty(const ASTContext &C,
3580
                                                  unsigned NumClauses,
3581
                                                  unsigned CollapsedNum,
3582
                                                  EmptyShell);
3583
3584
0
  static bool classof(const Stmt *T) {
3585
0
    return T->getStmtClass() == OMPTeamsDistributeDirectiveClass;
3586
0
  }
3587
};
3588
3589
/// This represents '#pragma omp teams distribute simd'
3590
/// combined directive.
3591
///
3592
/// \code
3593
/// #pragma omp teams distribute simd private(a,b)
3594
/// \endcode
3595
/// In this example directive '#pragma omp teams distribute simd'
3596
/// has clause 'private' with the variables 'a' and 'b'
3597
///
3598
class OMPTeamsDistributeSimdDirective final : public OMPLoopDirective {
3599
  friend class ASTStmtReader;
3600
3601
  /// Build directive with the given start and end location.
3602
  ///
3603
  /// \param StartLoc Starting location of the directive kind.
3604
  /// \param EndLoc Ending location of the directive.
3605
  /// \param CollapsedNum Number of collapsed nested loops.
3606
  /// \param NumClauses Number of clauses.
3607
  ///
3608
  OMPTeamsDistributeSimdDirective(SourceLocation StartLoc,
3609
                                  SourceLocation EndLoc, unsigned CollapsedNum,
3610
                                  unsigned NumClauses)
3611
      : OMPLoopDirective(this, OMPTeamsDistributeSimdDirectiveClass,
3612
                         OMPD_teams_distribute_simd, StartLoc, EndLoc,
3613
2.73k
                         CollapsedNum, NumClauses) {}
3614
3615
  /// Build an empty directive.
3616
  ///
3617
  /// \param CollapsedNum Number of collapsed nested loops.
3618
  /// \param NumClauses Number of clauses.
3619
  ///
3620
  explicit OMPTeamsDistributeSimdDirective(unsigned CollapsedNum,