clang API Documentation
Describes the kind of initialization being performed, along with location information for tokens related to the initialization (equal sign, parentheses). More...
#include <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 | 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. If the reference is the first parameter in a copy or move constructor, such conversions are permitted even though we are performing copy-initialization. | |
SourceRange | getParenRange () const |
Retrieve the source range containing the locations of the open and closing parentheses for value and direct 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 | 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. |
Describes the kind of initialization being performed, along with location information for tokens related to the initialization (equal sign, parentheses).
Definition at line 447 of file Initialization.h.
The kind of initialization being performed.
IK_Direct |
Direct initialization. |
IK_DirectList |
Direct list-initialization. |
IK_Copy |
Copy initialization. |
IK_Default |
Default initialization. |
IK_Value |
Value initialization. |
Definition at line 450 of file Initialization.h.
bool clang::InitializationKind::AllowExplicit | ( | ) | const [inline] |
Retrieve whether this initialization allows the use of explicit constructors.
Definition at line 599 of file Initialization.h.
References isCopyInit().
Referenced by PerformConstructorInitialization(), TryConstructorInitialization(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
bool clang::InitializationKind::allowExplicitConversionFunctionsInRefBinding | ( | ) | const [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 605 of file Initialization.h.
References isCopyInit().
Referenced by TryRefInitWithConversionFunction().
static InitializationKind clang::InitializationKind::CreateCast | ( | SourceRange | TypeRange | ) | [inline, static] |
Create a direct initialization due to a cast that isn't a C-style or functional cast.
Definition at line 503 of file Initialization.h.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and IK_Direct.
Referenced by tryDiagnoseOverloadedCast(), and TryStaticImplicitCast().
static InitializationKind clang::InitializationKind::CreateCopy | ( | SourceLocation | InitLoc, |
SourceLocation | EqualLoc, | ||
bool | AllowExplicitConvs = false |
||
) | [inline, static] |
Create a copy initialization.
Definition at line 528 of file Initialization.h.
References IK_Copy.
Referenced by clang::Sema::ActOnFinishCXXInClassMemberInitializer(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildCXXDefaultArgExpr(), clang::Sema::BuildExceptionDeclaration(), clang::Sema::CanPerformCopyInitialization(), CheckObjCCollectionLiteralElement(), ConvertForConditional(), EvaluateBinaryTypeTrait(), clang::Sema::FindCompositePointerType(), clang::Sema::PerformCopyInitialization(), clang::Sema::performLambdaInitCaptureInitialization(), clang::Sema::PerformMoveOrCopyInitialization(), clang::Sema::SetParamDefaultArgument(), and TryClassUnification().
static InitializationKind clang::InitializationKind::CreateCStyleCast | ( | SourceLocation | StartLoc, |
SourceRange | TypeRange, | ||
bool | InitList | ||
) | [inline, static] |
Create a direct initialization for a C-style cast.
Definition at line 509 of file Initialization.h.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), IK_Direct, and IK_DirectList.
Referenced by clang::Sema::BuildCompoundLiteralExpr(), tryDiagnoseOverloadedCast(), and TryStaticImplicitCast().
static InitializationKind clang::InitializationKind::CreateDefault | ( | SourceLocation | InitLoc | ) | [inline, static] |
Create a default initialization.
Definition at line 537 of file Initialization.h.
References IK_Default.
Referenced by clang::Sema::ActOnUninitializedDecl(), clang::Sema::BuildCXXNew(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), and clang::Sema::SetIvarInitializers().
static InitializationKind clang::InitializationKind::CreateDirect | ( | SourceLocation | InitLoc, |
SourceLocation | LParenLoc, | ||
SourceLocation | RParenLoc | ||
) | [inline, static] |
Create a direct initialization.
Definition at line 489 of file Initialization.h.
References IK_Direct.
Referenced by addAsFieldToClosureType(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), clang::Sema::BuildMemberInitializer(), evaluateTypeTrait(), clang::Sema::performLambdaInitCaptureInitialization(), and TryListInitialization().
static InitializationKind clang::InitializationKind::CreateDirectList | ( | SourceLocation | InitLoc | ) | [inline, static] |
Definition at line 496 of file Initialization.h.
References IK_DirectList.
Referenced by clang::Sema::ActOnFinishCXXInClassMemberInitializer(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), clang::Sema::BuildMemberInitializer(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::performLambdaInitCaptureInitialization(), and TryInitializerListConstruction().
static InitializationKind clang::InitializationKind::CreateFunctionalCast | ( | SourceRange | TypeRange, |
bool | InitList | ||
) | [inline, static] |
Create a direct initialization for a functional cast.
Definition at line 520 of file Initialization.h.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), IK_Direct, and IK_DirectList.
Referenced by tryDiagnoseOverloadedCast(), and TryStaticImplicitCast().
static InitializationKind clang::InitializationKind::CreateValue | ( | SourceLocation | InitLoc, |
SourceLocation | LParenLoc, | ||
SourceLocation | RParenLoc, | ||
bool | isImplicit = false |
||
) | [inline, static] |
Create a value initialization.
Definition at line 542 of file Initialization.h.
References IK_Value.
Referenced by clang::Sema::BuildCXXTypeConstructExpr().
SourceLocation clang::InitializationKind::getEqualLoc | ( | ) | const [inline] |
Retrieve the location of the equal sign for copy initialization (if present).
Definition at line 590 of file Initialization.h.
References IK_Copy.
Referenced by PerformConstructorInitialization().
InitKind clang::InitializationKind::getKind | ( | ) | const [inline] |
Determine the initialization kind.
Definition at line 551 of file Initialization.h.
Referenced by clang::InitializationSequence::Diagnose(), clang::InitializationSequence::InitializeFrom(), isExplicitTemporary(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), TryConstructorInitialization(), TryDefaultInitialization(), and TryListInitialization().
SourceLocation clang::InitializationKind::getLocation | ( | ) | const [inline] |
Retrieve the location at which initialization is occurring.
Definition at line 581 of file Initialization.h.
Referenced by clang::InitializationSequence::Diagnose(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), TryConstructorInitialization(), TryListInitialization(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
SourceRange clang::InitializationKind::getParenRange | ( | ) | const [inline] |
Retrieve the source range containing the locations of the open and closing parentheses for value and direct initializations.
Definition at line 611 of file Initialization.h.
References IK_Direct, and IK_Value.
Referenced by clang::InitializationSequence::Perform(), and PerformConstructorInitialization().
SourceRange clang::InitializationKind::getRange | ( | ) | const [inline] |
Retrieve the source range that covers the initialization.
Definition at line 584 of file Initialization.h.
Referenced by clang::InitializationSequence::Perform().
bool clang::InitializationKind::isCopyInit | ( | ) | const [inline] |
Definition at line 595 of file Initialization.h.
References IK_Copy.
Referenced by AllowExplicit(), allowExplicitConversionFunctionsInRefBinding(), and PerformConstructorInitialization().
bool clang::InitializationKind::isCStyleCast | ( | ) | const [inline] |
Determine whether this is a C-style cast.
Definition at line 566 of file Initialization.h.
Referenced by clang::InitializationSequence::Perform().
bool clang::InitializationKind::isCStyleOrFunctionalCast | ( | ) | const [inline] |
Determine whether this initialization is a C-style cast.
Definition at line 561 of file Initialization.h.
Referenced by clang::InitializationSequence::Diagnose(), clang::InitializationSequence::InitializeFrom(), clang::InitializationSequence::Perform(), and TryReferenceInitializationCore().
bool clang::InitializationKind::isExplicitCast | ( | ) | const [inline] |
Determine whether this initialization is an explicit cast.
Definition at line 556 of file Initialization.h.
Referenced by clang::InitializationSequence::Perform().
bool clang::InitializationKind::isFunctionalCast | ( | ) | const [inline] |
Determine whether this is a functional-style cast.
Definition at line 571 of file Initialization.h.
Referenced by clang::InitializationSequence::Perform().
bool clang::InitializationKind::isImplicitValueInit | ( | ) | const [inline] |
Determine whether this initialization is an implicit value-initialization, e.g., as occurs during aggregate initialization.
Definition at line 578 of file Initialization.h.
Referenced by clang::InitializationSequence::Perform().