|
clang 22.0.0git
|
Data structure used to record current or nested expression evaluation contexts. More...
#include "clang/Sema/Sema.h"
Classes | |
| struct | InitializationContext |
Public Types | |
| enum | ExpressionKind { EK_Decltype , EK_TemplateArgument , EK_AttrArgument , EK_VariableInit , EK_Other } |
| Describes whether we are in an expression constext which we have to handle differently. More... | |
Public Member Functions | |
| ExpressionEvaluationContextRecord (ExpressionEvaluationContext Context, unsigned NumCleanupObjects, CleanupInfo ParentCleanup, Decl *ManglingContextDecl, ExpressionKind ExprContext) | |
| bool | isUnevaluated () const |
| bool | isPotentiallyEvaluated () const |
| bool | isConstantEvaluated () const |
| bool | isImmediateFunctionContext () const |
| bool | isDiscardedStatementContext () const |
Public Attributes | |
| ExpressionEvaluationContext | Context |
| The expression evaluation context. | |
| CleanupInfo | ParentCleanup |
| Whether the enclosing context needed a cleanup. | |
| unsigned | NumCleanupObjects |
| The number of active cleanup objects when we entered this expression evaluation context. | |
| MaybeODRUseExprSet | SavedMaybeODRUseExprs |
| SmallVector< LambdaExpr *, 2 > | Lambdas |
| The lambdas that are present within this context, if it is indeed an unevaluated context. | |
| Decl * | ManglingContextDecl |
| The declaration that provides context for lambda expressions and block literals if the normal declaration context does not suffice, e.g., in a default function argument. | |
| VarDecl * | DeclForInitializer = nullptr |
| Declaration for initializer if one is currently being parsed. | |
| SmallVector< CallExpr *, 8 > | DelayedDecltypeCalls |
| If we are processing a decltype type, a set of call expressions for which we have deferred checking the completeness of the return type. | |
| SmallVector< CXXBindTemporaryExpr *, 8 > | DelayedDecltypeBinds |
| If we are processing a decltype type, a set of temporary binding expressions for which we have deferred checking the destructor. | |
| llvm::SmallPtrSet< const Expr *, 8 > | PossibleDerefs |
| SmallVector< Expr *, 2 > | VolatileAssignmentLHSs |
| Expressions appearing as the LHS of a volatile assignment in this context. | |
| llvm::SmallVector< ImmediateInvocationCandidate, 4 > | ImmediateInvocationCandidates |
| Set of candidates for starting an immediate invocation. | |
| llvm::SmallPtrSet< DeclRefExpr *, 4 > | ReferenceToConsteval |
| Set of DeclRefExprs referencing a consteval function when used in a context not already known to be immediately invoked. | |
| SmallVector< MaterializeTemporaryExpr *, 8 > | ForRangeLifetimeExtendTemps |
| P2718R0 - Lifetime extension in range-based for loops. | |
| SmallVector< MisalignedMember, 4 > | MisalignedMembers |
| Small set of gathered accesses to potentially misaligned members due to the packed attribute. | |
| enum clang::Sema::ExpressionEvaluationContextRecord::ExpressionKind | ExprContext |
| bool | InDiscardedStatement |
| bool | InImmediateFunctionContext |
| bool | InImmediateEscalatingFunctionContext |
| bool | IsCurrentlyCheckingDefaultArgumentOrInitializer = false |
| bool | InConditionallyConstantEvaluateContext = false |
| bool | InLifetimeExtendingContext = false |
| Whether we are currently in a context in which all temporaries must be lifetime-extended, even if they're not bound to a reference (for example, in a for-range initializer). | |
| bool | IsCaseExpr = false |
| Whether evaluating an expression for a switch case label. | |
| bool | RebuildDefaultArgOrDefaultInit = false |
| Whether we should rebuild CXXDefaultArgExpr and CXXDefaultInitExpr. | |
| std::optional< InitializationContext > | DelayedDefaultInitializationContext |
Data structure used to record current or nested expression evaluation contexts.
|
inline |
Definition at line 6859 of file Sema.h.
References Context, ExprContext, false, InDiscardedStatement, InImmediateEscalatingFunctionContext, InImmediateFunctionContext, ManglingContextDecl, NumCleanupObjects, and ParentCleanup.
|
inline |
Definition at line 6883 of file Sema.h.
References clang::Sema::ConstantEvaluated, Context, and clang::Sema::ImmediateFunctionContext.
Referenced by clang::Sema::isAlwaysConstantEvaluatedContext(), clang::Sema::isConstantEvaluatedContext(), clang::Sema::PopExpressionEvaluationContext(), and clang::Sema::PushExpressionEvaluationContextForFunction().
|
inline |
Definition at line 6903 of file Sema.h.
References Context, clang::Sema::DiscardedStatement, clang::Sema::ImmediateFunctionContext, InDiscardedStatement, and isPotentiallyEvaluated().
Referenced by clang::Sema::PushExpressionEvaluationContext().
|
inline |
Definition at line 6888 of file Sema.h.
References Context, clang::Sema::DiscardedStatement, clang::Sema::ImmediateFunctionContext, InImmediateFunctionContext, and clang::Sema::PotentiallyEvaluated.
Referenced by HandleImmediateInvocations(), clang::Sema::isImmediateFunctionContext(), and clang::Sema::PushExpressionEvaluationContextForFunction().
|
inline |
Definition at line 6876 of file Sema.h.
References clang::Sema::ConstantEvaluated, Context, clang::Sema::PotentiallyEvaluated, and clang::Sema::PotentiallyEvaluatedIfUsed.
Referenced by clang::Sema::DeduceTemplateArguments(), and isDiscardedStatementContext().
|
inline |
Definition at line 6870 of file Sema.h.
References Context, clang::Sema::Unevaluated, clang::Sema::UnevaluatedAbstract, and clang::Sema::UnevaluatedList.
Referenced by clang::Sema::isUnevaluatedContext(), and clang::Sema::PopExpressionEvaluationContext().
| ExpressionEvaluationContext clang::Sema::ExpressionEvaluationContextRecord::Context |
The expression evaluation context.
Definition at line 6750 of file Sema.h.
Referenced by ExpressionEvaluationContextRecord(), HandleImmediateInvocations(), clang::Sema::isCheckingDefaultArgumentOrInitializer(), isConstantEvaluated(), isDiscardedStatementContext(), isImmediateFunctionContext(), isPotentiallyEvaluated(), isUnevaluated(), and clang::Sema::TransformToPotentiallyEvaluated().
Declaration for initializer if one is currently being parsed.
Used when an expression has a possibly unreachable diagnostic to reference the declaration as a whole.
Definition at line 6773 of file Sema.h.
Referenced by clang::Sema::InstantiateVariableInitializer().
| SmallVector<CXXBindTemporaryExpr *, 8> clang::Sema::ExpressionEvaluationContextRecord::DelayedDecltypeBinds |
| SmallVector<CallExpr *, 8> clang::Sema::ExpressionEvaluationContextRecord::DelayedDecltypeCalls |
| std::optional<InitializationContext> clang::Sema::ExpressionEvaluationContextRecord::DelayedDefaultInitializationContext |
| enum clang::Sema::ExpressionEvaluationContextRecord::ExpressionKind clang::Sema::ExpressionEvaluationContextRecord::ExprContext |
| SmallVector<MaterializeTemporaryExpr *, 8> clang::Sema::ExpressionEvaluationContextRecord::ForRangeLifetimeExtendTemps |
P2718R0 - Lifetime extension in range-based for loops.
MaterializeTemporaryExprs in for-range-init expressions which need to extend lifetime. Add MaterializeTemporaryExpr* if the value of InLifetimeExtendingContext is true.
Definition at line 6802 of file Sema.h.
Referenced by clang::Sema::CreateMaterializeTemporaryExpr(), and clang::Sema::PopExpressionEvaluationContext().
| llvm::SmallVector<ImmediateInvocationCandidate, 4> clang::Sema::ExpressionEvaluationContextRecord::ImmediateInvocationCandidates |
Set of candidates for starting an immediate invocation.
Definition at line 6792 of file Sema.h.
Referenced by HandleImmediateInvocations(), and RemoveNestedImmediateInvocation().
Definition at line 6829 of file Sema.h.
Referenced by clang::Sema::isAlwaysConstantEvaluatedContext().
| bool clang::Sema::ExpressionEvaluationContextRecord::InDiscardedStatement |
Definition at line 6820 of file Sema.h.
Referenced by ExpressionEvaluationContextRecord(), isDiscardedStatementContext(), and clang::Sema::PushExpressionEvaluationContextForFunction().
| bool clang::Sema::ExpressionEvaluationContextRecord::InImmediateEscalatingFunctionContext |
Definition at line 6822 of file Sema.h.
Referenced by ExpressionEvaluationContextRecord(), HandleImmediateInvocations(), and clang::Sema::PushExpressionEvaluationContextForFunction().
| bool clang::Sema::ExpressionEvaluationContextRecord::InImmediateFunctionContext |
Definition at line 6821 of file Sema.h.
Referenced by ExpressionEvaluationContextRecord(), isImmediateFunctionContext(), and clang::Sema::PushExpressionEvaluationContextForFunction().
Whether we are currently in a context in which all temporaries must be lifetime-extended, even if they're not bound to a reference (for example, in a for-range initializer).
Definition at line 6834 of file Sema.h.
Referenced by clang::Sema::BuildCXXDefaultArgExpr(), clang::Sema::BuildCXXDefaultInitExpr(), clang::Sema::InstantiateVariableInitializer(), clang::Sema::isInLifetimeExtendingContext(), and clang::Sema::PopExpressionEvaluationContext().
Whether evaluating an expression for a switch case label.
Definition at line 6837 of file Sema.h.
Referenced by DoEmitAvailabilityWarning().
| bool clang::Sema::ExpressionEvaluationContextRecord::IsCurrentlyCheckingDefaultArgumentOrInitializer = false |
Definition at line 6824 of file Sema.h.
Referenced by clang::Sema::isCheckingDefaultArgumentOrInitializer().
| SmallVector<LambdaExpr *, 2> clang::Sema::ExpressionEvaluationContextRecord::Lambdas |
The lambdas that are present within this context, if it is indeed an unevaluated context.
Definition at line 6763 of file Sema.h.
Referenced by clang::Sema::PopExpressionEvaluationContext().
| Decl* clang::Sema::ExpressionEvaluationContextRecord::ManglingContextDecl |
The declaration that provides context for lambda expressions and block literals if the normal declaration context does not suffice, e.g., in a default function argument.
Definition at line 6768 of file Sema.h.
Referenced by ExpressionEvaluationContextRecord(), and HandleImmediateInvocations().
| SmallVector<MisalignedMember, 4> clang::Sema::ExpressionEvaluationContextRecord::MisalignedMembers |
Small set of gathered accesses to potentially misaligned members due to the packed attribute.
Definition at line 6806 of file Sema.h.
Referenced by clang::Sema::DiagnoseMisalignedMembers(), and clang::Sema::DiscardMisalignedMemberAddress().
| unsigned clang::Sema::ExpressionEvaluationContextRecord::NumCleanupObjects |
The number of active cleanup objects when we entered this expression evaluation context.
Definition at line 6757 of file Sema.h.
Referenced by ExpressionEvaluationContextRecord(), and clang::Sema::PopExpressionEvaluationContext().
| CleanupInfo clang::Sema::ExpressionEvaluationContextRecord::ParentCleanup |
Whether the enclosing context needed a cleanup.
Definition at line 6753 of file Sema.h.
Referenced by ExpressionEvaluationContextRecord(), and clang::Sema::PopExpressionEvaluationContext().
| llvm::SmallPtrSet<const Expr *, 8> clang::Sema::ExpressionEvaluationContextRecord::PossibleDerefs |
Definition at line 6783 of file Sema.h.
Referenced by clang::Sema::WarnOnPendingNoDerefs().
Whether we should rebuild CXXDefaultArgExpr and CXXDefaultInitExpr.
Definition at line 6840 of file Sema.h.
Referenced by clang::Sema::InstantiateVariableInitializer(), and clang::Sema::needsRebuildOfDefaultArgOrInit().
| llvm::SmallPtrSet<DeclRefExpr *, 4> clang::Sema::ExpressionEvaluationContextRecord::ReferenceToConsteval |
Set of DeclRefExprs referencing a consteval function when used in a context not already known to be immediately invoked.
Definition at line 6796 of file Sema.h.
Referenced by clang::Sema::ActOnCallExpr(), HandleImmediateInvocations(), and RemoveNestedImmediateInvocation().
| MaybeODRUseExprSet clang::Sema::ExpressionEvaluationContextRecord::SavedMaybeODRUseExprs |
Definition at line 6759 of file Sema.h.
Referenced by clang::Sema::PopExpressionEvaluationContext().
| SmallVector<Expr *, 2> clang::Sema::ExpressionEvaluationContextRecord::VolatileAssignmentLHSs |
Expressions appearing as the LHS of a volatile assignment in this context.
We produce a warning for these when popping the context if they are not discarded-value expressions nor unevaluated operands.
Definition at line 6788 of file Sema.h.
Referenced by clang::Sema::PopExpressionEvaluationContext().