Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions clang/lib/AST/ByteCode/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2429,7 +2429,7 @@ bool Compiler<Emitter>::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *E) {
// and the RHS is our SubExpr.
for (size_t I = 0; I != Size; ++I) {
ArrayIndexScope<Emitter> IndexScope(this, I);
BlockScope<Emitter> BS(this);
LocalScope<Emitter> BS(this);

if (!this->visitArrayElemInit(I, SubExpr, SubExprT))
return false;
Expand Down Expand Up @@ -4140,7 +4140,7 @@ bool Compiler<Emitter>::VisitCXXStdInitializerListExpr(

template <class Emitter>
bool Compiler<Emitter>::VisitStmtExpr(const StmtExpr *E) {
BlockScope<Emitter> BS(this);
LocalScope<Emitter> BS(this);
StmtExprScope<Emitter> SS(this);

const CompoundStmt *CS = E->getSubStmt();
Expand Down Expand Up @@ -5111,7 +5111,7 @@ bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
}
}

BlockScope<Emitter> CallScope(this, ScopeKind::Call);
LocalScope<Emitter> CallScope(this, ScopeKind::Call);

QualType ReturnType = E->getCallReturnType(Ctx.getASTContext());
OptPrimType T = classify(ReturnType);
Expand Down Expand Up @@ -5475,7 +5475,7 @@ template <class Emitter> bool Compiler<Emitter>::visitStmt(const Stmt *S) {

template <class Emitter>
bool Compiler<Emitter>::visitCompoundStmt(const CompoundStmt *S) {
BlockScope<Emitter> Scope(this);
LocalScope<Emitter> Scope(this);
for (const auto *InnerStmt : S->body())
if (!visitStmt(InnerStmt))
return false;
Expand Down Expand Up @@ -6211,7 +6211,7 @@ bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) {
InitLinkScope<Emitter> InitScope(this, InitLink::This());
for (const auto *Init : Ctor->inits()) {
// Scope needed for the initializers.
BlockScope<Emitter> Scope(this);
LocalScope<Emitter> Scope(this);

const Expr *InitExpr = Init->getInit();
if (const FieldDecl *Member = Init->getMember()) {
Expand Down
8 changes: 0 additions & 8 deletions clang/lib/AST/ByteCode/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,14 +624,6 @@ template <class Emitter> class LocalScope : public VariableScope<Emitter> {
UnsignedOrNone Idx = std::nullopt;
};

/// Scope for storage declared in a compound statement.
// FIXME: Remove?
template <class Emitter> class BlockScope final : public LocalScope<Emitter> {
public:
BlockScope(Compiler<Emitter> *Ctx, ScopeKind Kind = ScopeKind::Block)
: LocalScope<Emitter>(Ctx, Kind) {}
};

template <class Emitter> class ArrayIndexScope final {
public:
ArrayIndexScope(Compiler<Emitter> *Ctx, uint64_t Index) : Ctx(Ctx) {
Expand Down
Loading