FLANG
|
#include <flang/Lower/PFTBuilder.h>
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 > > |
![]() | |
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 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::Symbol & | getSubprogramSymbol () const |
const semantics::Symbol * | getMainProgramSymbol () const |
Evaluation * | getEntryEval () const |
void | setHostAssociatedSymbols (const llvm::SetVector< const semantics::Symbol * > &symbols) |
HostAssociations & | parentHostAssoc () |
bool | parentHasTupleHostAssoc () |
bool | parentHasHostAssoc () |
HostAssociations & | getHostAssoc () |
const HostAssociations & | getHostAssoc () const |
LLVM_DUMP_METHOD void | dump () const |
const Fortran::semantics::Scope & | getScope () const |
Get the function scope. | |
![]() | |
template<typename A > | |
ProgramUnit (const A &p, const PftNode &parent) | |
ProgramUnit (ProgramUnit &&)=default | |
ProgramUnit (const ProgramUnit &)=delete | |
![]() | |
ReferenceVariantBase (std::variant< Ref< A >... > b) | |
template<typename T > | |
ReferenceVariantBase (Ref< T > b) | |
template<typename B > | |
constexpr BaseType< B > & | get () const |
template<typename B > | |
constexpr BaseType< B > & | getStatement () 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 |
Public Attributes | |
std::optional< FunctionStatement > | beginStmt |
Anonymous programs do not have a begin statement. | |
FunctionStatement | endStmt |
const semantics::Scope * | scope |
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::Symbol * | primaryResult {nullptr} |
bool | hasIeeeAccess {false} |
bool | mayModifyHaltingMode {false} |
bool | mayModifyRoundingMode {false} |
bool | mayModifyUnderflowMode {false} |
mlir::Block * | finalBlock {} |
Terminal basic block (if any) | |
HostAssociations | hostAssociations |
![]() | |
PftNode | parent |
Function-like units may contain evaluations (executable statements), directives, and internal (nested) function-like units.
|
inline |
Return a pointer to the current entry point Evaluation. This is null for a primary entry point.
|
inline |
Return the host associations for this function like unit. The list of host associations are kept in the host procedure.
|
inline |
Return a pointer to the main program symbol for named programs Return the null pointer for anonymous programs
|
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.
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.
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.
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.
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.
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.