FLANG
Fortran::common Namespace Reference

Classes

struct  __is_same_uncvref
struct  AreSameTypeHelper
struct  AreTypesDistinctHelper
class  BitSet
struct  CombineTuplesHelper
struct  CombineVariantsHelper
class  CountedReference
class  EnumSet
class  FastIntSet
struct  FormatMessage
class  ForwardOwningPointer
struct  HostSignedIntTypeHelper
struct  HostUnsignedIntTypeHelper
class  Indirection
class  Indirection< A, true >
class  Int128
class  Interval
class  IntrinsicTypeDefaultKinds
class  LangOptions
class  LangOptionsBase
class  LanguageFeatureControl
struct  MapTemplateHelper
struct  MapTemplateHelper< F, PACKAGE, std::tuple< Ts... > >
struct  MapTemplateHelper< F, PACKAGE, std::variant< Ts... > >
struct  MatchType
class  MathOptionsBase
struct  OverMembersHelper
struct  OverMembersHelper< T, std::tuple< Ts... > >
struct  OverMembersHelper< T, std::variant< Ts... > >
class  RealCharacteristics
class  Reference
class  ReferenceCounted
class  Restorer
struct  Rounding
struct  SearchMembersHelper
struct  SearchTypeListHelper
class  StaticMultimapView
struct  TupleToVariantHelper
struct  TupleToVariantHelper< std::tuple< Ts... > >
struct  UnwrapperHelper
struct  VariantToTupleHelper
struct  VariantToTupleHelper< std::variant< Ts... > >
struct  visitors

Typedefs

template<typename A, typename... B>
using IfNoLvalue = std::enable_if_t<(... && !std::is_lvalue_reference_v<B>), A>
template<typename... RVREF>
using NoLvalue = IfNoLvalue<void, RVREF...>
template<typename A>
using CopyableIndirection = Indirection<A, true>
template<class _Tp>
using __remove_cvref_t = std::remove_cv_t<std::remove_reference_t<_Tp>>
template<template< typename... > class T, typename TUPLEorVARIANT>
using OverMembers
template<typename... TUPLES>
using CombineTuples = typename CombineTuplesHelper<TUPLES...>::type
template<typename VARIANT>
using VariantToTuple = typename VariantToTupleHelper<VARIANT>::type
template<typename TUPLE>
using TupleToVariant = typename TupleToVariantHelper<TUPLE>::type
template<typename... VARIANTS>
using CombineVariants = typename CombineVariantsHelper<VARIANTS...>::type
template<typename VARIANT>
using SquashVariantOfVariants = OverMembers<CombineVariants, VARIANT>
template<template< typename > class F, typename TUPLEorVARIANT, template< typename... > class PACKAGE = std::variant>
using MapTemplate
using UnsignedInt128 = Int128<false>
using SignedInt128 = Int128<true>
using uint128_t = UnsignedInt128
using int128_t = SignedInt128
template<int BITS>
using HostUnsignedIntType = typename HostUnsignedIntTypeHelper<BITS>::type
template<int BITS>
using HostSignedIntType = typename HostSignedIntTypeHelper<BITS>::type
template<typename A, typename B>
using Constify
using ConstantSubscript = std::int64_t
using LanguageFeatures = EnumSet<LanguageFeature, LanguageFeature_enumSize>
using UsageWarnings = EnumSet<UsageWarning, UsageWarning_enumSize>
using LanguageFeatureOrWarning = std::variant<LanguageFeature, UsageWarning>
using LanguageControlFlag
using Label = std::uint64_t

Enumerations

enum class  RoundingMode : std::uint8_t {
  ToZero , TiesToEven , Up , Down ,
  TiesAwayFromZero
}

Functions

template<typename INT, std::enable_if_t<(sizeof(INT) > 4 &&sizeof(INT)<=8), int > = 0>
constexpr int BitPopulationCount (INT x)
template<typename INT, std::enable_if_t<(sizeof(INT) > 2 &&sizeof(INT)<=4), int > = 0>
constexpr int BitPopulationCount (INT x)
template<typename INT, std::enable_if_t< sizeof(INT)==2, int > = 0>
constexpr int BitPopulationCount (INT x)
template<typename INT, std::enable_if_t< sizeof(INT)==1, int > = 0>
constexpr int BitPopulationCount (INT x)
template<typename INT>
constexpr bool Parity (INT x)
template<typename INT>
constexpr int TrailingZeroBitCount (INT x)
constexpr std::size_t CountEnumNames (const char *p)
template<std::size_t ITEMS>
constexpr std::array< std::string_view, ITEMS > EnumNames (const char *p)
template<typename T>
RT_API_ATTRS T ErfcScaled (T arg)
 ENUM_CLASS (TokenKind, None, A, B, BN, BZ, D, DC, DP, DT, E, EN, ES, EX, F, G, I, L, O, P, RC, RD, RN, RP, RU, RZ, S, SP, SS, T, TL, TR, X, Z, Colon, Slash, Backslash, Dollar, Star, LParen, RParen, Comma, Point, Sign, UnsignedInteger, String) template< typename CHAR
 ENUM_CLASS (TypeCategory, Integer, Unsigned, Real, Complex, Character, Logical, Derived) ENUM_CLASS(IoStmtKind
Write ENUM_CLASS (DefinedIo, ReadFormatted, ReadUnformatted, WriteFormatted, WriteUnformatted) RT_OFFLOAD_VAR_GROUP_BEGIN static const expr int maxRank
template<typename... LAMBDAS>
 visitors (LAMBDAS... x) -> visitors< LAMBDAS... >
void die (const char *,...)
template<typename T>
constexpr T & Deref (T *p, const char *file, int line)
template<typename T>
constexpr T & Deref (const std::unique_ptr< T > &p, const char *file, int line)
template<typename A>
Clone (const A &x)
constexpr int LeadingZeroBitCount (std::uint64_t x)
constexpr int LeadingZeroBitCount (std::uint32_t x)
constexpr int LeadingZeroBitCount (std::uint16_t x)
constexpr int LeadingZeroBitCount (std::uint8_t x)
template<typename A>
constexpr int BitsNeededFor (A x)
template<typename A>
 Reference (A &) -> Reference< A >
template<typename A, typename B>
RT_API_ATTRS common::IfNoLvalue< Restorer< A >, B > ScopedSet (A &to, B &&from)
template<typename A, typename B>
RT_API_ATTRS common::IfNoLvalue< Restorer< A >, B > ScopedSet (A &to, const B &from)
 ENUM_CLASS (RealFlag, InvalidArgument, Denorm, DivideByZero, Overflow, Underflow, Inexact) using RealFlags
template<typename A>
std::optional< A > JoinOptional (std::optional< std::optional< A > > &&x)
template<typename A>
const A * GetPtrFromOptional (const std::optional< A > &x)
template<typename TOV, typename FROMV>
TOV CopyVariant (const FROMV &u)
template<typename TOV, typename FROMV>
common::IfNoLvalue< TOV, FROMV > MoveVariant (FROMV &&u)
template<typename... A, std::size_t... J>
std::optional< std::tuple< A... > > AllElementsPresentHelper (std::tuple< std::optional< A >... > &&t, std::index_sequence< J... >)
template<typename... A>
std::optional< std::tuple< A... > > AllElementsPresent (std::tuple< std::optional< A >... > &&t)
template<typename A>
std::optional< std::vector< A > > AllElementsPresent (std::vector< std::optional< A > > &&v)
template<typename... A>
std::optional< std::tuple< A... > > AllPresent (std::optional< A > &&...x)
template<typename R, typename... A>
std::optional< R > MapOptional (std::function< R(A &&...)> &&f, std::optional< A > &&...x)
template<typename R, typename... A>
std::optional< R > MapOptional (R(*f)(A &&...), std::optional< A > &&...x)
template<std::size_t J, typename VISITOR>
common::IfNoLvalue< typename VISITOR::Result, VISITOR > SearchTypesHelper (VISITOR &&visitor, typename VISITOR::Result &&defaultResult)
template<typename VISITOR>
common::IfNoLvalue< typename VISITOR::Result, VISITOR > SearchTypes (VISITOR &&visitor, typename VISITOR::Result defaultResult=typename VISITOR::Result{})
template<typename A, typename B>
auto Unwrap (B &x) -> Constify< A, B > *
template<typename A, typename B>
std::optional< A > UnwrapCopy (const B &x)
 ENUM_CLASS (LanguageFeature, BackslashEscapes, OldDebugLines, FixedFormContinuationWithColumn1Ampersand, LogicalAbbreviations, XOROperator, PunctuationInNames, OptionalFreeFormSpace, BOZExtensions, EmptyStatement, AlternativeNE, ExecutionPartNamelist, DECStructures, DoubleComplex, Byte, StarKind, ExponentMatchingKindParam, QuadPrecision, SlashInitialization, TripletInArrayConstructor, MissingColons, SignedComplexLiteral, OldStyleParameter, ComplexConstructor, PercentLOC, SignedMultOperand, FileName, Carriagecontrol, Convert, Dispose, IOListLeadingComma, AbbreviatedEditDescriptor, ProgramParentheses, PercentRefAndVal, OmitFunctionDummies, CrayPointer, Hollerith, ArithmeticIF, Assign, AssignedGOTO, Pause, OpenACC, OpenMP, CUDA, CruftAfterAmpersand, ClassicCComments, AdditionalFormats, BigIntLiterals, RealDoControls, EquivalenceNumericWithCharacter, EquivalenceNonDefaultNumeric, EquivalenceSameNonSequence, AdditionalIntrinsics, AnonymousParents, OldLabelDoEndStatements, LogicalIntegerAssignment, EmptySourceFile, ProgramReturn, ImplicitNoneTypeNever, ImplicitNoneTypeAlways, ImplicitNoneExternal, ForwardRefImplicitNone, OpenAccessAppend, BOZAsDefaultInteger, DistinguishableSpecifics, DefaultSave, PointerInSeqType, NonCharacterFormat, SaveMainProgram, SaveBigMainProgramVariables, DistinctArrayConstructorLengths, PPCVector, RelaxedIntentInChecking, ForwardRefImplicitNoneData, NullActualForAllocatable, ActualIntegerConvertedToSmallerKind, HollerithOrCharacterAsBOZ, BindingAsProcedure, StatementFunctionExtensions, UseGenericIntrinsicWhenSpecificDoesntMatch, DataStmtExtensions, RedundantContiguous, RedundantAttribute, InitBlankCommon, EmptyBindCDerivedType, MiscSourceExtensions, AllocateToOtherLength, LongNames, IntrinsicAsSpecific, BenignNameClash, BenignRedundancy, NullMoldAllocatableComponentValue, NopassScalarBase, MiscUseExtensions, ImpliedDoIndexScope, DistinctCommonSizes, OddIndexVariableRestrictions, IndistinguishableSpecifics, SubroutineAndFunctionSpecifics, EmptySequenceType, NonSequenceCrayPointee, BranchIntoConstruct, BadBranchTarget, HollerithPolymorphic, ListDirectedSize, NonBindCInteroperability, CudaManaged, CudaUnified, PolymorphicActualAllocatableOrPointerToMonomorphicDummy, RelaxedPureDummy, UndefinableAsynchronousOrVolatileActual, AutomaticInMainProgram, PrintCptr, SavedLocalInSpecExpr, PrintNamelist, AssumedRankPassedToNonAssumedRank, IgnoreIrrelevantAttributes, Unsigned, AmbiguousStructureConstructor, ContiguousOkForSeqAssociation, ForwardRefExplicitTypeDummy, InaccessibleDeferredOverride, CudaWarpMatchFunction, DoConcurrentOffload, TransferBOZ, Coarray) ENUM_CLASS(UsageWarning
constexpr bool IsNumericTypeCategory (TypeCategory category)
const char * AsFortran (NumericOperator)
const char * AsFortran (LogicalOperator)
const char * AsFortran (RelationalOperator)
 ENUM_CLASS (IoSpecKind, Access, Action, Advance, Asynchronous, Blank, Decimal, Delim, Direct, Encoding, End, Eor, Err, Exist, File, Fmt, Form, Formatted, Id, Iomsg, Iostat, Name, Named, Newunit, Nextrec, Nml, Number, Opened, Pad, Pending, Pos, Position, Read, Readwrite, Rec, Recl, Round, Sequential, Sign, Size, Status, Stream, Unformatted, Unit, Write, Carriagecontrol, Convert, Dispose,) const char *AsFortran(DefinedIo)
 ENUM_CLASS (CUDADataAttr, Constant, Device, Managed, Pinned, Shared, Texture, Unified) ENUM_CLASS(OpenACCDeviceType
 ENUM_CLASS (IgnoreTKR, Type, Kind, Rank, Device, Managed, Contiguous) using IgnoreTKRSet
std::string AsFortran (IgnoreTKRSet)
bool AreCompatibleCUDADataAttrs (std::optional< CUDADataAttr >, std::optional< CUDADataAttr >, IgnoreTKRSet, bool allowUnifiedMatchingRule, bool isHostDeviceProcedure, const LanguageFeatureControl *features=nullptr)
std::string GetExternalAssemblyName (std::string symbolName, bool underscoring)
template<typename FortranPredefinitions>
void setOpenMPMacro (int version, FortranPredefinitions &predefinitions)
 Set _OPENMP macro according to given version number.
std::string getFlangRepositoryPath ()
std::string getLLVMRepositoryPath ()
std::string getFlangRevision ()
std::string getLLVMRevision ()
std::string getFlangFullRepositoryVersion ()
std::string getFlangFullVersion ()
std::string getFlangToolFullVersion (llvm::StringRef ToolName)
 Like getFlangFullVersion(), but with a custom tool name.
const char * AsFortran (DefinedIo x)

Variables

 None
 Backspace
 Close
 Endfile
 Flush
 Inquire
 Open
 Print
 Read
 Rewind
 Wait
template<template< typename > class PREDICATE, typename... TYPES>
constexpr int SearchTypeList
template<typename A, typename... TYPES>
constexpr int TypeIndex {SearchTypeList<MatchType<A>::template Match, TYPES...>}
template<typename A, typename... TYPES>
constexpr bool IsTypeInList {TypeIndex<A, TYPES...> >= 0}
template<template< typename > class PREDICATE, typename TUPLEorVARIANT>
constexpr int SearchMembers
template<typename A, typename TUPLEorVARIANT>
constexpr int FindMember
template<typename A, typename TUPLEorVARIANT>
constexpr bool HasMember {FindMember<A, TUPLEorVARIANT> >= 0}
template<typename... Ts>
constexpr bool AreTypesDistinct {AreTypesDistinctHelper<Ts...>::value()}
template<typename... Ts>
constexpr bool AreSameType {AreSameTypeHelper<Ts...>::value()}
 Portability
 PointerToUndefinable
 NonTargetPassedToTarget
 PointerToPossibleNoncontiguous
 ShortCharacterActual
 ShortArrayActual
 ImplicitInterfaceActual
 PolymorphicTransferArg
 PointerComponentTransferArg
 TransferSizePresence
 F202XAllocatableBreakingChange
 OptionalMustBePresent
 CommonBlockPadding
 LogicalVsCBool
 BindCCharLength
 ProcDummyArgShapes
 ExternalNameConflict
 FoldingException
 FoldingAvoidsRuntimeCrash
 FoldingValueChecks
 FoldingFailure
 FoldingLimit
 Interoperability
 CharacterInteroperability
 Bounds
 Preprocessing
 Scanning
 OpenAccUsage
 ProcPointerCompatibility
 VoidMold
 KnownBadImplicitInterface
 EmptyCase
 CaseOverflow
 CUDAUsage
 IgnoreTKRUsage
 ExternalInterfaceMismatch
 DefinedOperatorArgs
 Final
 ZeroDoStep
 UnusedForallIndex
 OpenMPUsage
 DataLength
 IgnoredDirective
 HomonymousSpecific
 HomonymousResult
 IgnoredIntrinsicFunctionType
 PreviousScalarUse
 RedeclaredInaccessibleComponent
 ImplicitShared
 IndexVarRedefinition
 IncompatibleImplicitInterfaces
 CdefinedInit
 VectorSubscriptFinalization
 UndefinedFunctionResult
 UselessIomsg
 MismatchingDummyProcedure
 SubscriptedEmptyArray
 UnsignedLiteralTruncation
 CompatibleDeclarationsFromDistinctModules
 NullActualForDefaultIntentAllocatable
 UseAssociationIntoSameNameSubprogram
 HostAssociatedIntentOutInSpecExpr
 NonVolatilePointerToVolatile
 RealConstantWidening
 Star
 Default
 Nvidia
 Radeon
 Host
 Multicore

Detailed Description

StaticMultimapView is a constexpr friendly multimap implementation over sorted constexpr arrays. As the View name suggests, it does not duplicate the sorted array but only brings range and search concepts over it. It mainly erases the array size from the type and ensures the array is sorted at compile time. When C++20 brings std::span and constexpr std::is_sorted, this can most likely be replaced by those.

Typedef Documentation

◆ Constify

template<typename A, typename B>
using Fortran::common::Constify
Initial value:
std::conditional_t<std::is_const_v<B> && !std::is_const_v<A>,
std::add_const_t<A>, A>

◆ LanguageControlFlag

using Fortran::common::LanguageControlFlag
Initial value:
std::pair<LanguageFeatureOrWarning, bool>

◆ MapTemplate

template<template< typename > class F, typename TUPLEorVARIANT, template< typename... > class PACKAGE = std::variant>
using Fortran::common::MapTemplate

◆ OverMembers

template<template< typename... > class T, typename TUPLEorVARIANT>
using Fortran::common::OverMembers
Initial value:

Function Documentation

◆ AreCompatibleCUDADataAttrs()

bool Fortran::common::AreCompatibleCUDADataAttrs ( std::optional< CUDADataAttr > x,
std::optional< CUDADataAttr > y,
IgnoreTKRSet ignoreTKR,
bool allowUnifiedMatchingRule,
bool isHostDeviceProcedure,
const LanguageFeatureControl * features )

Check compatibilty of CUDA attribute. When allowUnifiedMatchingRule is enabled, argument x represents the dummy argument attribute while y represents the actual argument attribute.

◆ getFlangFullRepositoryVersion()

std::string Fortran::common::getFlangFullRepositoryVersion ( )

Retrieves the full repository version that is an amalgamation of the information in getFlangRepositoryPath() and getFlangRevision().

◆ getFlangFullVersion()

std::string Fortran::common::getFlangFullVersion ( )

Retrieves a string representing the complete flang version, which includes the flang version number, the repository version, and the vendor tag.

◆ getFlangRepositoryPath()

std::string Fortran::common::getFlangRepositoryPath ( )

Retrieves the repository path (e.g., Git path) that identifies the particular Flang branch, tag, or trunk from which this Flang was built.

◆ getFlangRevision()

std::string Fortran::common::getFlangRevision ( )

Retrieves the repository revision number (or identifier) from which this Flang was built.

◆ getLLVMRepositoryPath()

std::string Fortran::common::getLLVMRepositoryPath ( )

Retrieves the repository path from which LLVM was built.

This supports LLVM residing in a separate repository from flang.

◆ getLLVMRevision()

std::string Fortran::common::getLLVMRevision ( )

Retrieves the repository revision number (or identifier) from which LLVM was built.

If Flang and LLVM are in the same repository, this returns the same string as getFlangRevision.

Variable Documentation

◆ FindMember

template<typename A, typename TUPLEorVARIANT>
int Fortran::common::FindMember
constexpr
Initial value:
{
SearchMembers<MatchType<A>::template Match, TUPLEorVARIANT>}

◆ SearchMembers

template<template< typename > class PREDICATE, typename TUPLEorVARIANT>
int Fortran::common::SearchMembers
constexpr
Initial value:
{
OverMembers<SearchMembersHelper<PREDICATE>::template Scanner,
TUPLEorVARIANT>::value()}

◆ SearchTypeList

template<template< typename > class PREDICATE, typename... TYPES>
int Fortran::common::SearchTypeList
constexpr
Initial value:
{
SearchTypeListHelper<0, PREDICATE, std::tuple<TYPES...>>::value()}