1//===-- lib/Semantics/check-coarray.h ---------------------------*- 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_SEMANTICS_CHECK_COARRAY_H_
10#define FORTRAN_SEMANTICS_CHECK_COARRAY_H_
11
12#include "flang/Semantics/semantics.h"
13#include <list>
14
15namespace Fortran::parser {
16class CharBlock;
17class MessageFixedText;
18struct ChangeTeamStmt;
19struct CriticalStmt;
20struct CoarrayAssociation;
21struct EndChangeTeamStmt;
22struct EventPostStmt;
23struct EventWaitStmt;
24struct FormTeamStmt;
25struct ImageSelector;
26struct NotifyWaitStmt;
27struct SyncAllStmt;
28struct SyncImagesStmt;
29struct SyncMemoryStmt;
30struct SyncTeamStmt;
31struct UnlockStmt;
32} // namespace Fortran::parser
33
34namespace Fortran::semantics {
35
36class CoarrayChecker : public virtual BaseChecker {
37public:
38 CoarrayChecker(SemanticsContext &context) : context_{context} {}
39 void Leave(const parser::ChangeTeamStmt &);
40 void Leave(const parser::EndChangeTeamStmt &);
41 void Leave(const parser::SyncAllStmt &);
42 void Leave(const parser::SyncImagesStmt &);
43 void Leave(const parser::SyncMemoryStmt &);
44 void Leave(const parser::SyncTeamStmt &);
45 void Leave(const parser::NotifyWaitStmt &);
46 void Leave(const parser::EventPostStmt &);
47 void Leave(const parser::EventWaitStmt &);
48 void Leave(const parser::UnlockStmt &);
49 void Leave(const parser::CriticalStmt &);
50 void Leave(const parser::ImageSelector &);
51 void Leave(const parser::FormTeamStmt &);
52
53 void Enter(const parser::CriticalConstruct &);
54
55private:
56 SemanticsContext &context_;
57 bool haveStat_;
58 bool haveTeam_;
59 bool haveTeamNumber_;
60
61 void CheckNamesAreDistinct(const std::list<parser::CoarrayAssociation> &);
62 void Say2(const parser::CharBlock &, parser::MessageFixedText &&,
63 const parser::CharBlock &, parser::MessageFixedText &&);
64};
65} // namespace Fortran::semantics
66#endif // FORTRAN_SEMANTICS_CHECK_COARRAY_H_
67

source code of flang/lib/Semantics/check-coarray.h