FLANG
HostAssociations.h
1//===-- Lower/HostAssociations.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_LOWER_HOSTASSOCIATIONS_H
10#define FORTRAN_LOWER_HOSTASSOCIATIONS_H
11
12#include "mlir/IR/Types.h"
13#include "llvm/ADT/SetVector.h"
14#include "llvm/ADT/SmallVector.h"
15
16namespace Fortran {
17namespace semantics {
18class Symbol;
19} // namespace semantics
20
21namespace lower {
23class SymMap;
24namespace pft {
25struct FunctionLikeUnit;
26struct Variable;
27} // namespace pft
28
33public:
35 bool empty() const { return tupleSymbols.empty() && globalSymbols.empty(); }
36
39 bool hasTupleAssociations() const { return !tupleSymbols.empty(); }
40
42 bool hasGlobalAssociations() const { return !globalSymbols.empty(); }
43
47 const llvm::SetVector<const Fortran::semantics::Symbol *> &symbols);
48
53
57
60 void hostProcedureBindings(AbstractConverter &converter, SymMap &symMap);
61
64 void internalProcedureBindings(AbstractConverter &converter, SymMap &symMap);
65
67 mlir::Type getArgumentType(AbstractConverter &convert);
68
70 bool isAssociated(const Fortran::semantics::Symbol &symbol) const {
71 return tupleSymbols.contains(&symbol) || globalSymbols.contains(&symbol);
72 }
73
76 return globalSymbols.contains(&symbol);
77 }
78
79private:
81 llvm::SetVector<const Fortran::semantics::Symbol *> tupleSymbols;
82
84 llvm::SetVector<const Fortran::semantics::Symbol *> globalSymbols;
85
89
91 mlir::Type argType;
92};
93} // namespace lower
94} // namespace Fortran
95
96#endif // FORTRAN_LOWER_HOSTASSOCIATIONS_H
Definition AbstractConverter.h:87
Definition HostAssociations.h:32
void internalProcedureBindings(AbstractConverter &converter, SymMap &symMap)
Definition HostAssociations.cpp:625
bool isAssociated(const Fortran::semantics::Symbol &symbol) const
Is symbol host associated ?
Definition HostAssociations.h:70
mlir::Type getArgumentType(AbstractConverter &convert)
Return the type of the extra argument to add to each internal procedure.
Definition HostAssociations.cpp:674
void addSymbolsToBind(const llvm::SetVector< const Fortran::semantics::Symbol * > &symbols)
Definition HostAssociations.cpp:544
void prepareGlobalBindings(const pft::FunctionLikeUnit &host)
Definition HostAssociations.cpp:561
bool hasGlobalAssociations() const
True if internal procedures access captured variables in global storage.
Definition HostAssociations.h:42
bool empty() const
Returns true iff there are no host associations.
Definition HostAssociations.h:35
bool isAssociatedGlobal(const Fortran::semantics::Symbol &symbol) const
Is the canonical symbol captured as a global instead of a tuple entry?
Definition HostAssociations.h:75
void hostProcedureBindings(AbstractConverter &converter, SymMap &symMap)
Definition HostAssociations.cpp:598
bool hasTupleAssociations() const
Definition HostAssociations.h:39
void releaseGlobalBindings(const pft::FunctionLikeUnit &host)
Definition HostAssociations.cpp:591
Definition SymbolMap.h:181
Definition symbol.h:905
Definition OpenACC.h:20
Definition ParserActions.h:24
Definition bit-population-count.h:20
Definition PFTBuilder.h:685
Definition PFTBuilder.h:469