2020-02-25 16:11:52 +01:00
|
|
|
//===-- lib/Semantics/check-coarray.h ---------------------------*- C++ -*-===//
|
2019-04-15 19:26:20 +02:00
|
|
|
//
|
2019-12-20 21:52:07 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2019-04-15 19:26:20 +02:00
|
|
|
//
|
2020-01-10 21:12:03 +01:00
|
|
|
//===----------------------------------------------------------------------===//
|
2019-04-15 19:26:20 +02:00
|
|
|
|
|
|
|
#ifndef FORTRAN_SEMANTICS_CHECK_COARRAY_H_
|
|
|
|
#define FORTRAN_SEMANTICS_CHECK_COARRAY_H_
|
|
|
|
|
2020-02-25 16:11:52 +01:00
|
|
|
#include "flang/Semantics/semantics.h"
|
2019-04-15 19:26:20 +02:00
|
|
|
#include <list>
|
|
|
|
|
|
|
|
namespace Fortran::parser {
|
|
|
|
class CharBlock;
|
|
|
|
class MessageFixedText;
|
|
|
|
struct ChangeTeamStmt;
|
|
|
|
struct CoarrayAssociation;
|
|
|
|
struct FormTeamStmt;
|
2020-07-07 21:15:39 +02:00
|
|
|
struct ImageSelector;
|
2019-04-15 19:26:20 +02:00
|
|
|
struct SyncTeamStmt;
|
2020-03-29 06:00:16 +02:00
|
|
|
} // namespace Fortran::parser
|
2019-04-15 19:26:20 +02:00
|
|
|
|
|
|
|
namespace Fortran::semantics {
|
|
|
|
|
|
|
|
class CoarrayChecker : public virtual BaseChecker {
|
|
|
|
public:
|
2019-04-15 20:35:12 +02:00
|
|
|
CoarrayChecker(SemanticsContext &context) : context_{context} {}
|
2019-04-15 19:26:20 +02:00
|
|
|
void Leave(const parser::ChangeTeamStmt &);
|
|
|
|
void Leave(const parser::SyncTeamStmt &);
|
2020-07-07 21:15:39 +02:00
|
|
|
void Leave(const parser::ImageSelector &);
|
2019-04-15 19:26:20 +02:00
|
|
|
void Leave(const parser::FormTeamStmt &);
|
|
|
|
|
2019-12-26 06:18:47 +01:00
|
|
|
void Enter(const parser::CriticalConstruct &);
|
|
|
|
|
2019-04-15 19:26:20 +02:00
|
|
|
private:
|
|
|
|
SemanticsContext &context_;
|
2020-07-07 21:15:39 +02:00
|
|
|
bool haveStat_;
|
|
|
|
bool haveTeam_;
|
|
|
|
bool haveTeamNumber_;
|
2019-04-15 19:26:20 +02:00
|
|
|
|
2019-04-15 20:35:12 +02:00
|
|
|
void CheckNamesAreDistinct(const std::list<parser::CoarrayAssociation> &);
|
2019-04-15 19:26:20 +02:00
|
|
|
void Say2(const parser::CharBlock &, parser::MessageFixedText &&,
|
|
|
|
const parser::CharBlock &, parser::MessageFixedText &&);
|
|
|
|
};
|
2020-03-29 06:00:16 +02:00
|
|
|
} // namespace Fortran::semantics
|
|
|
|
#endif // FORTRAN_SEMANTICS_CHECK_COARRAY_H_
|