13#ifndef FORTRAN_LOWER_SUPPORT_UTILS_H
14#define FORTRAN_LOWER_SUPPORT_UTILS_H
16#include "flang/Common/indirection.h"
17#include "flang/Parser/char-block.h"
18#include "flang/Semantics/tools.h"
19#include "mlir/Dialect/Func/IR/FuncOps.h"
20#include "mlir/IR/BuiltinAttributes.h"
21#include "llvm/ADT/SmallSet.h"
22#include "llvm/ADT/StringRef.h"
29using SomeExpr = Fortran::evaluate::Expr<Fortran::evaluate::SomeType>;
45 return {cb.begin(), cb.size()};
50const A &removeIndirection(
const A &a) {
60static Fortran::lower::SomeExpr toEvExpr(
const A &x) {
61 return Fortran::evaluate::AsGenericExpr(Fortran::common::Clone(x));
64template <Fortran::common::TypeCategory FROM>
65static Fortran::lower::SomeExpr
70 return toEvExpr(x.left());
73static Fortran::lower::SomeExpr ignoreEvConvert(
const A &x) {
80inline Fortran::lower::SomeExpr ignoreEvConvert(
84 return Fortran::common::visit(
85 [](
const auto &v) {
return ignoreEvConvert(v); }, x.u);
89unsigned getHashValue(
const Fortran::lower::SomeExpr *x);
90unsigned getHashValue(
const Fortran::evaluate::Component *x);
92bool isEqual(
const Fortran::lower::SomeExpr *x,
93 const Fortran::lower::SomeExpr *y);
94bool isEqual(
const Fortran::evaluate::Component *x,
95 const Fortran::evaluate::Component *y);
97template <
typename OpType,
typename OperandsStructType>
99 lower::AbstractConverter &converter, fir::FirOpBuilder &firOpBuilder,
100 lower::SymMap &symTable,
101 llvm::SetVector<const semantics::Symbol *> &allPrivatizedSymbols,
102 llvm::SmallPtrSet<const semantics::Symbol *, 16> &mightHaveReadHostSym,
103 const semantics::Symbol *symToPrivatize, OperandsStructType *clauseOps,
104 std::optional<llvm::omp::Directive> dir = std::nullopt,
105 bool forceHeapAllocationForPrivateDynamicArrays =
false,
106 bool isLinear =
false);
111llvm::SmallVector<const semantics::Symbol *>
119struct DenseMapInfo<const
Fortran::lower::SomeExpr *> {
120 static unsigned getHashValue(
const Fortran::lower::SomeExpr *v) {
121 return Fortran::lower::getHashValue(v);
123 static bool isEqual(
const Fortran::lower::SomeExpr *lhs,
124 const Fortran::lower::SomeExpr *rhs) {
125 return Fortran::lower::isEqual(lhs, rhs);
133 return Fortran::lower::getHashValue(v);
137 return Fortran::lower::isEqual(lhs, rhs);
Definition indirection.h:31
Definition AbstractConverter.h:87
Definition SymbolMap.h:181
Definition char-block.h:27
Definition FIRBuilder.h:66
Definition ParserActions.h:24
llvm::SmallVector< const semantics::Symbol * > getCommonBlockStorageMembers(const semantics::Symbol &commonBlock)
Definition Utils.cpp:968
Definition bit-population-count.h:20
Definition AbstractConverter.h:37
Definition expression.h:218