From 72acf751d8eb41bab7a4d8b4dd74f8165b10cd71 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Mon, 22 Jun 2020 21:29:16 +0200 Subject: [PATCH] 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. --- gcc/d/dmd/MERGE | 2 +- gcc/d/dmd/blockexit.c | 2 +- gcc/d/dmd/clone.c | 2 +- gcc/d/dmd/dinterpret.c | 4 ++-- gcc/d/dmd/func.c | 2 +- gcc/d/dmd/hdrgen.c | 2 +- gcc/d/dmd/parse.c | 2 +- gcc/d/dmd/sapply.c | 2 +- gcc/d/dmd/scope.h | 2 +- gcc/d/dmd/statement.c | 14 +++++++------- gcc/d/dmd/statement.h | 8 ++++---- gcc/d/dmd/statementsem.c | 4 ++-- gcc/d/dmd/visitor.h | 4 ++-- gcc/d/toir.cc | 2 +- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index d6b2a2a3791..a13b5c1fae5 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -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. diff --git a/gcc/d/dmd/blockexit.c b/gcc/d/dmd/blockexit.c index d4088f5c691..4705862e025 100644 --- a/gcc/d/dmd/blockexit.c +++ b/gcc/d/dmd/blockexit.c @@ -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; diff --git a/gcc/d/dmd/clone.c b/gcc/d/dmd/clone.c index a704d1397fe..dd22fb340f5 100644 --- a/gcc/d/dmd/clone.c +++ b/gcc/d/dmd/clone.c @@ -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. diff --git a/gcc/d/dmd/dinterpret.c b/gcc/d/dmd/dinterpret.c index ada1d8bc54f..dd1105c03bd 100644 --- a/gcc/d/dmd/dinterpret.c +++ b/gcc/d/dmd/dinterpret.c @@ -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); } diff --git a/gcc/d/dmd/func.c b/gcc/d/dmd/func.c index 008f09726b4..b6849559bf6 100644 --- a/gcc/d/dmd/func.c +++ b/gcc/d/dmd/func.c @@ -194,7 +194,7 @@ public: if (s->finalbody) visitStmt(s->finalbody); } - void visit(OnScopeStatement *) { } + void visit(ScopeGuardStatement *) { } void visit(ThrowStatement *) { } void visit(DebugStatement *s) { diff --git a/gcc/d/dmd/hdrgen.c b/gcc/d/dmd/hdrgen.c index 11a06a88ce9..33a804fdba1 100644 --- a/gcc/d/dmd/hdrgen.c +++ b/gcc/d/dmd/hdrgen.c @@ -618,7 +618,7 @@ public: buf->writenl(); } - void visit(OnScopeStatement *s) + void visit(ScopeGuardStatement *s) { buf->writestring(Token::toChars(s->tok)); buf->writeByte(' '); diff --git a/gcc/d/dmd/parse.c b/gcc/d/dmd/parse.c index 4aec7a46e7b..f4cd28ed2fb 100644 --- a/gcc/d/dmd/parse.c +++ b/gcc/d/dmd/parse.c @@ -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; } diff --git a/gcc/d/dmd/sapply.c b/gcc/d/dmd/sapply.c index b15d2a8dabf..35e38c151ac 100644 --- a/gcc/d/dmd/sapply.c +++ b/gcc/d/dmd/sapply.c @@ -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); } diff --git a/gcc/d/dmd/scope.h b/gcc/d/dmd/scope.h index 7456f7098f6..b22823fb846 100644 --- a/gcc/d/dmd/scope.h +++ b/gcc/d/dmd/scope.h @@ -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 diff --git a/gcc/d/dmd/statement.c b/gcc/d/dmd/statement.c index 7a0fd6db069..9d2e7e22869 100644 --- a/gcc/d/dmd/statement.c +++ b/gcc/d/dmd/statement.c @@ -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; diff --git a/gcc/d/dmd/statement.h b/gcc/d/dmd/statement.h index c8aa4d343aa..4ceec87566c 100644 --- a/gcc/d/dmd/statement.h +++ b/gcc/d/dmd/statement.h @@ -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 diff --git a/gcc/d/dmd/statementsem.c b/gcc/d/dmd/statementsem.c index 33ca46729b0..599c52e754c 100644 --- a/gcc/d/dmd/statementsem.c +++ b/gcc/d/dmd/statementsem.c @@ -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) { diff --git a/gcc/d/dmd/visitor.h b/gcc/d/dmd/visitor.h index 8093c94cfee..5f2bf2cccb4 100644 --- a/gcc/d/dmd/visitor.h +++ b/gcc/d/dmd/visitor.h @@ -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); } diff --git a/gcc/d/toir.cc b/gcc/d/toir.cc index 329efcdb40c..fd18b9e6a76 100644 --- a/gcc/d/toir.cc +++ b/gcc/d/toir.cc @@ -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 *) { } -- 2.30.2