Coverage Report

Created: 2018-09-25 23:22

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