1//===-- lib/Semantics/assignment.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_ASSIGNMENT_H_
10#define FORTRAN_SEMANTICS_ASSIGNMENT_H_
11
12#include "flang/Common/indirection.h"
13#include "flang/Evaluate/expression.h"
14#include "flang/Semantics/semantics.h"
15
16namespace Fortran::parser {
17class ContextualMessages;
18struct AssignmentStmt;
19struct EndWhereStmt;
20struct MaskedElsewhereStmt;
21struct PointerAssignmentStmt;
22struct WhereConstructStmt;
23struct WhereStmt;
24} // namespace Fortran::parser
25
26namespace Fortran::semantics {
27
28class AssignmentContext;
29class Scope;
30class Symbol;
31
32// Applies checks from C1594(5-6) on copying pointers in pure subprograms
33bool CheckCopyabilityInPureScope(parser::ContextualMessages &,
34 const evaluate::Expr<evaluate::SomeType> &, const Scope &);
35
36class AssignmentChecker : public virtual BaseChecker {
37public:
38 explicit AssignmentChecker(SemanticsContext &);
39 ~AssignmentChecker();
40 void Enter(const parser::OpenMPDeclareReductionConstruct &x);
41 void Enter(const parser::AssignmentStmt &);
42 void Enter(const parser::PointerAssignmentStmt &);
43 void Enter(const parser::WhereStmt &);
44 void Leave(const parser::WhereStmt &);
45 void Enter(const parser::WhereConstructStmt &);
46 void Leave(const parser::EndWhereStmt &);
47 void Enter(const parser::MaskedElsewhereStmt &);
48 void Leave(const parser::MaskedElsewhereStmt &);
49 void Enter(const parser::CUFKernelDoConstruct &);
50 void Leave(const parser::CUFKernelDoConstruct &);
51 void Enter(const parser::OpenACCBlockConstruct &);
52 void Leave(const parser::OpenACCBlockConstruct &);
53 void Enter(const parser::OpenACCCombinedConstruct &);
54 void Leave(const parser::OpenACCCombinedConstruct &);
55 void Enter(const parser::OpenACCLoopConstruct &);
56 void Leave(const parser::OpenACCLoopConstruct &);
57
58 SemanticsContext &context();
59
60private:
61 common::Indirection<AssignmentContext> context_;
62};
63
64} // namespace Fortran::semantics
65
66extern template class Fortran::common::Indirection<
67 Fortran::semantics::AssignmentContext>;
68#endif // FORTRAN_SEMANTICS_ASSIGNMENT_H_
69

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of flang/lib/Semantics/assignment.h