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 
15 namespace Fortran::parser {
16 class CharBlock;
17 class MessageFixedText;
18 struct ChangeTeamStmt;
19 struct CoarrayAssociation;
20 struct FormTeamStmt;
21 struct ImageSelectorSpec;
22 struct SyncTeamStmt;
23 struct TeamValue;
24 } // namespace Fortran::parser
25 
26 namespace Fortran::semantics {
27 
28 class CoarrayChecker : public virtual BaseChecker {
29 public:
30   CoarrayChecker(SemanticsContext &context) : context_{context} {}
31   void Leave(const parser::ChangeTeamStmt &);
32   void Leave(const parser::SyncTeamStmt &);
33   void Leave(const parser::ImageSelectorSpec &);
34   void Leave(const parser::FormTeamStmt &);
35 
36   void Enter(const parser::CriticalConstruct &);
37 
38 private:
39   SemanticsContext &context_;
40 
41   void CheckNamesAreDistinct(const std::list<parser::CoarrayAssociation> &);
42   void Say2(const parser::CharBlock &, parser::MessageFixedText &&,
43       const parser::CharBlock &, parser::MessageFixedText &&);
44 };
45 } // namespace Fortran::semantics
46 #endif // FORTRAN_SEMANTICS_CHECK_COARRAY_H_
47