FLANG
lib
Semantics
check-purity.h
1
//===-- lib/Semantics/check-purity.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_PURITY_H_
10
#define FORTRAN_SEMANTICS_CHECK_PURITY_H_
11
#include "flang/Semantics/semantics.h"
12
#include <list>
13
namespace
Fortran::parser
{
14
struct
ExecutableConstruct
;
15
struct
SubroutineSubprogram
;
16
struct
FunctionSubprogram
;
17
struct
PrefixSpec
;
18
}
// namespace Fortran::parser
19
namespace
Fortran::semantics {
20
class
PurityChecker :
public
virtual
BaseChecker
{
21
public
:
22
explicit
PurityChecker(
SemanticsContext
&c) : context_{c} {}
23
void
Enter(
const
parser::ExecutableConstruct
&);
24
void
Enter(
const
parser::SubroutineSubprogram
&);
25
void
Leave(
const
parser::SubroutineSubprogram
&);
26
void
Enter(
const
parser::MainProgram
&);
27
void
Leave(
const
parser::MainProgram
&);
28
void
Enter(
const
parser::FunctionSubprogram
&);
29
void
Leave(
const
parser::FunctionSubprogram
&);
30
31
private
:
32
bool
InPureSubprogram()
const
;
33
bool
HasPurePrefix(
const
std::list<parser::PrefixSpec> &)
const
;
34
void
Entered(
parser::CharBlock
,
const
std::list<parser::PrefixSpec> &);
35
void
Left();
36
SemanticsContext
&context_;
37
int
depth_{0};
38
int
pureDepth_{-1};
39
};
40
}
// namespace Fortran::semantics
41
#endif
Fortran::parser::CharBlock
Definition
char-block.h:28
Fortran::semantics::SemanticsContext
Definition
semantics.h:67
Fortran::parser
Definition
check-expression.h:19
Fortran::parser::ExecutableConstruct
Definition
parse-tree.h:529
Fortran::parser::FunctionSubprogram
Definition
parse-tree.h:3261
Fortran::parser::MainProgram
Definition
parse-tree.h:2904
Fortran::parser::PrefixSpec
Definition
parse-tree.h:3084
Fortran::parser::SubroutineSubprogram
Definition
parse-tree.h:3271
Fortran::semantics::BaseChecker
Definition
semantics.h:425
Generated on
for FLANG by
1.14.0