FLANG
ConvertExprToHLFIR.h
1//===-- Lower/ConvertExprToHLFIR.h -- lowering of expressions ----*- 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//===----------------------------------------------------------------------===//
15//===----------------------------------------------------------------------===//
16
17#ifndef FORTRAN_LOWER_CONVERTEXPRTOHLFIR_H
18#define FORTRAN_LOWER_CONVERTEXPRTOHLFIR_H
19
20#include "flang/Lower/StatementContext.h"
21#include "flang/Lower/Support/Utils.h"
22#include "flang/Optimizer/Builder/FIRBuilder.h"
23#include "flang/Optimizer/Builder/HLFIRTools.h"
24#include "flang/Optimizer/Dialect/FIRDialect.h"
25
26namespace mlir {
27class Location;
28} // namespace mlir
29
30namespace hlfir {
31class ElementalAddrOp;
32}
33
34namespace Fortran::lower {
35
36class AbstractConverter;
37class SymMap;
38
40convertExprToHLFIR(mlir::Location loc, Fortran::lower::AbstractConverter &,
43
44inline fir::ExtendedValue translateToExtendedValue(
45 mlir::Location loc, fir::FirOpBuilder &builder, hlfir::Entity entity,
46 Fortran::lower::StatementContext &context, bool contiguityHint = false) {
47 auto [exv, exvCleanup] =
48 hlfir::translateToExtendedValue(loc, builder, entity, contiguityHint);
49 if (exvCleanup)
50 context.attachCleanup(*exvCleanup);
51 return exv;
52}
53
56fir::ExtendedValue convertExprToBox(mlir::Location loc,
61fir::ExtendedValue convertToBox(mlir::Location loc,
63 hlfir::Entity entity,
65 mlir::Type fortranType);
66
97fir::ExtendedValue convertToAddress(mlir::Location loc,
99 hlfir::Entity entity,
101 mlir::Type fortranType);
102
104fir::ExtendedValue convertExprToValue(mlir::Location loc,
109fir::ExtendedValue convertToValue(mlir::Location loc,
111 hlfir::Entity entity,
113
114fir::ExtendedValue convertDataRefToValue(mlir::Location loc,
119
136 mlir::Location loc, Fortran::lower::AbstractConverter &,
139
140} // namespace Fortran::lower
141
142#endif // FORTRAN_LOWER_CONVERTEXPRTOHLFIR_H
Definition: AbstractConverter.h:82
Definition: StatementContext.h:46
void attachCleanup(CleanupFunction cuf)
Append a cleanup function to the "list" of cleanup functions.
Definition: StatementContext.h:69
Definition: SymbolMap.h:146
Definition: BoxValue.h:478
Definition: FIRBuilder.h:55
Definition: BoxValue.h:360
Definition: HLFIRTools.h:192
Definition: HLFIRTools.h:51
Definition: AbstractConverter.h:59
fir::MutableBoxValue convertExprToMutableBox(mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &)
Definition: ConvertExprToHLFIR.cpp:2082
fir::ExtendedValue convertExprToAddress(mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &)
Definition: ConvertExprToHLFIR.cpp:2044
hlfir::ElementalAddrOp convertVectorSubscriptedExprToElementalAddr(mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &)
Definition: ConvertExprToHLFIR.cpp:2100
fir::ExtendedValue convertExprToValue(mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &)
Lower an evaluate::Expr to a fir::ExtendedValue value.
Definition: ConvertExprToHLFIR.cpp:2064
fir::ExtendedValue convertExprToBox(mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &)
Definition: ConvertExprToHLFIR.cpp:2022
Definition: AbstractConverter.h:27
Definition: variable.h:300