Coverage Report

Created: 2018-07-21 08:31

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