d: Merge upstream dmd 4f1046222.
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 22 Jun 2020 19:29:16 +0000 (21:29 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 25 Jun 2020 15:02:44 +0000 (17:02 +0200)
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.

14 files changed:
gcc/d/dmd/MERGE
gcc/d/dmd/blockexit.c
gcc/d/dmd/clone.c
gcc/d/dmd/dinterpret.c
gcc/d/dmd/func.c
gcc/d/dmd/hdrgen.c
gcc/d/dmd/parse.c
gcc/d/dmd/sapply.c
gcc/d/dmd/scope.h
gcc/d/dmd/statement.c
gcc/d/dmd/statement.h
gcc/d/dmd/statementsem.c
gcc/d/dmd/visitor.h
gcc/d/toir.cc

index d6b2a2a379185de7e3c62bb7518282a9c8b196fb..a13b5c1fae52bb735315831f026fbef722d75d6a 100644 (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.
index d4088f5c69161575bae6ab8a4a24dade754bf6e2..4705862e025b0f43dbd9cfd7833d71a200e028d2 100644 (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;
index a704d1397fe8ed617b58afab239b4dde7a97e7d1..dd22fb340f5cfd7d08a890a6f6183311b197f178 100644 (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.
index ada1d8bc54fdb7d021406433589b676e8c53ec8d..dd1105c03bdc5ecccdfda50a64ea85049d0a5d7e 100644 (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);
     }
index 008f09726b4863c53f00187374cff7a23e3de854..b6849559bf6c7b230463e6c3d4962eadf899464e 100644 (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)
     {
index 11a06a88ce971a9d31e5e018e5778b659689b1e9..33a804fdba1a0320a1062cf7fc3460042dfea106 100644 (file)
@@ -618,7 +618,7 @@ public:
         buf->writenl();
     }
 
-    void visit(OnScopeStatement *s)
+    void visit(ScopeGuardStatement *s)
     {
         buf->writestring(Token::toChars(s->tok));
         buf->writeByte(' ');
index 4aec7a46e7b23ccd1bd908aec007203dcba89a8c..f4cd28ed2fbe9aac7066db8e6bdfa195f9575b47 100644 (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;
             }
 
index b15d2a8dabf0166b99b94b5c261e55934529dfe1..35e38c151ac070f8d4335280596e234d085e8474 100644 (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);
     }
index 7456f7098f62d04f1438a21cd88e417e0d9249a9..b22823fb84672ec11f4983d94c10226065247986 100644 (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
index 7a0fd6db06994d0501550875c286d4c1d2a210f0..9d2e7e228692ef694ebfebae0d0f0848a614a1cb 100644 (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;
index c8aa4d343aa78650a8def7fd17526288c3c1d122..4ceec87566c8d238945cd203b3256af56ac121bc 100644 (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
 
index 33ca46729b0ba8ccc213d4b08cce1332c710a3fe..599c52e754c4fe3c635208a50f20df51169920d3 100644 (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)
         {
index 8093c94cfeec2045f0eb5ea04c06c0ac21e75304..5f2bf2cccb4b1118e9532b12c794af1699237138 100644 (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); }
index 329efcdb40c085f633793f9c582a5e056f8d34f2..fd18b9e6a763024d8f78835e5c19ae89693600b9 100644 (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 *)
   {
   }