-13d67c5757b83a86411e510bd65a6b5167241324
+4f1046222f3a15a746ad2455e1099ed31e39b554
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
result |= finalresult & ~BEfallthru;
}
- void visit(OnScopeStatement *)
+ void visit(ScopeGuardStatement *)
{
// At this point, this statement is just an empty placeholder
result = BEfallthru;
ex = new CallExp(loc, new IdentifierExp(loc, Id::__ArrayDtor), ex);
}
- a->push(new OnScopeStatement(loc, TOKon_scope_failure, new ExpStatement(loc, ex)));
+ a->push(new ScopeGuardStatement(loc, TOKon_scope_failure, new ExpStatement(loc, ex)));
}
// Build our own "postblit" which executes a, but only if needed.
ctfeCompile(s->statement);
}
- void visit(OnScopeStatement *)
+ void visit(ScopeGuardStatement *)
{
// rewritten to try/catch/finally
assert(0);
result = new ThrownExceptionExp(s->loc, (ClassReferenceExp *)e);
}
- void visit(OnScopeStatement *)
+ void visit(ScopeGuardStatement *)
{
assert(0);
}
if (s->finalbody)
visitStmt(s->finalbody);
}
- void visit(OnScopeStatement *) { }
+ void visit(ScopeGuardStatement *) { }
void visit(ThrowStatement *) { }
void visit(DebugStatement *s)
{
buf->writenl();
}
- void visit(OnScopeStatement *s)
+ void visit(ScopeGuardStatement *s)
{
buf->writestring(Token::toChars(s->tok));
buf->writeByte(' ');
nextToken();
check(TOKrparen);
Statement *st = parseStatement(PSscope);
- s = new OnScopeStatement(loc, t, st);
+ s = new ScopeGuardStatement(loc, t, st);
break;
}
{
doCond(s->_body) || doCond(s->finalbody) || applyTo(s);
}
- void visit(OnScopeStatement *s)
+ void visit(ScopeGuardStatement *s)
{
doCond(s->statement) || applyTo(s);
}
LabelStatement *slabel; // enclosing labelled statement
SwitchStatement *sw; // enclosing switch statement
TryFinallyStatement *tf; // enclosing try finally statement
- OnScopeStatement *os; // enclosing scope(xxx) statement
+ ScopeGuardStatement *os; // enclosing scope(xxx) statement
Statement *sbreak; // enclosing statement that supports "break"
Statement *scontinue; // enclosing statement that supports "continue"
ForeachStatement *fes; // if nested function for ForeachStatement, this is it
void visit(Statement *) {}
void visit(TryCatchStatement *) { stop = true; }
void visit(TryFinallyStatement *) { stop = true; }
- void visit(OnScopeStatement *) { stop = true; }
+ void visit(ScopeGuardStatement *) { stop = true; }
void visit(SynchronizedStatement *) { stop = true; }
};
return false; //true;
}
-/****************************** OnScopeStatement ***************************/
+/****************************** ScopeGuardStatement ***************************/
-OnScopeStatement::OnScopeStatement(Loc loc, TOK tok, Statement *statement)
+ScopeGuardStatement::ScopeGuardStatement(Loc loc, TOK tok, Statement *statement)
: Statement(loc)
{
this->tok = tok;
this->statement = statement;
}
-Statement *OnScopeStatement::syntaxCopy()
+Statement *ScopeGuardStatement::syntaxCopy()
{
- return new OnScopeStatement(loc, tok, statement->syntaxCopy());
+ return new ScopeGuardStatement(loc, tok, statement->syntaxCopy());
}
-Statement *OnScopeStatement::scopeCode(Scope *sc, Statement **sentry, Statement **sexception, Statement **sfinally)
+Statement *ScopeGuardStatement::scopeCode(Scope *sc, Statement **sentry, Statement **sexception, Statement **sfinally)
{
- //printf("OnScopeStatement::scopeCode()\n");
+ //printf("ScopeGuardStatement::scopeCode()\n");
//print();
*sentry = NULL;
*sexception = NULL;
void accept(Visitor *v) { v->visit(this); }
};
-class OnScopeStatement : public Statement
+class ScopeGuardStatement : public Statement
{
public:
TOK tok;
Statement *statement;
- OnScopeStatement(Loc loc, TOK tok, Statement *statement);
+ ScopeGuardStatement(Loc loc, TOK tok, Statement *statement);
Statement *syntaxCopy();
Statement *scopeCode(Scope *sc, Statement **sentry, Statement **sexit, Statement **sfinally);
Identifier *ident;
LabelDsymbol *label;
TryFinallyStatement *tf;
- OnScopeStatement *os;
+ ScopeGuardStatement *os;
VarDeclaration *lastVar;
GotoStatement(Loc loc, Identifier *ident);
Identifier *ident;
Statement *statement;
TryFinallyStatement *tf;
- OnScopeStatement *os;
+ ScopeGuardStatement *os;
VarDeclaration *lastVar;
Statement *gotoTarget; // interpret
if (ifs->match->edtor)
{
Statement *sdtor = new DtorExpStatement(ifs->loc, ifs->match->edtor, ifs->match);
- sdtor = new OnScopeStatement(ifs->loc, TOKon_scope_exit, sdtor);
+ sdtor = new ScopeGuardStatement(ifs->loc, TOKon_scope_exit, sdtor);
ifs->ifbody = new CompoundStatement(ifs->loc, sdtor, ifs->ifbody);
ifs->match->storage_class |= STCnodtor;
}
result = tfs;
}
- void visit(OnScopeStatement *oss)
+ void visit(ScopeGuardStatement *oss)
{
if (oss->tok != TOKon_scope_exit)
{
class WithStatement;
class TryCatchStatement;
class TryFinallyStatement;
-class OnScopeStatement;
+class ScopeGuardStatement;
class ThrowStatement;
class DebugStatement;
class GotoStatement;
virtual void visit(WithStatement *s) { visit((Statement *)s); }
virtual void visit(TryCatchStatement *s) { visit((Statement *)s); }
virtual void visit(TryFinallyStatement *s) { visit((Statement *)s); }
- virtual void visit(OnScopeStatement *s) { visit((Statement *)s); }
+ virtual void visit(ScopeGuardStatement *s) { visit((Statement *)s); }
virtual void visit(ThrowStatement *s) { visit((Statement *)s); }
virtual void visit(DebugStatement *s) { visit((Statement *)s); }
virtual void visit(GotoStatement *s) { visit((Statement *)s); }
try/catch/finally. At this point, this statement is just an empty
placeholder. Maybe the frontend shouldn't leak these. */
- void visit (OnScopeStatement *)
+ void visit (ScopeGuardStatement *)
{
}