FLANG

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Fortran::lower::pft::FunctionLikeUnit Struct Reference

`#include <flang/Lower/PFTBuilder.h>`

Inheritance diagram for Fortran::lower::pft::FunctionLikeUnit:

## Public Types
using | FunctionStatement = ReferenceVariant< parser::Statement< parser::ProgramStmt >, parser::Statement< parser::EndProgramStmt >, parser::Statement< parser::FunctionStmt >, parser::Statement< parser::EndFunctionStmt >, parser::Statement< parser::SubroutineStmt >, parser::Statement< parser::EndSubroutineStmt >, parser::Statement< parser::MpSubprogramStmt >, parser::Statement< parser::EndMpSubprogramStmt > >
Public Types inherited from Fortran::lower::pft::ReferenceVariantBase< isConst, A >
template<typename B >
using | BaseType = std::conditional_t< isConst, const B, B >
template<typename B >
using | Ref = common::Reference< BaseType< B > >

## Public Member Functions
| FunctionLikeUnit (const parser::MainProgram &f, const ParentVariant &parentVariant, const Fortran::semantics::SemanticsContext &semanticsContext)
| FunctionLikeUnit (const parser::FunctionSubprogram &f, const ParentVariant &parentVariant, const Fortran::semantics::SemanticsContext &semanticsContext)
| FunctionLikeUnit (const parser::SubroutineSubprogram &f, const ParentVariant &parentVariant, const Fortran::semantics::SemanticsContext &semanticsContext)
| FunctionLikeUnit (const parser::SeparateModuleSubprogram &f, const ParentVariant &parentVariant, const Fortran::semantics::SemanticsContext &semanticsContext)
| FunctionLikeUnit (FunctionLikeUnit &&)=default
| FunctionLikeUnit (const FunctionLikeUnit &)=delete
void | processSymbolTable (const Fortran::semantics::Scope &)
std::vector< Variable > | getOrderedSymbolTable ()
bool | isMainProgram () const
parser::CharBlock | getStartingSourceLoc ()
| Get the starting source location for this function like unit.
const semantics::Symbol & | getSubprogramSymbol () const
Public Member Functions inherited from Fortran::lower::pft::ProgramUnit
template<typename A >
| ProgramUnit (const A &p, const ParentVariant &parentVariant)
| ProgramUnit (ProgramUnit &&)=default
| ProgramUnit (const ProgramUnit &)=delete
Public Member Functions inherited from Fortran::lower::pft::ReferenceVariantBase< isConst, A >
template<typename B >
| ReferenceVariantBase (B &b)
template<typename B >
constexpr BaseType< B > & | get () const
template<typename B >
constexpr BaseType< B > * | getIf () const
template<typename B >
constexpr bool | isA () const
template<typename VISITOR >
constexpr auto | visit (VISITOR &&visitor) const

## Static Public Member Functions
static parser::CharBlock | stmtSourceLoc (const FunctionStatement &stmt)
| Helper to get location from FunctionLikeUnit begin/end statements.

## Public Attributes
std::optional< FunctionStatement > | beginStmt
| Anonymous programs do not have a begin statement.
FunctionStatement | endStmt
EvaluationList | evaluationList
LabelEvalMap | labelEvaluationMap
SymbolLabelMap | assignSymbolLabelMap
std::list< FunctionLikeUnit > | nestedFunctions
const semantics::Symbol * | symbol {nullptr}
mlir::Block * | finalBlock {}
| Terminal basic block (if any)
std::vector< std::vector< Variable > > | varList
Public Attributes inherited from Fortran::lower::pft::ProgramUnit
ParentVariant | parentVariant

## Detailed Description

Function-like units may contain evaluations (executable statements) and nested function-like units (internal procedures and function statements).

## Member Function Documentation

## ◆ getSubprogramSymbol()

const semantics::Symbol& Fortran::lower::pft::FunctionLikeUnit::getSubprogramSymbol | ( |  | ) | const
| inline

Returns reference to the subprogram symbol of this FunctionLikeUnit. Dies if the FunctionLikeUnit is not a subprogram.

## Member Data Documentation

## ◆ symbol

const semantics::Symbol* Fortran::lower::pft::FunctionLikeUnit::symbol {nullptr}

Symbol associated to this FunctionLikeUnit. Null if the FunctionLikeUnit is an anonymous program. The symbol has MainProgramDetails for named programs, otherwise it has SubprogramDetails.

The documentation for this struct was generated from the following files:

- include/flang/Lower/PFTBuilder.h
- lib/Lower/PFTBuilder.cpp