xref: /llvm-project/flang/include/flang/Lower/PFTDefs.h (revision 026a43f6cf9f9fe3fb3fcf7065393ebc979afdef)
1 //===-- Lower/PFTDefs.h -- shared PFT info ----------------------*- 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 // Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef FORTRAN_LOWER_PFTDEFS_H
14 #define FORTRAN_LOWER_PFTDEFS_H
15 
16 #include "llvm/ADT/DenseMap.h"
17 #include "llvm/ADT/SmallSet.h"
18 #include "llvm/ADT/StringRef.h"
19 
20 namespace mlir {
21 class Block;
22 }
23 
24 namespace Fortran {
25 namespace semantics {
26 class Symbol;
27 class SemanticsContext;
28 class Scope;
29 } // namespace semantics
30 
31 namespace evaluate {
32 template <typename A>
33 class Expr;
34 struct SomeType;
35 } // namespace evaluate
36 
37 namespace common {
38 template <typename A>
39 class Reference;
40 }
41 
42 namespace lower {
43 
44 bool definedInCommonBlock(const semantics::Symbol &sym);
45 bool symbolIsGlobal(const semantics::Symbol &sym);
46 bool defaultRecursiveFunctionSetting();
47 
48 namespace pft {
49 
50 struct Evaluation;
51 
52 using SomeExpr = Fortran::evaluate::Expr<Fortran::evaluate::SomeType>;
53 using SymbolRef = Fortran::common::Reference<const Fortran::semantics::Symbol>;
54 using Label = std::uint64_t;
55 using LabelSet = llvm::SmallSet<Label, 4>;
56 using SymbolLabelMap = llvm::DenseMap<SymbolRef, LabelSet>;
57 using LabelEvalMap = llvm::DenseMap<Label, Evaluation *>;
58 
59 } // namespace pft
60 } // namespace lower
61 } // namespace Fortran
62 
63 #endif // FORTRAN_LOWER_PFTDEFS_H
64