FLANG
Fortran::lower::pft::FunctionLikeUnit Struct Reference

#include <flang/Lower/PFTBuilder.h>

Inheritance diagram for Fortran::lower::pft::FunctionLikeUnit:
Fortran::lower::pft::ProgramUnit Fortran::lower::pft::ReferenceVariantBase< true, A... >

Public Types

using FunctionStatement
Public Types inherited from Fortran::lower::pft::ReferenceVariantBase< true, A... >
using BaseType
using Ref

Public Member Functions

 FunctionLikeUnit (const parser::MainProgram &f, const PftNode &parent, const Fortran::semantics::SemanticsContext &semanticsContext)
 FunctionLikeUnit (const parser::FunctionSubprogram &f, const PftNode &parent, const Fortran::semantics::SemanticsContext &semanticsContext)
 FunctionLikeUnit (const parser::SubroutineSubprogram &f, const PftNode &parent, const Fortran::semantics::SemanticsContext &semanticsContext)
 FunctionLikeUnit (const parser::SeparateModuleSubprogram &f, const PftNode &parent, const Fortran::semantics::SemanticsContext &semanticsContext)
 FunctionLikeUnit (FunctionLikeUnit &&)=default
 FunctionLikeUnit (const FunctionLikeUnit &)=delete
bool isMainProgram () const
parser::CharBlock getStartingSourceLoc () const
 Get the starting source location for this function like unit.
void setActiveEntry (int entryIndex)
const semantics::SymbolgetSubprogramSymbol () const
const semantics::SymbolgetMainProgramSymbol () const
EvaluationgetEntryEval () const
void setHostAssociatedSymbols (const llvm::SetVector< const semantics::Symbol * > &symbols)
HostAssociationsparentHostAssoc ()
bool parentHasTupleHostAssoc ()
bool parentHasHostAssoc ()
HostAssociationsgetHostAssoc ()
const HostAssociationsgetHostAssoc () const
LLVM_DUMP_METHOD void dump () const
const Fortran::semantics::ScopegetScope () const
 Get the function scope.
Public Member Functions inherited from Fortran::lower::pft::ProgramUnit
template<typename A>
 ProgramUnit (const A &p, const PftNode &parent)
 ProgramUnit (ProgramUnit &&)=default
 ProgramUnit (const ProgramUnit &)=delete
Public Member Functions inherited from Fortran::lower::pft::ReferenceVariantBase< true, A... >
 ReferenceVariantBase (std::variant< Ref< A >... > b)
 ReferenceVariantBase (Ref< T > b)
constexpr BaseType< B > & get () const
constexpr BaseType< B > & getStatement () const
constexpr BaseType< B > * getIf () const
constexpr bool isA () const
constexpr auto visit (VISITOR &&visitor) const

Public Attributes

std::optional< FunctionStatementbeginStmt
 Anonymous programs do not have a begin statement.
FunctionStatement endStmt
const semantics::Scopescope
LabelEvalMap labelEvaluationMap
SymbolLabelMap assignSymbolLabelMap
ContainedUnitList containedUnitList
EvaluationList evaluationList
llvm::SmallVector< std::pair< const semantics::Symbol *, Evaluation * >, 1 > entryPointList {std::pair{nullptr, nullptr}}
int activeEntry = 0
 Current index into entryPointList. Index 0 is the primary entry point.
const semantics::SymbolprimaryResult {nullptr}
bool hasIeeeAccess {false}
bool mayModifyHaltingMode {false}
bool mayModifyRoundingMode {false}
bool mayModifyUnderflowMode {false}
mlir::Block * finalBlock {}
 Terminal basic block (if any)
HostAssociations hostAssociations
Public Attributes inherited from Fortran::lower::pft::ProgramUnit
PftNode parent

Detailed Description

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

Member Typedef Documentation

◆ FunctionStatement

Member Function Documentation

◆ getEntryEval()

Evaluation * Fortran::lower::pft::FunctionLikeUnit::getEntryEval ( ) const
inline

Return a pointer to the current entry point Evaluation. This is null for a primary entry point.

◆ getHostAssoc()

HostAssociations & Fortran::lower::pft::FunctionLikeUnit::getHostAssoc ( )
inline

Return the host associations for this function like unit. The list of host associations are kept in the host procedure.

◆ getMainProgramSymbol()

const semantics::Symbol * Fortran::lower::pft::FunctionLikeUnit::getMainProgramSymbol ( ) const
inline

Return a pointer to the main program symbol for named programs Return the null pointer for anonymous programs

◆ getSubprogramSymbol()

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

Return a reference to the subprogram symbol of this FunctionLikeUnit. This should not be called if the FunctionLikeUnit is the main program since anonymous main programs do not have a symbol.

◆ parentHasHostAssoc()

bool Fortran::lower::pft::FunctionLikeUnit::parentHasHostAssoc ( )

Return true iff the parent is a procedure and the parent has a non-empty set of host associations for variables.

◆ parentHasTupleHostAssoc()

bool Fortran::lower::pft::FunctionLikeUnit::parentHasTupleHostAssoc ( )

Return true iff the parent is a procedure and the parent has a non-empty set of host associations that are conveyed through an extra tuple argument.

◆ parentHostAssoc()

Fortran::lower::HostAssociations & Fortran::lower::pft::FunctionLikeUnit::parentHostAssoc ( )

Return the host associations, if any, from the parent (host) procedure. Crashes if the parent is not a procedure.

Member Data Documentation

◆ entryPointList

llvm::SmallVector<std::pair<const semantics::Symbol *, Evaluation *>, 1> Fortran::lower::pft::FunctionLikeUnit::entryPointList {std::pair{nullptr, nullptr}}

<Symbol, Evaluation> pairs for each entry point. The pair at index 0 is the primary entry point; remaining pairs are alternate entry points. The primary entry point symbol is Null for an anonymous program. A named program symbol has MainProgramDetails. Other symbols have SubprogramDetails. Evaluations are filled in for alternate entries.

◆ primaryResult

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

Primary result for function subprograms with alternate entries. This is one of the largest result values, not necessarily the first one.


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