|
clang 24.0.0git
|
Generic scope for local variables. More...
Public Member Functions | |
| LocalScope (Compiler< Emitter > *Ctx, ScopeKind Kind=ScopeKind::Block) | |
| ~LocalScope () override | |
| Emit a Destroy op for this scope. | |
| bool | destroyLocals (const Expr *E=nullptr) override |
| Explicit destruction of local variables. | |
| void | addLocal (Scope::Local Local) override |
| void | forceInit () override |
| Force-initialize this scope. | |
| bool | emitDestructors (const Expr *E=nullptr) override |
| void | removeStoredOpaqueValues () |
| void | removeIfStoredOpaqueValue (const Scope::Local &Local) |
| Public Member Functions inherited from clang::interp::VariableScope< Emitter > | |
| VariableScope (Compiler< Emitter > *Ctx, ScopeKind Kind=ScopeKind::Block) | |
| virtual | ~VariableScope () |
| void | addForScopeKind (const Scope::Local &Local, ScopeKind Kind) |
| Like addExtended, but adds to the nearest scope of the given kind. | |
| VariableScope * | getParent () const |
| ScopeKind | getKind () const |
Public Attributes | |
| UnsignedOrNone | Idx = std::nullopt |
| Index of the scope in the chain. | |
| bool | ExplicitlyDestroyed = false |
| Public Attributes inherited from clang::interp::VariableScope< Emitter > | |
| bool | LocalsAlwaysEnabled = true |
| Whether locals added to this scope are enabled by default. | |
Additional Inherited Members | |
| Protected Attributes inherited from clang::interp::VariableScope< Emitter > | |
| Compiler< Emitter > * | Ctx |
| Compiler instance. | |
| VariableScope * | Parent |
| Link to the parent scope. | |
| ScopeKind | Kind |
Generic scope for local variables.
Definition at line 122 of file Compiler.cpp.
|
inline |
Definition at line 124 of file Compiler.cpp.
References clang::interp::Block, clang::interp::VariableScope< Emitter >::Ctx, clang::interp::VariableScope< Emitter >::Kind, and clang::interp::VariableScope< Emitter >::VariableScope().
Referenced by clang::interp::DeclScope< Emitter >::DeclScope().
|
inlineoverride |
Emit a Destroy op for this scope.
Definition at line 128 of file Compiler.cpp.
References clang::interp::VariableScope< Emitter >::Ctx, ExplicitlyDestroyed, Idx, and removeStoredOpaqueValues().
|
inlineoverridevirtual |
Reimplemented from clang::interp::VariableScope< Emitter >.
Definition at line 147 of file Compiler.cpp.
References clang::interp::VariableScope< Emitter >::Ctx, Idx, Local, and clang::interp::VariableScope< Emitter >::LocalsAlwaysEnabled.
|
inlineoverridevirtual |
Explicit destruction of local variables.
Reimplemented from clang::interp::VariableScope< Emitter >.
Definition at line 135 of file Compiler.cpp.
References clang::interp::VariableScope< Emitter >::Ctx, emitDestructors(), ExplicitlyDestroyed, Idx, and clang::Success.
Referenced by clang::interp::Compiler< Emitter >::VisitArrayInitLoopExpr(), clang::interp::Compiler< Emitter >::VisitCallExpr(), clang::interp::Compiler< Emitter >::visitCXXExpansionStmtInstantiation(), clang::interp::Compiler< Emitter >::visitCXXForRangeStmt(), clang::interp::Compiler< Emitter >::visitDeclAndReturn(), clang::interp::Compiler< Emitter >::visitDoStmt(), clang::interp::Compiler< Emitter >::visitExpr(), clang::interp::Compiler< Emitter >::VisitExprWithCleanups(), clang::interp::Compiler< Emitter >::visitForStmt(), clang::interp::Compiler< Emitter >::visitIfStmt(), clang::interp::Compiler< Emitter >::VisitStmtExpr(), clang::interp::Compiler< Emitter >::visitSwitchStmt(), clang::interp::Compiler< Emitter >::visitWhileStmt(), and clang::interp::Compiler< Emitter >::visitWithSubstitutions().
|
inlineoverridevirtual |
Reimplemented from clang::interp::VariableScope< Emitter >.
Definition at line 174 of file Compiler.cpp.
References clang::interp::VariableScope< Emitter >::Ctx, Idx, Local, and removeIfStoredOpaqueValue().
Referenced by destroyLocals().
|
inlineoverridevirtual |
Force-initialize this scope.
Usually, scopes are lazily initialized when the first local variable is created, but in scenarios with conditonal operators, we need to ensure scope is initialized just in case one of the arms will create a local and the other won't. In such a case, the InitScope() op would be part of the arm that created the local.
Reimplemented from clang::interp::VariableScope< Emitter >.
Definition at line 165 of file Compiler.cpp.
References clang::interp::VariableScope< Emitter >::Ctx, and Idx.
|
inline |
Definition at line 220 of file Compiler.cpp.
References clang::interp::VariableScope< Emitter >::Ctx, and Local.
Referenced by emitDestructors(), and removeStoredOpaqueValues().
|
inline |
Definition at line 211 of file Compiler.cpp.
References clang::interp::VariableScope< Emitter >::Ctx, Idx, Local, and removeIfStoredOpaqueValue().
Referenced by ~LocalScope().
| bool clang::interp::LocalScope< Emitter >::ExplicitlyDestroyed = false |
Definition at line 229 of file Compiler.cpp.
Referenced by destroyLocals(), and ~LocalScope().
| UnsignedOrNone clang::interp::LocalScope< Emitter >::Idx = std::nullopt |
Index of the scope in the chain.
Definition at line 228 of file Compiler.cpp.
Referenced by addLocal(), destroyLocals(), emitDestructors(), forceInit(), removeStoredOpaqueValues(), and ~LocalScope().