FLANG

Coarray.h
1 //===-- Lower/Coarray.h -- image related lowering ---------------*- 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
9 #ifndef FORTRAN_LOWER_COARRAY_H
10 #define FORTRAN_LOWER_COARRAY_H
11
12 #include "flang/Lower/AbstractConverter.h"
13 #include "flang/Lower/Support/BoxValue.h"
14
15 namespace Fortran {
16
17 namespace parser {
18 struct ChangeTeamConstruct;
19 struct ChangeTeamStmt;
20 struct EndChangeTeamStmt;
21 struct FormTeamStmt;
22 } // namespace parser
23
24 namespace evaluate {
25 class CoarrayRef;
26 } // namespace evaluate
27
28 namespace lower {
29
30 class SymMap;
31
32 namespace pft {
33 struct Evaluation;
34 } // namespace pft
35
36 //===----------------------------------------------------------------------===//
37 // TEAM constructs
38 //===----------------------------------------------------------------------===//
39
40 void genChangeTeamConstruct(AbstractConverter &, pft::Evaluation &eval,
41 const parser::ChangeTeamConstruct &);
42 void genChangeTeamStmt(AbstractConverter &, pft::Evaluation &eval,
43 const parser::ChangeTeamStmt &);
44 void genEndChangeTeamStmt(AbstractConverter &, pft::Evaluation &eval,
45 const parser::EndChangeTeamStmt &);
46 void genFormTeamStatement(AbstractConverter &, pft::Evaluation &eval,
47 const parser::FormTeamStmt &);
48
49 //===----------------------------------------------------------------------===//
50 // COARRAY expressions
51 //===----------------------------------------------------------------------===//
52
56 class CoarrayExprHelper {
57 public:
58 explicit CoarrayExprHelper(AbstractConverter &converter, mlir::Location loc,
59 SymMap &syms)
60 : converter{converter}, symMap{syms}, loc{loc} {}
61 CoarrayExprHelper(const CoarrayExprHelper &) = delete;
62
64 fir::ExtendedValue genAddr(const evaluate::CoarrayRef &expr);
65
67 fir::ExtendedValue genValue(const evaluate::CoarrayRef &expr);
68
69 private:
70 AbstractConverter &converter;
71 SymMap &symMap;
72 mlir::Location loc;
73 };
74
75 } // namespace lower
76 } // namespace Fortran
77
78 #endif // FORTRAN_LOWER_COARRAY_H
Fortran::evaluate::CoarrayRef
Definition: variable.h:242
Fortran::lower::CoarrayExprHelper::genValue
fir::ExtendedValue genValue(const evaluate::CoarrayRef &expr)
Generate the value of a co-array expression.
Definition: Coarray.cpp:70
Fortran::lower::CoarrayExprHelper
Definition: Coarray.h:56
Fortran::lower::CoarrayExprHelper::genAddr
fir::ExtendedValue genAddr(const evaluate::CoarrayRef &expr)
Generate the address of a co-array expression.
Definition: Coarray.cpp:64
Fortran::lower::SymMap
Definition: SymbolMap.h:173
Fortran::lower::AbstractConverter
Definition: AbstractConverter.h:51
fir::ExtendedValue
Definition: BoxValue.h:210