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
15namespace Fortran {
16namespace semantics {
17class Symbol;
18class Scope;
19} // namespace semantics
20
21namespace lower {
23class SymMap;
24
29public:
31 bool empty() const { return tupleSymbols.empty() && globalSymbols.empty(); }
32
35 bool hasTupleAssociations() const { return !tupleSymbols.empty(); }
36
40 const llvm::SetVector<const Fortran::semantics::Symbol *> &symbols,
41 const Fortran::semantics::Scope &hostScope);
42
45 void hostProcedureBindings(AbstractConverter &converter, SymMap &symMap);
46
49 void internalProcedureBindings(AbstractConverter &converter, SymMap &symMap);
50
52 mlir::Type getArgumentType(AbstractConverter &convert);
53
55 bool isAssociated(const Fortran::semantics::Symbol &symbol) const {
56 return tupleSymbols.contains(&symbol) || globalSymbols.contains(&symbol);
57 }
58
59private:
61 llvm::SetVector<const Fortran::semantics::Symbol *> tupleSymbols;
62
64 llvm::SetVector<const Fortran::semantics::Symbol *> globalSymbols;
65
67 mlir::Type argType;
68
70 const Fortran::semantics::Scope *hostScope;
71};
72} // namespace lower
73} // namespace Fortran
74
75#endif // FORTRAN_LOWER_HOSTASSOCIATIONS_H
Definition AbstractConverter.h:87
Definition HostAssociations.h:28
void internalProcedureBindings(AbstractConverter &converter, SymMap &symMap)
Definition HostAssociations.cpp:587
bool isAssociated(const Fortran::semantics::Symbol &symbol) const
Is symbol host associated ?
Definition HostAssociations.h:55
mlir::Type getArgumentType(AbstractConverter &convert)
Return the type of the extra argument to add to each internal procedure.
Definition HostAssociations.cpp:643
void addSymbolsToBind(const llvm::SetVector< const Fortran::semantics::Symbol * > &symbols, const Fortran::semantics::Scope &hostScope)
Definition HostAssociations.cpp:541
bool empty() const
Returns true iff there are no host associations.
Definition HostAssociations.h:31
void hostProcedureBindings(AbstractConverter &converter, SymMap &symMap)
Definition HostAssociations.cpp:560
bool hasTupleAssociations() const
Definition HostAssociations.h:35
Definition SymbolMap.h:181
Definition scope.h:68
Definition symbol.h:896
Definition ParserActions.h:24
Definition bit-population-count.h:20