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/Location.h"
13#include "mlir/IR/Types.h"
14#include "mlir/IR/Value.h"
15#include "llvm/ADT/SetVector.h"
16
17namespace Fortran {
18namespace semantics {
19class Symbol;
20class Scope;
21} // namespace semantics
22
23namespace lower {
24class AbstractConverter;
25class SymMap;
26
31public:
33 bool empty() const { return tupleSymbols.empty() && globalSymbols.empty(); }
34
37 bool hasTupleAssociations() const { return !tupleSymbols.empty(); }
38
42 const llvm::SetVector<const Fortran::semantics::Symbol *> &symbols,
43 const Fortran::semantics::Scope &hostScope);
44
47 void hostProcedureBindings(AbstractConverter &converter, SymMap &symMap);
48
51 void internalProcedureBindings(AbstractConverter &converter, SymMap &symMap);
52
54 mlir::Type getArgumentType(AbstractConverter &convert);
55
57 bool isAssociated(const Fortran::semantics::Symbol &symbol) const {
58 return tupleSymbols.contains(&symbol) || globalSymbols.contains(&symbol);
59 }
60
61private:
63 llvm::SetVector<const Fortran::semantics::Symbol *> tupleSymbols;
64
66 llvm::SetVector<const Fortran::semantics::Symbol *> globalSymbols;
67
69 mlir::Type argType;
70
72 const Fortran::semantics::Scope *hostScope;
73};
74} // namespace lower
75} // namespace Fortran
76
77#endif // FORTRAN_LOWER_HOSTASSOCIATIONS_H
Definition: AbstractConverter.h:82
Definition: HostAssociations.h:30
void internalProcedureBindings(AbstractConverter &converter, SymMap &symMap)
Definition: HostAssociations.cpp:592
bool isAssociated(const Fortran::semantics::Symbol &symbol) const
Is symbol host associated ?
Definition: HostAssociations.h:57
mlir::Type getArgumentType(AbstractConverter &convert)
Return the type of the extra argument to add to each internal procedure.
Definition: HostAssociations.cpp:648
void addSymbolsToBind(const llvm::SetVector< const Fortran::semantics::Symbol * > &symbols, const Fortran::semantics::Scope &hostScope)
Definition: HostAssociations.cpp:546
bool empty() const
Returns true iff there are no host associations.
Definition: HostAssociations.h:33
void hostProcedureBindings(AbstractConverter &converter, SymMap &symMap)
Definition: HostAssociations.cpp:565
bool hasTupleAssociations() const
Definition: HostAssociations.h:37
Definition: SymbolMap.h:146
Definition: scope.h:58
Definition: symbol.h:712
Definition: bit-population-count.h:20