Warning: This file is not a C or C++ file. It does not have highlighting.

1//===- ConvertProcedureDesignator.h -- Procedure Designators ----*- 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//===----------------------------------------------------------------------===//
12///
13/// Lowering of evaluate::ProcedureDesignator to FIR and HLFIR.
14///
15//===----------------------------------------------------------------------===//
16
17#ifndef FORTRAN_LOWER_CONVERT_PROCEDURE_DESIGNATOR_H
18#define FORTRAN_LOWER_CONVERT_PROCEDURE_DESIGNATOR_H
19
20namespace mlir {
21class Location;
22class Value;
23class Type;
24}
25namespace fir {
26class ExtendedValue;
27}
28namespace hlfir {
29class EntityWithAttributes;
30}
31namespace Fortran::evaluate {
32struct ProcedureDesignator;
33}
34namespace Fortran::semantics {
35class Symbol;
36}
37
38namespace Fortran::lower {
39class AbstractConverter;
40class StatementContext;
41class SymMap;
42
43/// Lower a procedure designator to a fir::ExtendedValue that can be a
44/// fir::CharBoxValue for character procedure designator (the CharBoxValue
45/// length carries the result length if it is known).
46fir::ExtendedValue convertProcedureDesignator(
47 mlir::Location loc, Fortran::lower::AbstractConverter &converter,
48 const Fortran::evaluate::ProcedureDesignator &proc,
49 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx);
50
51/// Lower a procedure designator to a !fir.boxproc<()->() or
52/// tuple<!fir.boxproc<()->(), len>.
53hlfir::EntityWithAttributes convertProcedureDesignatorToHLFIR(
54 mlir::Location loc, Fortran::lower::AbstractConverter &converter,
55 const Fortran::evaluate::ProcedureDesignator &proc,
56 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx);
57
58/// Generate initialization for procedure pointer to procedure target.
59mlir::Value
60convertProcedureDesignatorInitialTarget(Fortran::lower::AbstractConverter &,
61 mlir::Location,
62 const Fortran::semantics::Symbol &sym);
63
64/// Given the value of a "PASS" actual argument \p passedArg and the
65/// evaluate::ProcedureDesignator for the call, address and dereference
66/// the argument's procedure pointer component that must be called.
67mlir::Value derefPassProcPointerComponent(
68 mlir::Location loc, Fortran::lower::AbstractConverter &converter,
69 const Fortran::evaluate::ProcedureDesignator &proc, mlir::Value passedArg,
70 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx);
71} // namespace Fortran::lower
72#endif // FORTRAN_LOWER_CONVERT_PROCEDURE_DESIGNATOR_H
73

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of flang/include/flang/Lower/ConvertProcedureDesignator.h