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
2 changes: 1 addition & 1 deletion src/ddmd/argtypes.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern (C++) TypeTuple toArgTypes(Type t)
{
extern (C++) final class ToArgTypes : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
TypeTuple result;

Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/arrayop.d
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ extern (C++) void buildArrayOp(Scope* sc, Expression e, Objects* tiargs, Express
{
extern (C++) final class BuildArrayOpVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
Scope* sc;
Objects* tiargs;
Expressions* args;
Expand Down
9 changes: 3 additions & 6 deletions src/ddmd/astbase.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ddmd.astbase;

// Online documentation: https://dlang.org/phobos/ddmd_astbase.html

import ddmd.astbasevisitor;
import ddmd.parsetimevisitor;

/** The ASTBase family defines a family of AST nodes appropriate for parsing with
* no semantic information. It defines all the AST nodes that the parser needs
Expand Down Expand Up @@ -338,6 +338,8 @@ struct ASTBase
alias RECtracing = AliasThisRec.RECtracing;
alias RECtracingDT = AliasThisRec.RECtracingDT;

alias Visitor = ParseTimeVisitor!ASTBase;

extern (C++) class Dsymbol : RootObject
{
Loc loc;
Expand Down Expand Up @@ -5940,11 +5942,6 @@ struct ASTBase
this.aggrfe = aggrfe;
this.rangefe = rangefe;
}

void accept(Visitor v)
{
v.visit(this);
}
}

extern (C++) final class StaticIfCondition : Condition
Expand Down
280 changes: 0 additions & 280 deletions src/ddmd/astbasevisitor.d

This file was deleted.

1 change: 1 addition & 0 deletions src/ddmd/astcodegen.d
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct ASTCodegen
import ddmd.statement;
import ddmd.staticassert;
import ddmd.typesem;
import ddmd.ctfeexpr;

alias initializerToExpression = ddmd.initsem.initializerToExpression;
alias typeToExpression = ddmd.typesem.typeToExpression;
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/asttypename.d
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ string astTypeName(` ~ P[0].stringof ~ ` node)
return astTypeNameFunctions ~ `
private extern(C++) final class AstTypeNameVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public :
string typeName;
` ~ visitOverloads ~ "}";
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/blockexit.d
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int blockExit(Statement s, FuncDeclaration func, bool mustNotThrow)
{
extern (C++) final class BlockExit : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
FuncDeclaration func;
bool mustNotThrow;
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/cppmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const(char)* cppTypeInfoMangleItanium(Dsymbol s)

private final class CppMangleVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
Objects components; // array of components available for substitution
OutBuffer* buf; // append the mangling to buf[]
Loc loc; // location for use in error messages
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/cppmanglewin.d
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private final class VisualCPPMangler : Visitor
enum VC_SAVED_TYPE_CNT = 10u;
enum VC_SAVED_IDENT_CNT = 10u;

alias visit = super.visit;
alias visit = Visitor.visit;
const(char)*[VC_SAVED_IDENT_CNT] saved_idents;
Type[VC_SAVED_TYPE_CNT] saved_types;

Expand Down
10 changes: 5 additions & 5 deletions src/ddmd/dcast.d
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern (C++) Expression implicitCastTo(Expression e, Scope* sc, Type t)
{
extern (C++) final class ImplicitCastTo : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
Type t;
Scope* sc;
Expand Down Expand Up @@ -180,7 +180,7 @@ extern (C++) MATCH implicitConvTo(Expression e, Type t)
{
extern (C++) final class ImplicitConvTo : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
Type t;
MATCH result;
Expand Down Expand Up @@ -1428,7 +1428,7 @@ extern (C++) Expression castTo(Expression e, Scope* sc, Type t)
{
extern (C++) final class CastTo : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
Type t;
Scope* sc;
Expand Down Expand Up @@ -2487,7 +2487,7 @@ extern (C++) Expression inferType(Expression e, Type t, int flag = 0)
{
extern (C++) final class InferType : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
Type t;
int flag;
Expand Down Expand Up @@ -3494,7 +3494,7 @@ extern (C++) IntRange getIntRange(Expression e)
{
extern (C++) final class IntRangeVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;

public:
IntRange range;
Expand Down
4 changes: 2 additions & 2 deletions src/ddmd/dinterpret.d
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ struct CompiledCtfeFunction

private extern (C++) final class CtfeCompiler : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
CompiledCtfeFunction* ccf;

Expand Down Expand Up @@ -1055,7 +1055,7 @@ private Expression interpret(FuncDeclaration fd, InterState* istate, Expressions

private extern (C++) final class Interpreter : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
InterState* istate;
CtfeGoal goal;
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/dmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private void MODtoDecoBuffer(OutBuffer* buf, MOD mod)

private extern (C++) final class Mangler : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
static assert(Key.sizeof == size_t.sizeof);
AA* types;
Expand Down
4 changes: 2 additions & 2 deletions src/ddmd/doc.d
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ extern (C++) void emitComment(Dsymbol s, OutBuffer* buf, Scope* sc)
{
extern (C++) final class EmitComment : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
OutBuffer* buf;
Scope* sc;
Expand Down Expand Up @@ -1097,7 +1097,7 @@ extern (C++) void toDocBuffer(Dsymbol s, OutBuffer* buf, Scope* sc)
{
extern (C++) final class ToDocBuffer : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
OutBuffer* buf;
Scope* sc;
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/dstruct.d
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extern (C++) void semanticTypeInfo(Scope* sc, Type t)
{
extern (C++) final class FullTypeInfoVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
Scope* sc;

Expand Down
6 changes: 3 additions & 3 deletions src/ddmd/dsymbolsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ extern(C++) void dsymbolSemantic(Dsymbol dsym, Scope* sc)

extern(C++) final class Semantic2Visitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
Scope* sc;
this(Scope* sc)
{
Expand Down Expand Up @@ -571,7 +571,7 @@ const(char)* getMessage(DeprecatedDeclaration dd)

extern(C++) final class Semantic3Visitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;

Scope* sc;
this(Scope* sc)
Expand Down Expand Up @@ -1785,7 +1785,7 @@ extern(C++) final class Semantic3Visitor : Visitor

private extern(C++) final class DsymbolSemanticVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;

Scope* sc;
this(Scope* sc)
Expand Down
4 changes: 2 additions & 2 deletions src/ddmd/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -3171,7 +3171,7 @@ MATCH deduceType(RootObject o, Scope* sc, Type tparam, TemplateParameters* param
{
extern (C++) final class DeduceType : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
Scope* sc;
Type tparam;
Expand Down Expand Up @@ -4607,7 +4607,7 @@ bool reliesOnTident(Type t, TemplateParameters* tparams = null, size_t iStart =
{
extern (C++) final class ReliesOnTident : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
TemplateParameters* tparams;
size_t iStart;
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/e2ir.d
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ elem *toElem(Expression e, IRState *irs)
result = null;
}

alias visit = super.visit;
alias visit = Visitor.visit;

/***************************************
*/
Expand Down
4 changes: 2 additions & 2 deletions src/ddmd/escape.d
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ private void escapeByValue(Expression e, EscapeByResults* er)
//printf("[%s] escapeByValue, e: %s\n", e.loc.toChars(), e.toChars());
extern (C++) final class EscapeVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
EscapeByResults* er;

Expand Down Expand Up @@ -1079,7 +1079,7 @@ private void escapeByRef(Expression e, EscapeByResults* er)
//printf("[%s] escapeByRef, e: %s\n", e.loc.toChars(), e.toChars());
extern (C++) final class EscapeRefVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
EscapeByResults* er;

Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ private Module loadStdMath()

private extern (C++) final class ExpressionSemanticVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;

Scope* sc;
Expression result;
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/hdrgen.d
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ extern (C++) void genhdrfile(Module m)

extern (C++) final class PrettyPrintVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
OutBuffer* buf;
HdrGenState* hgs;
Expand Down
6 changes: 3 additions & 3 deletions src/ddmd/initsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extern(C++) Initializer initializerSemantic(Initializer init, Scope* sc, Type t,

private extern(C++) final class InitializerSemanticVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;

Initializer result;
Scope* sc;
Expand Down Expand Up @@ -541,7 +541,7 @@ private extern(C++) final class InitializerSemanticVisitor : Visitor

private extern(C++) final class InferTypeVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;

Initializer result;
Scope* sc;
Expand Down Expand Up @@ -705,7 +705,7 @@ private extern(C++) final class InferTypeVisitor : Visitor

private extern(C++) final class InitToExpressionVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;

Expression result;
Type itype;
Expand Down
4 changes: 2 additions & 2 deletions src/ddmd/inline.d
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ final class InlineDoState
private extern (C++) final class DoInlineAs(Result) : Visitor
if (is(Result == Statement) || is(Result == Expression))
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
InlineDoState ids;
Result result;
Expand Down Expand Up @@ -804,7 +804,7 @@ Result doInlineAs(Result)(Expression e, InlineDoState ids)
*/
private extern (C++) final class InlineScanVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
FuncDeclaration parent; // function being scanned
// As the visit method cannot return a value, these variables
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/inlinecost.d
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private:
*/
extern (C++) final class InlineCostVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
int nested;
bool hasthis;
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/json.d
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import ddmd.visitor;

private extern (C++) final class ToJsonVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
OutBuffer* buf;
int indentLevel;
Expand Down
6 changes: 3 additions & 3 deletions src/ddmd/opover.d
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private Identifier opId(Expression e)
{
extern (C++) final class OpIdVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
Identifier id;

Expand Down Expand Up @@ -279,7 +279,7 @@ private Identifier opId_r(Expression e)
{
extern (C++) final class OpIdRVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
Identifier id;

Expand Down Expand Up @@ -450,7 +450,7 @@ extern (C++) Expression op_overload(Expression e, Scope* sc)
{
extern (C++) final class OpOverload : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
Scope* sc;
Expression result;
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/optimize.d
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ extern (C++) Expression Expression_optimize(Expression e, int result, bool keepL
{
extern (C++) final class OptimizeVisitor : Visitor
{
alias visit = super.visit;
alias visit = Visitor.visit;
public:
int result;
bool keepLvalue;
Expand Down
Loading