Skip to content

Commit c46cf1e

Browse files
authored
[clang][bytecode][NFC] Remove BlockScope (#158656)
Unused these days.
1 parent 6dde349 commit c46cf1e

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,7 +2429,7 @@ bool Compiler<Emitter>::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *E) {
24292429
// and the RHS is our SubExpr.
24302430
for (size_t I = 0; I != Size; ++I) {
24312431
ArrayIndexScope<Emitter> IndexScope(this, I);
2432-
BlockScope<Emitter> BS(this);
2432+
LocalScope<Emitter> BS(this);
24332433

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

41414141
template <class Emitter>
41424142
bool Compiler<Emitter>::VisitStmtExpr(const StmtExpr *E) {
4143-
BlockScope<Emitter> BS(this);
4143+
LocalScope<Emitter> BS(this);
41444144
StmtExprScope<Emitter> SS(this);
41454145

41464146
const CompoundStmt *CS = E->getSubStmt();
@@ -5111,7 +5111,7 @@ bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
51115111
}
51125112
}
51135113

5114-
BlockScope<Emitter> CallScope(this, ScopeKind::Call);
5114+
LocalScope<Emitter> CallScope(this, ScopeKind::Call);
51155115

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

54765476
template <class Emitter>
54775477
bool Compiler<Emitter>::visitCompoundStmt(const CompoundStmt *S) {
5478-
BlockScope<Emitter> Scope(this);
5478+
LocalScope<Emitter> Scope(this);
54795479
for (const auto *InnerStmt : S->body())
54805480
if (!visitStmt(InnerStmt))
54815481
return false;
@@ -6211,7 +6211,7 @@ bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) {
62116211
InitLinkScope<Emitter> InitScope(this, InitLink::This());
62126212
for (const auto *Init : Ctor->inits()) {
62136213
// Scope needed for the initializers.
6214-
BlockScope<Emitter> Scope(this);
6214+
LocalScope<Emitter> Scope(this);
62156215

62166216
const Expr *InitExpr = Init->getInit();
62176217
if (const FieldDecl *Member = Init->getMember()) {

clang/lib/AST/ByteCode/Compiler.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -624,14 +624,6 @@ template <class Emitter> class LocalScope : public VariableScope<Emitter> {
624624
UnsignedOrNone Idx = std::nullopt;
625625
};
626626

627-
/// Scope for storage declared in a compound statement.
628-
// FIXME: Remove?
629-
template <class Emitter> class BlockScope final : public LocalScope<Emitter> {
630-
public:
631-
BlockScope(Compiler<Emitter> *Ctx, ScopeKind Kind = ScopeKind::Block)
632-
: LocalScope<Emitter>(Ctx, Kind) {}
633-
};
634-
635627
template <class Emitter> class ArrayIndexScope final {
636628
public:
637629
ArrayIndexScope(Compiler<Emitter> *Ctx, uint64_t Index) : Ctx(Ctx) {

0 commit comments

Comments
 (0)