|
| enum class | PassEntityBy {
BaseAddress
, BoxChar
, Box
, MutableBox
,
AddressAndLength
, Value
, BaseAddressValueAttribute
, CharBoxValueAttribute
,
CharProcTuple
, BoxProcRef
} |
| | Enum the different ways an entity can be passed-by. More...
|
| enum class | Property {
BaseAddress
, BoxChar
, CharAddress
, CharLength
,
CharProcTuple
, Box
, MutableBox
, Value
,
BoxProcRef
} |
|
using | FortranEntity = typename PassedEntityTypes<T>::FortranEntity |
|
using | FirValue = typename PassedEntityTypes<T>::FirValue |
|
| mlir::func::FuncOp | getFuncOp () const |
|
std::size_t | getNumFIRArguments () const |
| | Number of MLIR inputs/outputs of the created FuncOp.
|
|
std::size_t | getNumFIRResults () const |
|
llvm::ArrayRef< mlir::NamedAttribute > | getFIRArgumentAttributes (std::size_t index) const |
| | Return the MLIR attributes of the MLIR input at index.
|
|
llvm::SmallVector< mlir::Type > | getResultType () const |
| | Return the MLIR output types.
|
| llvm::ArrayRef< PassedEntity > | getPassedArguments () const |
| std::optional< PassedEntity > | getPassedResult () const |
|
mlir::FunctionType | genFunctionType () |
| | Returns the mlir function type.
|
| void | determineInterface (bool isImplicit, const Fortran::evaluate::characteristics::Procedure &) |
|
bool | callerAllocateResult () const |
| | Does the caller need to allocate storage for the result ?
|
|
bool | mustPassResult () const |
| | Is the Fortran result passed as an extra MLIR argument ?
|
|
bool | mustSaveResult () const |
| | Must the MLIR result be saved with a fir.save_result ?
|
|
bool | canBeCalledViaImplicitInterface () const |
| | Can the associated procedure be called via an implicit interface?
|
| fir::FortranProcedureFlagsEnumAttr | getProcedureAttrs (mlir::MLIRContext *) const |
template<typename T>
class Fortran::lower::CallInterface< T >
CallInterface defines all the logic to determine FIR function interfaces from a characteristic, build the mlir::func::FuncOp and describe back the argument mapping to its user. The logic is shared between the callee and caller sides that it accepts as a curiously recursive template to handle the few things that cannot be shared between both sides (getting characteristics, mangled name, location). It maps FIR arguments to front-end Symbol (callee side) or ActualArgument (caller side) with the same code using the abstract FortranEntity type that can be either a Symbol or an ActualArgument. It works in two passes: a first pass over the characteristics that decides how the interface must be. Then, the funcOp is created for it. Then a simple pass over fir arguments finalize the interface information that must be passed back to the user (and may require having the funcOp). All this passes are driven from the CallInterface constructor.