d: Merge upstream dmd 4f1046222.

Renames OnScopeStatement to ScopeGuardStatement.

Reviewed-on: https://github.com/dlang/dmd/pull/11285

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 4f1046222.
	* toir.cc (IRVisitor::visit (OnScopeGuardStatement *)): Rename to ...
	(IRVisitor::visit (ScopeGuardStatement *)): ... this.
This commit is contained in:
Iain Buclaw 2020-06-22 21:29:16 +02:00
parent f48bffe70c
commit 72acf751d8
14 changed files with 26 additions and 26 deletions

View file

@ -1,4 +1,4 @@
13d67c5757b83a86411e510bd65a6b5167241324
4f1046222f3a15a746ad2455e1099ed31e39b554
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.

View file

@ -435,7 +435,7 @@ int blockExit(Statement *s, FuncDeclaration *func, bool mustNotThrow)
result |= finalresult & ~BEfallthru;
}
void visit(OnScopeStatement *)
void visit(ScopeGuardStatement *)
{
// At this point, this statement is just an empty placeholder
result = BEfallthru;

View file

@ -914,7 +914,7 @@ FuncDeclaration *buildPostBlit(StructDeclaration *sd, Scope *sc)
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.

View file

@ -439,7 +439,7 @@ public:
ctfeCompile(s->statement);
}
void visit(OnScopeStatement *)
void visit(ScopeGuardStatement *)
{
// rewritten to try/catch/finally
assert(0);
@ -1753,7 +1753,7 @@ public:
result = new ThrownExceptionExp(s->loc, (ClassReferenceExp *)e);
}
void visit(OnScopeStatement *)
void visit(ScopeGuardStatement *)
{
assert(0);
}

View file

@ -194,7 +194,7 @@ public:
if (s->finalbody)
visitStmt(s->finalbody);
}
void visit(OnScopeStatement *) { }
void visit(ScopeGuardStatement *) { }
void visit(ThrowStatement *) { }
void visit(DebugStatement *s)
{

View file

@ -618,7 +618,7 @@ public:
buf->writenl();
}
void visit(OnScopeStatement *s)
void visit(ScopeGuardStatement *s)
{
buf->writestring(Token::toChars(s->tok));
buf->writeByte(' ');

View file

@ -5395,7 +5395,7 @@ Statement *Parser::parseStatement(int flags, const utf8_t** endPtr, Loc *pEndloc
nextToken();
check(TOKrparen);
Statement *st = parseStatement(PSscope);
s = new OnScopeStatement(loc, t, st);
s = new ScopeGuardStatement(loc, t, st);
break;
}

View file

@ -133,7 +133,7 @@ public:
{
doCond(s->_body) || doCond(s->finalbody) || applyTo(s);
}
void visit(OnScopeStatement *s)
void visit(ScopeGuardStatement *s)
{
doCond(s->statement) || applyTo(s);
}

View file

@ -77,7 +77,7 @@ struct Scope
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

View file

@ -171,7 +171,7 @@ bool Statement::usesEH()
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; }
};
@ -1418,23 +1418,23 @@ bool TryFinallyStatement::hasContinue()
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;

View file

@ -626,13 +626,13 @@ public:
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);
@ -670,7 +670,7 @@ public:
Identifier *ident;
LabelDsymbol *label;
TryFinallyStatement *tf;
OnScopeStatement *os;
ScopeGuardStatement *os;
VarDeclaration *lastVar;
GotoStatement(Loc loc, Identifier *ident);
@ -686,7 +686,7 @@ public:
Identifier *ident;
Statement *statement;
TryFinallyStatement *tf;
OnScopeStatement *os;
ScopeGuardStatement *os;
VarDeclaration *lastVar;
Statement *gotoTarget; // interpret

View file

@ -1969,7 +1969,7 @@ public:
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;
}
@ -3544,7 +3544,7 @@ public:
result = tfs;
}
void visit(OnScopeStatement *oss)
void visit(ScopeGuardStatement *oss)
{
if (oss->tok != TOKon_scope_exit)
{

View file

@ -46,7 +46,7 @@ class SynchronizedStatement;
class WithStatement;
class TryCatchStatement;
class TryFinallyStatement;
class OnScopeStatement;
class ScopeGuardStatement;
class ThrowStatement;
class DebugStatement;
class GotoStatement;
@ -339,7 +339,7 @@ public:
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); }

View file

@ -555,7 +555,7 @@ public:
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 *)
{
}