clang 20.0.0git
|
Describes the kind of initialization being performed, along with location information for tokens related to the initialization (equal sign, parentheses). More...
#include "clang/Sema/Initialization.h"
Public Types | |
enum | InitKind { IK_Direct , IK_DirectList , IK_Copy , IK_Default , IK_Value } |
The kind of initialization being performed. More... | |
Public Member Functions | |
InitKind | getKind () const |
Determine the initialization kind. | |
bool | isExplicitCast () const |
Determine whether this initialization is an explicit cast. | |
bool | isStaticCast () const |
Determine whether this initialization is a static cast. | |
bool | isCStyleOrFunctionalCast () const |
Determine whether this initialization is a C-style cast. | |
bool | isCStyleCast () const |
Determine whether this is a C-style cast. | |
bool | isFunctionalCast () const |
Determine whether this is a functional-style cast. | |
bool | isImplicitValueInit () const |
Determine whether this initialization is an implicit value-initialization, e.g., as occurs during aggregate initialization. | |
SourceLocation | getLocation () const |
Retrieve the location at which initialization is occurring. | |
SourceRange | getRange () const |
Retrieve the source range that covers the initialization. | |
SourceLocation | getEqualLoc () const |
Retrieve the location of the equal sign for copy initialization (if present). | |
bool | isCopyInit () const |
bool | AllowExplicit () const |
Retrieve whether this initialization allows the use of explicit constructors. | |
bool | allowExplicitConversionFunctionsInRefBinding () const |
Retrieve whether this initialization allows the use of explicit conversion functions when binding a reference. | |
bool | hasParenOrBraceRange () const |
Determine whether this initialization has a source range containing the locations of open and closing parentheses or braces. | |
SourceRange | getParenOrBraceRange () const |
Retrieve the source range containing the locations of the open and closing parentheses or braces for value, direct, and direct list initializations. | |
Static Public Member Functions | |
static InitializationKind | CreateDirect (SourceLocation InitLoc, SourceLocation LParenLoc, SourceLocation RParenLoc) |
Create a direct initialization. | |
static InitializationKind | CreateDirectList (SourceLocation InitLoc) |
static InitializationKind | CreateDirectList (SourceLocation InitLoc, SourceLocation LBraceLoc, SourceLocation RBraceLoc) |
static InitializationKind | CreateCast (SourceRange TypeRange) |
Create a direct initialization due to a cast that isn't a C-style or functional cast. | |
static InitializationKind | CreateCStyleCast (SourceLocation StartLoc, SourceRange TypeRange, bool InitList) |
Create a direct initialization for a C-style cast. | |
static InitializationKind | CreateFunctionalCast (SourceRange TypeRange, bool InitList) |
Create a direct initialization for a functional cast. | |
static InitializationKind | CreateCopy (SourceLocation InitLoc, SourceLocation EqualLoc, bool AllowExplicitConvs=false) |
Create a copy initialization. | |
static InitializationKind | CreateDefault (SourceLocation InitLoc) |
Create a default initialization. | |
static InitializationKind | CreateValue (SourceLocation InitLoc, SourceLocation LParenLoc, SourceLocation RParenLoc, bool isImplicit=false) |
Create a value initialization. | |
static InitializationKind | CreateForInit (SourceLocation Loc, bool DirectInit, Expr *Init) |
Create an initialization from an initializer (which, for direct initialization from a parenthesized list, will be a ParenListExpr). | |
Describes the kind of initialization being performed, along with location information for tokens related to the initialization (equal sign, parentheses).
Definition at line 580 of file Initialization.h.
The kind of initialization being performed.
Enumerator | |
---|---|
IK_Direct | Direct initialization. |
IK_DirectList | Direct list-initialization. |
IK_Copy | Copy initialization. |
IK_Default | Default initialization. |
IK_Value | Value initialization. |
Definition at line 583 of file Initialization.h.
|
inline |
Retrieve whether this initialization allows the use of explicit constructors.
Definition at line 773 of file Initialization.h.
References isCopyInit().
|
inline |
Retrieve whether this initialization allows the use of explicit conversion functions when binding a reference.
If the reference is the first parameter in a copy or move constructor, such conversions are permitted even though we are performing copy-initialization.
Definition at line 779 of file Initialization.h.
References isCopyInit().
|
inlinestatic |
Create a direct initialization due to a cast that isn't a C-style or functional cast.
Definition at line 662 of file Initialization.h.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and IK_Direct.
Referenced by tryDiagnoseOverloadedCast(), and TryStaticImplicitCast().
|
inlinestatic |
Create a copy initialization.
Definition at line 687 of file Initialization.h.
References IK_Copy.
Referenced by clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::Sema::BuildExceptionDeclaration(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::CanPerformCopyInitialization(), CheckConvertibilityForTypeTraits(), CheckObjCCollectionLiteralElement(), checkTupleLikeDecomposition(), ConvertForConditional(), clang::Sema::ConvertMemberDefaultInitExpression(), clang::Sema::ConvertParamDefaultArgument(), CreateForInit(), EvaluateBooleanTypeTrait(), clang::Sema::FindCompositePointerType(), clang::Sema::PerformCopyInitialization(), clang::Sema::PerformMoveOrCopyInitialization(), clang::Sema::SubstDefaultArgument(), TryClassUnification(), clang::Sema::tryConvertExprToType(), and TryListInitialization().
|
inlinestatic |
Create a direct initialization for a C-style cast.
Definition at line 668 of file Initialization.h.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), IK_Direct, and IK_DirectList.
Referenced by clang::Sema::BuildCompoundLiteralExpr(), tryDiagnoseOverloadedCast(), and TryStaticImplicitCast().
|
inlinestatic |
Create a default initialization.
Definition at line 696 of file Initialization.h.
References IK_Default.
Referenced by clang::Sema::ActOnUninitializedDecl(), clang::Sema::BuildCXXNew(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), CreateForInit(), and clang::SemaObjC::SetIvarInitializers().
|
inlinestatic |
Create a direct initialization.
Definition at line 641 of file Initialization.h.
References IK_Direct.
Referenced by clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCaptureInit(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::BuildMemberInitializer(), CreateForInit(), EvaluateBooleanTypeTrait(), and TryListInitialization().
|
inlinestatic |
Definition at line 648 of file Initialization.h.
References IK_DirectList.
Referenced by clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::BuildMemberInitializer(), clang::Sema::ConvertMemberDefaultInitExpression(), clang::Sema::CreateBuiltinBinOp(), CreateForInit(), and TryInitializerListConstruction().
|
inlinestatic |
Definition at line 653 of file Initialization.h.
References IK_DirectList.
|
inlinestatic |
Create an initialization from an initializer (which, for direct initialization from a parenthesized list, will be a ParenListExpr).
Definition at line 711 of file Initialization.h.
References CreateCopy(), CreateDefault(), CreateDirect(), CreateDirectList(), clang::DirectInit, clang::Init, and Loc.
Referenced by clang::Sema::AddInitializerToDecl(), clang::Sema::buildCoroutinePromise(), clang::Sema::CheckTemplateArgument(), clang::Sema::deduceVarTypeFromInitializer(), and TryOrBuildParenListInitialization().
|
inlinestatic |
Create a direct initialization for a functional cast.
Definition at line 679 of file Initialization.h.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), IK_Direct, and IK_DirectList.
Referenced by tryDiagnoseOverloadedCast(), and TryStaticImplicitCast().
|
inlinestatic |
Create a value initialization.
Definition at line 701 of file Initialization.h.
References IK_Value.
Referenced by clang::Sema::BuildCXXTypeConstructExpr(), and TryOrBuildParenListInitialization().
|
inline |
Retrieve the location of the equal sign for copy initialization (if present).
Definition at line 764 of file Initialization.h.
References IK_Copy.
|
inline |
Determine the initialization kind.
Definition at line 722 of file Initialization.h.
|
inline |
Retrieve the location at which initialization is occurring.
Definition at line 755 of file Initialization.h.
|
inline |
Retrieve the source range containing the locations of the open and closing parentheses or braces for value, direct, and direct list initializations.
Definition at line 792 of file Initialization.h.
References hasParenOrBraceRange().
|
inline |
Retrieve the source range that covers the initialization.
Definition at line 758 of file Initialization.h.
|
inline |
Determine whether this initialization has a source range containing the locations of open and closing parentheses or braces.
Definition at line 785 of file Initialization.h.
References IK_Direct, IK_DirectList, and IK_Value.
Referenced by getParenOrBraceRange().
|
inline |
Definition at line 769 of file Initialization.h.
References IK_Copy.
Referenced by AllowExplicit(), and allowExplicitConversionFunctionsInRefBinding().
|
inline |
Determine whether this is a C-style cast.
Definition at line 740 of file Initialization.h.
|
inline |
Determine whether this initialization is a C-style cast.
Definition at line 735 of file Initialization.h.
|
inline |
Determine whether this initialization is an explicit cast.
Definition at line 727 of file Initialization.h.
|
inline |
Determine whether this is a functional-style cast.
Definition at line 745 of file Initialization.h.
|
inline |
Determine whether this initialization is an implicit value-initialization, e.g., as occurs during aggregate initialization.
Definition at line 752 of file Initialization.h.
|
inline |
Determine whether this initialization is a static cast.
Definition at line 732 of file Initialization.h.