1 //===-- lib/Semantics/assignment.h ------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef FORTRAN_SEMANTICS_ASSIGNMENT_H_
10 #define FORTRAN_SEMANTICS_ASSIGNMENT_H_
12 #include "flang/Common/indirection.h"
13 #include "flang/Evaluate/expression.h"
14 #include "flang/Semantics/semantics.h"
16 namespace Fortran::parser
{
17 class ContextualMessages
;
18 struct AssignmentStmt
;
20 struct MaskedElsewhereStmt
;
21 struct PointerAssignmentStmt
;
22 struct WhereConstructStmt
;
24 } // namespace Fortran::parser
26 namespace Fortran::semantics
{
28 class AssignmentContext
;
32 // Applies checks from C1594(5-6) on copying pointers in pure subprograms
33 bool CheckCopyabilityInPureScope(parser::ContextualMessages
&,
34 const evaluate::Expr
<evaluate::SomeType
> &, const Scope
&);
36 class AssignmentChecker
: public virtual BaseChecker
{
38 explicit AssignmentChecker(SemanticsContext
&);
40 void Enter(const parser::AssignmentStmt
&);
41 void Enter(const parser::PointerAssignmentStmt
&);
42 void Enter(const parser::WhereStmt
&);
43 void Leave(const parser::WhereStmt
&);
44 void Enter(const parser::WhereConstructStmt
&);
45 void Leave(const parser::EndWhereStmt
&);
46 void Enter(const parser::MaskedElsewhereStmt
&);
47 void Leave(const parser::MaskedElsewhereStmt
&);
50 common::Indirection
<AssignmentContext
> context_
;
53 } // namespace Fortran::semantics
55 extern template class Fortran::common::Indirection
<
56 Fortran::semantics::AssignmentContext
>;
57 #endif // FORTRAN_SEMANTICS_ASSIGNMENT_H_