2020-02-25 15:11:52 +00:00
|
|
|
//===-- lib/Semantics/assignment.h ------------------------------*- C++ -*-===//
|
2018-11-30 14:03:05 -08:00
|
|
|
//
|
2019-12-20 12:52:07 -08: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
|
2018-11-30 14:03:05 -08:00
|
|
|
//
|
2020-01-10 12:12:03 -08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2018-11-30 14:03:05 -08:00
|
|
|
|
|
|
|
#ifndef FORTRAN_SEMANTICS_ASSIGNMENT_H_
|
|
|
|
#define FORTRAN_SEMANTICS_ASSIGNMENT_H_
|
|
|
|
|
2020-02-25 15:11:52 +00:00
|
|
|
#include "flang/Common/indirection.h"
|
|
|
|
#include "flang/Evaluate/expression.h"
|
|
|
|
#include "flang/Semantics/semantics.h"
|
2019-03-05 16:52:50 -08:00
|
|
|
|
2018-11-30 14:03:05 -08:00
|
|
|
namespace Fortran::parser {
|
2020-02-18 17:14:24 -08:00
|
|
|
class ContextualMessages;
|
2018-11-30 14:03:05 -08:00
|
|
|
struct AssignmentStmt;
|
2020-02-20 14:54:46 -08:00
|
|
|
struct EndWhereStmt;
|
|
|
|
struct MaskedElsewhereStmt;
|
2018-11-30 14:03:05 -08:00
|
|
|
struct PointerAssignmentStmt;
|
2020-02-20 14:54:46 -08:00
|
|
|
struct WhereConstructStmt;
|
2018-11-30 14:03:05 -08:00
|
|
|
struct WhereStmt;
|
2020-03-28 21:00:16 -07:00
|
|
|
} // namespace Fortran::parser
|
2018-11-30 14:03:05 -08:00
|
|
|
|
|
|
|
namespace Fortran::semantics {
|
2019-03-05 16:52:50 -08:00
|
|
|
|
2020-01-06 09:16:18 -08:00
|
|
|
class AssignmentContext;
|
2020-02-18 17:14:24 -08:00
|
|
|
class Scope;
|
|
|
|
class Symbol;
|
2019-03-20 11:38:45 -07:00
|
|
|
|
2019-12-23 17:12:53 -08:00
|
|
|
// Applies checks from C1594(5-6) on copying pointers in pure subprograms
|
2020-03-05 13:05:45 -08:00
|
|
|
bool CheckCopyabilityInPureScope(parser::ContextualMessages &,
|
2019-11-19 19:10:02 -08:00
|
|
|
const evaluate::Expr<evaluate::SomeType> &, const Scope &);
|
|
|
|
|
2019-03-05 16:52:50 -08:00
|
|
|
class AssignmentChecker : public virtual BaseChecker {
|
|
|
|
public:
|
|
|
|
explicit AssignmentChecker(SemanticsContext &);
|
2019-03-20 11:38:45 -07:00
|
|
|
~AssignmentChecker();
|
2019-03-05 16:52:50 -08:00
|
|
|
void Enter(const parser::AssignmentStmt &);
|
|
|
|
void Enter(const parser::PointerAssignmentStmt &);
|
|
|
|
void Enter(const parser::WhereStmt &);
|
2020-02-20 14:54:46 -08:00
|
|
|
void Leave(const parser::WhereStmt &);
|
|
|
|
void Enter(const parser::WhereConstructStmt &);
|
|
|
|
void Leave(const parser::EndWhereStmt &);
|
|
|
|
void Enter(const parser::MaskedElsewhereStmt &);
|
|
|
|
void Leave(const parser::MaskedElsewhereStmt &);
|
2025-02-04 13:10:47 -08:00
|
|
|
void Enter(const parser::CUFKernelDoConstruct &);
|
|
|
|
void Leave(const parser::CUFKernelDoConstruct &);
|
|
|
|
void Enter(const parser::OpenACCBlockConstruct &);
|
|
|
|
void Leave(const parser::OpenACCBlockConstruct &);
|
|
|
|
void Enter(const parser::OpenACCCombinedConstruct &);
|
|
|
|
void Leave(const parser::OpenACCCombinedConstruct &);
|
|
|
|
void Enter(const parser::OpenACCLoopConstruct &);
|
|
|
|
void Leave(const parser::OpenACCLoopConstruct &);
|
2019-03-05 16:52:50 -08:00
|
|
|
|
|
|
|
private:
|
2019-03-20 11:38:45 -07:00
|
|
|
common::Indirection<AssignmentContext> context_;
|
2019-03-05 16:52:50 -08:00
|
|
|
};
|
2018-11-30 14:03:05 -08:00
|
|
|
|
2020-03-28 21:00:16 -07:00
|
|
|
} // namespace Fortran::semantics
|
2020-01-06 09:16:18 -08:00
|
|
|
|
|
|
|
extern template class Fortran::common::Indirection<
|
|
|
|
Fortran::semantics::AssignmentContext>;
|
2020-03-28 21:00:16 -07:00
|
|
|
#endif // FORTRAN_SEMANTICS_ASSIGNMENT_H_
|