Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/dmd/blockexit.d
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,6 @@ int blockExit(Statement s, FuncDeclaration func, bool mustNotThrow)
result = blockExit(s.statement, func, mustNotThrow);
}

override void visit(ForwardingStatement s)
{
if (s.statement)
{
s.statement.accept(this);
}
else
{
result = BE.fallthru;
}
}

override void visit(WhileStatement s)
{
assert(global.errors);
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/id.d
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct Id
* An identifier that corresponds to each static field in this struct will
* be placed in the identifier pool.
*/
void initialize()
extern(C++) void initialize()
{
mixin(msgtable.generate(&initializer));
}
Expand Down
24 changes: 24 additions & 0 deletions src/dmd/id.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

/* Compiler implementation of the D programming language
* Copyright (c) 2017 by The D Language Foundation
* All Rights Reserved
* written by Walter Bright
* http://www.digitalmars.com
* Distributed under the Boost Software License, Version 1.0.
* http://www.boost.org/LICENSE_1_0.txt
* https://github.com/dlang/dmd/blob/master/src/id.h
*/

#ifndef DMD_ID_H
#define DMD_ID_H

#ifdef __DMC__
#pragma once
#endif /* __DMC__ */

struct Id
{
static void initialize();
};

#endif /* DMD_ID_H */
48 changes: 0 additions & 48 deletions src/dmd/statement.d
Original file line number Diff line number Diff line change
Expand Up @@ -1052,54 +1052,6 @@ extern (C++) final class ForwardingStatement : Statement
return new ForwardingStatement(loc, statement.syntaxCopy());
}

override Statement getRelatedLabeled()
{
if (!statement)
{
return null;
}
return statement.getRelatedLabeled();
}

override bool hasBreak()
{
if (!statement)
{
return false;
}
return statement.hasBreak();
}

override bool hasContinue()
{
if (!statement)
{
return false;
}
return statement.hasContinue();
}

override Statement scopeCode(Scope* sc, Statement* sentry, Statement* sexception, Statement* sfinally)
{
if (!statement)
{
return this;
}
sc = sc.push(sym);
statement = statement.scopeCode(sc, sentry, sexception, sfinally);
sc = sc.pop();
return statement ? this : null;
}

override inout(Statement) last() inout nothrow pure
{
if (!statement)
{
return null;
}
return statement.last();
}

/***********************
* ForwardingStatements are distributed over the flattened
* sequence of statements. This prevents flattening to be
Expand Down
5 changes: 0 additions & 5 deletions src/dmd/statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,6 @@ class ForwardingStatement : public Statement
Statement *statement;

Statement *syntaxCopy();
Statement *getRelatedLabeled();
bool hasBreak();
bool hasContinue();
Statement *scopeCode(Scope *sc, Statement **sentry, Statement **sexception, Statement **sfinally);
Statement *last();
Statements *flatten(Scope *sc);
ForwardingStatement *isForwardingStatement() { return this; }
void accept(Visitor *v) { v->visit(this); }
Expand Down
5 changes: 3 additions & 2 deletions src/dmd/statementsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ private extern (C++) final class StatementSemanticVisitor : Visitor
result = ss;
}

override void visit(ForwardingStatement ss){
override void visit(ForwardingStatement ss)
{
assert(ss.sym);
for (Scope* csc = sc; !ss.sym.forward; csc = csc.enclosing)
{
Expand All @@ -446,7 +447,7 @@ private extern (C++) final class StatementSemanticVisitor : Visitor
sc.scontinue = ss;
ss.statement = ss.statement.statementSemantic(sc);
sc = sc.pop();
result = ss.statement ? ss : null;
result = ss.statement;
}

override void visit(WhileStatement ws)
Expand Down
6 changes: 1 addition & 5 deletions src/dmd/visitor.d
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ public:
void visit(ASTCodegen.SwitchErrorStatement s) { visit(cast(ASTCodegen.Statement)s); }
void visit(ASTCodegen.DebugStatement s) { visit(cast(ASTCodegen.Statement)s); }
void visit(ASTCodegen.DtorExpStatement s) { visit(cast(ASTCodegen.ExpStatement)s); }
void visit(ASTCodegen.ForwardingStatement s)
{
if(s.statement)
s.statement.accept(this);
}
void visit(ASTCodegen.ForwardingStatement s) { visit(cast(ASTCodegen.Statement)s); }
void visit(ASTCodegen.OverloadSet s) { visit(cast(ASTCodegen.Dsymbol)s); }
void visit(ASTCodegen.LabelDsymbol s) { visit(cast(ASTCodegen.Dsymbol)s); }
void visit(ASTCodegen.WithScopeSymbol s) { visit(cast(ASTCodegen.ScopeDsymbol)s); }
Expand Down
Loading