FLANG
Decomposer.h
1//===-- Decomposer.h -- Compound directive decomposition ------------------===//
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#ifndef FORTRAN_LOWER_OPENMP_DECOMPOSER_H
9#define FORTRAN_LOWER_OPENMP_DECOMPOSER_H
10
11#include "flang/Lower/OpenMP/Clauses.h"
12#include "mlir/IR/BuiltinOps.h"
13#include "llvm/Frontend/OpenMP/OMP.h"
14#include "llvm/Support/Compiler.h"
15
16namespace llvm {
17class raw_ostream;
18}
19
20namespace Fortran {
21namespace semantics {
23}
24namespace lower::pft {
25struct Evaluation;
26}
27} // namespace Fortran
28
29namespace Fortran::lower::omp {
30using UnitConstruct = tomp::DirectiveWithClauses<lower::omp::Clause>;
31using ConstructQueue = List<UnitConstruct>;
32
33LLVM_DUMP_METHOD llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
34 const UnitConstruct &uc);
35
36// Given a potentially compound construct with a list of clauses that
37// apply to it, break it up into individual sub-constructs each with
38// the subset of applicable clauses (plus implicit clauses, if any).
39// From that create a work queue where each work item corresponds to
40// the sub-construct with its clauses.
41ConstructQueue buildConstructQueue(mlir::ModuleOp modOp,
42 semantics::SemanticsContext &semaCtx,
43 lower::pft::Evaluation &eval,
44 const parser::CharBlock &source,
45 llvm::omp::Directive compound,
46 const List<Clause> &clauses);
47
48bool isLastItemInQueue(ConstructQueue::const_iterator item,
49 const ConstructQueue &queue);
50
56bool matchLeafSequence(ConstructQueue::const_iterator item,
57 const ConstructQueue &queue,
58 llvm::omp::Directive directive);
59} // namespace Fortran::lower::omp
60
61#endif // FORTRAN_LOWER_OPENMP_DECOMPOSER_H
Definition semantics.h:67
Definition bit-population-count.h:20
Definition PFTBuilder.h:221