Coverage Report

Created: 2019-01-21 03:01

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