diff --git a/src/dmd/aggregate.d b/src/dmd/aggregate.d index 5f6d89184dbf..a66f0cf22d4f 100644 --- a/src/dmd/aggregate.d +++ b/src/dmd/aggregate.d @@ -118,7 +118,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol Expression getRTInfo; // pointer to GC info generated by object.RTInfo(this) - final extern (D) this(Loc loc, Identifier id) + final extern (D) this(const ref Loc loc, Identifier id) { super(id); this.loc = loc; diff --git a/src/dmd/aliasthis.d b/src/dmd/aliasthis.d index 37de5243372a..10dea2c55460 100644 --- a/src/dmd/aliasthis.d +++ b/src/dmd/aliasthis.d @@ -32,7 +32,7 @@ extern (C++) final class AliasThis : Dsymbol { Identifier ident; - extern (D) this(Loc loc, Identifier ident) + extern (D) this(const ref Loc loc, Identifier ident) { super(null); // it's anonymous (no identifier) this.loc = loc; diff --git a/src/dmd/astbase.d b/src/dmd/astbase.d index 059eb49ba4b7..554ad9fab0b0 100644 --- a/src/dmd/astbase.d +++ b/src/dmd/astbase.d @@ -460,7 +460,7 @@ struct ASTBase { Identifier ident; - extern (D) this(Loc loc, Identifier ident) + extern (D) this(const ref Loc loc, Identifier ident) { super(null); this.loc = loc; @@ -525,7 +525,7 @@ struct ASTBase Identifiers names; Identifiers aliases; - extern (D) this(Loc loc, Identifiers* packages, Identifier id, Identifier aliasId, int isstatic) + extern (D) this(const ref Loc loc, Identifiers* packages, Identifier id, Identifier aliasId, int isstatic) { super(null); this.loc = loc; @@ -593,7 +593,7 @@ struct ASTBase Expression exp; Expression msg; - extern (D) this(Loc loc, Expression exp, Expression msg) + extern (D) this(const ref Loc loc, Expression exp, Expression msg) { super(Id.empty); this.loc = loc; @@ -606,12 +606,12 @@ struct ASTBase { uint level; - extern (D) this(Loc loc, Identifier ident) + extern (D) this(const ref Loc loc, Identifier ident) { super(ident); this.loc = loc; } - extern (D) this(Loc loc, uint level) + extern (D) this(const ref Loc loc, uint level) { this.level = level; this.loc = loc; @@ -627,12 +627,12 @@ struct ASTBase { uint level; - extern (D) this(Loc loc, Identifier ident) + extern (D) this(const ref Loc loc, Identifier ident) { super(ident); this.loc = loc; } - extern (D) this(Loc loc, uint level) + extern (D) this(const ref Loc loc, uint level) { this.level = level; this.loc = loc; @@ -653,7 +653,7 @@ struct ASTBase uint sequenceNumber; __gshared uint nextSequenceNumber; - final extern (D) this(Loc loc, Type type, Identifier id, Initializer _init, StorageClass st = STC.undefined_) + final extern (D) this(const ref Loc loc, Type type, Identifier id, Initializer _init, StorageClass st = STC.undefined_) { super(id); this.type = type; @@ -693,7 +693,7 @@ struct ASTBase ForeachStatement fes; FuncDeclaration overnext0; - final extern (D) this(Loc loc, Loc endloc, Identifier id, StorageClass storage_class, Type type) + final extern (D) this(const ref Loc loc, Loc endloc, Identifier id, StorageClass storage_class, Type type) { super(id); this.storage_class = storage_class; @@ -734,14 +734,14 @@ struct ASTBase { Dsymbol aliassym; - extern (D) this(Loc loc, Identifier id, Dsymbol s) + extern (D) this(const ref Loc loc, Identifier id, Dsymbol s) { super(id); this.loc = loc; this.aliassym = s; } - extern (D) this(Loc loc, Identifier id, Type type) + extern (D) this(const ref Loc loc, Identifier id, Type type) { super(id); this.loc = loc; @@ -765,7 +765,7 @@ struct ASTBase { Objects* objects; - extern (D) this(Loc loc, Identifier id, Objects* objects) + extern (D) this(const ref Loc loc, Identifier id, Objects* objects) { super(id); this.loc = loc; @@ -782,7 +782,7 @@ struct ASTBase { TOK tok; - extern (D) this(Loc loc, Loc endloc, Type type, TOK tok, ForeachStatement fes, Identifier id = null) + extern (D) this(const ref Loc loc, Loc endloc, Type type, TOK tok, ForeachStatement fes, Identifier id = null) { super(loc, endloc, null, STC.undefined_, type); this.ident = id ? id : Id.empty; @@ -803,7 +803,7 @@ struct ASTBase extern (C++) final class PostBlitDeclaration : FuncDeclaration { - extern (D) this(Loc loc, Loc endloc, StorageClass stc, Identifier id) + extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Identifier id) { super(loc, endloc, id, stc, null); } @@ -816,7 +816,7 @@ struct ASTBase extern (C++) final class CtorDeclaration : FuncDeclaration { - extern (D) this(Loc loc, Loc endloc, StorageClass stc, Type type) + extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Type type) { super(loc, endloc, Id.ctor, stc, type); } @@ -829,11 +829,11 @@ struct ASTBase extern (C++) final class DtorDeclaration : FuncDeclaration { - extern (D) this(Loc loc, Loc endloc) + extern (D) this(const ref Loc loc, Loc endloc) { super(loc, endloc, Id.dtor, STC.undefined_, null); } - extern (D) this(Loc loc, Loc endloc, StorageClass stc, Identifier id) + extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Identifier id) { super(loc, endloc, id, stc, null); } @@ -846,7 +846,7 @@ struct ASTBase extern (C++) final class InvariantDeclaration : FuncDeclaration { - extern (D) this(Loc loc, Loc endloc, StorageClass stc, Identifier id, Statement fbody) + extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Identifier id, Statement fbody) { super(loc, endloc, id ? id : Identifier.generateId("__invariant"), stc, null); this.fbody = fbody; @@ -862,7 +862,7 @@ struct ASTBase { char* codedoc; - extern (D) this(Loc loc, Loc endloc, StorageClass stc, char* codedoc) + extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, char* codedoc) { super(loc, endloc, Identifier.generateIdWithLoc("__unittest", loc), stc, null); this.codedoc = codedoc; @@ -879,7 +879,7 @@ struct ASTBase Parameters* parameters; int varargs; - extern (D) this(Loc loc, Loc endloc, StorageClass stc, Parameters* fparams, int varargs) + extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Parameters* fparams, int varargs) { super(loc, endloc, Id.classNew, STC.static_ | stc, null); this.parameters = fparams; @@ -896,7 +896,7 @@ struct ASTBase { Parameters* parameters; - extern (D) this(Loc loc, Loc endloc, StorageClass stc, Parameters* fparams) + extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Parameters* fparams) { super(loc, endloc, Id.classDelete, STC.static_ | stc, null); this.parameters = fparams; @@ -910,11 +910,11 @@ struct ASTBase extern (C++) class StaticCtorDeclaration : FuncDeclaration { - final extern (D) this(Loc loc, Loc endloc, StorageClass stc) + final extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc) { super(loc, endloc, Identifier.generateIdWithLoc("_staticCtor", loc), STC.static_ | stc, null); } - final extern (D) this(Loc loc, Loc endloc, string name, StorageClass stc) + final extern (D) this(const ref Loc loc, Loc endloc, string name, StorageClass stc) { super(loc, endloc, Identifier.generateIdWithLoc(name, loc), STC.static_ | stc, null); } @@ -931,7 +931,7 @@ struct ASTBase { super(loc, endloc, Identifier.generateIdWithLoc("__staticDtor", loc), STC.static_ | stc, null); } - final extern (D) this(Loc loc, Loc endloc, string name, StorageClass stc) + final extern (D) this(const ref Loc loc, Loc endloc, string name, StorageClass stc) { super(loc, endloc, Identifier.generateIdWithLoc(name, loc), STC.static_ | stc, null); } @@ -944,7 +944,7 @@ struct ASTBase extern (C++) final class SharedStaticCtorDeclaration : StaticCtorDeclaration { - extern (D) this(Loc loc, Loc endloc, StorageClass stc) + extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc) { super(loc, endloc, "_sharedStaticCtor", stc); } @@ -957,7 +957,7 @@ struct ASTBase extern (C++) final class SharedStaticDtorDeclaration : StaticDtorDeclaration { - extern (D) this(Loc loc, Loc endloc, StorageClass stc) + extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc) { super(loc, endloc, "_sharedStaticDtor", stc); } @@ -993,7 +993,7 @@ struct ASTBase Type memtype; Prot protection; - extern (D) this(Loc loc, Identifier id, Type memtype) + extern (D) this(const ref Loc loc, Identifier id, Type memtype) { super(id); this.loc = loc; @@ -1014,7 +1014,7 @@ struct ASTBase Sizeok sizeok; Type type; - final extern (D) this(Loc loc, Identifier id) + final extern (D) this(const ref Loc loc, Identifier id) { super(id); this.loc = loc; @@ -1044,7 +1044,7 @@ struct ASTBase Prot protection; Dsymbol onemember; - extern (D) this(Loc loc, Identifier id, TemplateParameters* parameters, Expression constraint, Dsymbols* decldefs, bool ismixin = false, bool literal = false) + extern (D) this(const ref Loc loc, Identifier id, TemplateParameters* parameters, Expression constraint, Dsymbols* decldefs, bool ismixin = false, bool literal = false) { super(id); this.loc = loc; @@ -1092,7 +1092,7 @@ struct ASTBase bool havetempdecl; TemplateInstance inst; - final extern (D) this(Loc loc, Identifier ident, Objects* tiargs) + final extern (D) this(const ref Loc loc, Identifier ident, Objects* tiargs) { super(null); this.loc = loc; @@ -1100,7 +1100,7 @@ struct ASTBase this.tiargs = tiargs; } - final extern (D) this(Loc loc, TemplateDeclaration td, Objects* tiargs) + final extern (D) this(const ref Loc loc, TemplateDeclaration td, Objects* tiargs) { super(null); this.loc = loc; @@ -1159,7 +1159,7 @@ struct ASTBase extern (C++) final class Nspace : ScopeDsymbol { - extern (D) this(Loc loc, Identifier ident, Dsymbols* members) + extern (D) this(const ref Loc loc, Identifier ident, Dsymbols* members) { super(ident); this.loc = loc; @@ -1176,7 +1176,7 @@ struct ASTBase { Expression exp; - extern (D) this(Loc loc, Expression exp) + extern (D) this(const ref Loc loc, Expression exp) { super(null); this.loc = loc; @@ -1241,7 +1241,7 @@ struct ASTBase { bool isunion; - extern (D) this(Loc loc, bool isunion, Dsymbols* decl) + extern (D) this(const ref Loc loc, bool isunion, Dsymbols* decl) { super(decl); this.loc = loc; @@ -1258,7 +1258,7 @@ struct ASTBase { Expression ealign; - extern (D) this(Loc loc, Expression ealign, Dsymbols* decl) + extern (D) this(const ref Loc loc, Expression ealign, Dsymbols* decl) { super(decl); this.loc = loc; @@ -1292,13 +1292,13 @@ struct ASTBase Prot protection; Identifiers* pkg_identifiers; - extern (D) this(Loc loc, Prot p, Dsymbols* decl) + extern (D) this(const ref Loc loc, Prot p, Dsymbols* decl) { super(decl); this.loc = loc; this.protection = p; } - extern (D) this(Loc loc, Identifiers* pkg_identifiers, Dsymbols* decl) + extern (D) this(const ref Loc loc, Identifiers* pkg_identifiers, Dsymbols* decl) { super(decl); this.loc = loc; @@ -1317,7 +1317,7 @@ struct ASTBase { Expressions* args; - extern (D) this(Loc loc, Identifier ident, Expressions* args, Dsymbols* decl) + extern (D) this(const ref Loc loc, Identifier ident, Expressions* args, Dsymbols* decl) { super(decl); this.loc = loc; @@ -1417,14 +1417,14 @@ struct ASTBase @property ref value() { return (cast(ExpInitializer)_init).exp; } - extern (D) this(Loc loc, Identifier id, Expression value, Type origType) + extern (D) this(const ref Loc loc, Identifier id, Expression value, Type origType) { super(loc, null, id ? id : Id.empty, new ExpInitializer(loc, value)); this.origValue = value; this.origType = origType; } - extern(D) this(Loc loc, Identifier id, Expression value, Type memtype, + extern(D) this(const ref Loc loc, Identifier id, Expression value, Type memtype, StorageClass stc, UserAttributeDeclaration uad, DeprecatedDeclaration dd) { this(loc, id, value, memtype); @@ -1465,7 +1465,7 @@ struct ASTBase int zeroInit; StructPOD ispod; - final extern (D) this(Loc loc, Identifier id, bool inObject) + final extern (D) this(const ref Loc loc, Identifier id, bool inObject) { super(loc, id); zeroInit = 0; @@ -1486,7 +1486,7 @@ struct ASTBase extern (C++) final class UnionDeclaration : StructDeclaration { - extern (D) this(Loc loc, Identifier id) + extern (D) this(const ref Loc loc, Identifier id) { super(loc, id, false); } @@ -1512,7 +1512,7 @@ struct ASTBase BaseClasses* baseclasses; Baseok baseok; - final extern (D) this(Loc loc, Identifier id, BaseClasses* baseclasses, Dsymbols* members, bool inObject) + final extern (D) this(const ref Loc loc, Identifier id, BaseClasses* baseclasses, Dsymbols* members, bool inObject) { if(!id) id = Identifier.generateId("__anonclass"); @@ -1698,7 +1698,7 @@ struct ASTBase extern (C++) class InterfaceDeclaration : ClassDeclaration { - final extern (D) this(Loc loc, Identifier id, BaseClasses* baseclasses) + final extern (D) this(const ref Loc loc, Identifier id, BaseClasses* baseclasses) { super(loc, id, baseclasses, null, false); } @@ -1713,7 +1713,7 @@ struct ASTBase { TypeQualified tqual; - extern (D) this(Loc loc, Identifier ident, TypeQualified tqual, Objects *tiargs) + extern (D) this(const ref Loc loc, Identifier ident, TypeQualified tqual, Objects *tiargs) { super(loc, tqual.idents.dim ? cast(Identifier)tqual.idents[tqual.idents.dim - 1] : (cast(TypeIdentifier)tqual).ident, @@ -1838,7 +1838,7 @@ struct ASTBase { Loc loc; - final extern (D) this(Loc loc) + final extern (D) this(const ref Loc loc) { this.loc = loc; } @@ -1868,7 +1868,7 @@ struct ASTBase { Dsymbols* imports; - extern (D) this(Loc loc, Dsymbols* imports) + extern (D) this(const ref Loc loc, Dsymbols* imports) { super(loc); this.imports = imports; @@ -1885,7 +1885,7 @@ struct ASTBase Statement statement; Loc endloc; - extern (D) this(Loc loc, Statement s, Loc endloc) + extern (D) this(const ref Loc loc, Statement s, Loc endloc) { super(loc); this.statement = s; @@ -1902,7 +1902,7 @@ struct ASTBase { Expression exp; - extern (D) this(Loc loc, Expression exp) + extern (D) this(const ref Loc loc, Expression exp) { super(loc); this.exp = exp; @@ -1924,7 +1924,7 @@ struct ASTBase Identifier ident; Statement statement; - final extern (D) this(Loc loc, Identifier ident, Statement statement) + final extern (D) this(const ref Loc loc, Identifier ident, Statement statement) { super(loc); this.ident = ident; @@ -1957,7 +1957,7 @@ struct ASTBase { Expression exp; - final extern (D) this(Loc loc, Expression exp) + final extern (D) this(const ref Loc loc, Expression exp) { super(loc); this.exp = exp; @@ -1975,7 +1975,7 @@ struct ASTBase Statement _body; Loc endloc; - extern (D) this(Loc loc, Expression c, Statement b, Loc endloc) + extern (D) this(const ref Loc loc, Expression c, Statement b, Loc endloc) { super(loc); condition = c; @@ -1997,7 +1997,7 @@ struct ASTBase Statement _body; Loc endloc; - extern (D) this(Loc loc, Statement _init, Expression condition, Expression increment, Statement _body, Loc endloc) + extern (D) this(const ref Loc loc, Statement _init, Expression condition, Expression increment, Statement _body, Loc endloc) { super(loc); this._init = _init; @@ -2019,7 +2019,7 @@ struct ASTBase Expression condition; Loc endloc; - extern (D) this(Loc loc, Statement b, Expression c, Loc endloc) + extern (D) this(const ref Loc loc, Statement b, Expression c, Loc endloc) { super(loc); _body = b; @@ -2043,7 +2043,7 @@ struct ASTBase Loc endloc; // location of closing curly bracket - extern (D) this(Loc loc, TOK op, Parameter prm, Expression lwr, Expression upr, Statement _body, Loc endloc) + extern (D) this(const ref Loc loc, TOK op, Parameter prm, Expression lwr, Expression upr, Statement _body, Loc endloc) { super(loc); this.op = op; @@ -2068,7 +2068,7 @@ struct ASTBase Statement _body; Loc endloc; // location of closing curly bracket - extern (D) this(Loc loc, TOK op, Parameters* parameters, Expression aggr, Statement _body, Loc endloc) + extern (D) this(const ref Loc loc, TOK op, Parameters* parameters, Expression aggr, Statement _body, Loc endloc) { super(loc); this.op = op; @@ -2093,7 +2093,7 @@ struct ASTBase VarDeclaration match; // for MatchExpression results Loc endloc; // location of closing curly bracket - extern (D) this(Loc loc, Parameter prm, Expression condition, Statement ifbody, Statement elsebody, Loc endloc) + extern (D) this(const ref Loc loc, Parameter prm, Expression condition, Statement ifbody, Statement elsebody, Loc endloc) { super(loc); this.prm = prm; @@ -2114,7 +2114,7 @@ struct ASTBase TOK tok; Statement statement; - extern (D) this(Loc loc, TOK tok, Statement statement) + extern (D) this(const ref Loc loc, TOK tok, Statement statement) { super(loc); this.tok = tok; @@ -2133,7 +2133,7 @@ struct ASTBase Statement ifbody; Statement elsebody; - extern (D) this(Loc loc, Condition condition, Statement ifbody, Statement elsebody) + extern (D) this(const ref Loc loc, Condition condition, Statement ifbody, Statement elsebody) { super(loc); this.condition = condition; @@ -2151,7 +2151,7 @@ struct ASTBase { StaticForeach sfe; - extern (D) this(Loc loc, StaticForeach sfe) + extern (D) this(const ref Loc loc, StaticForeach sfe) { super(loc); this.sfe = sfe; @@ -2169,7 +2169,7 @@ struct ASTBase Expressions* args; // array of Expression's Statement _body; - extern (D) this(Loc loc, Identifier ident, Expressions* args, Statement _body) + extern (D) this(const ref Loc loc, Identifier ident, Expressions* args, Statement _body) { super(loc); this.ident = ident; @@ -2189,7 +2189,7 @@ struct ASTBase Statement _body; bool isFinal; - extern (D) this(Loc loc, Expression c, Statement b, bool isFinal) + extern (D) this(const ref Loc loc, Expression c, Statement b, bool isFinal) { super(loc); this.condition = c; @@ -2209,7 +2209,7 @@ struct ASTBase Expression last; Statement statement; - extern (D) this(Loc loc, Expression first, Expression last, Statement s) + extern (D) this(const ref Loc loc, Expression first, Expression last, Statement s) { super(loc); this.first = first; @@ -2228,7 +2228,7 @@ struct ASTBase Expression exp; Statement statement; - extern (D) this(Loc loc, Expression exp, Statement s) + extern (D) this(const ref Loc loc, Expression exp, Statement s) { super(loc); this.exp = exp; @@ -2245,7 +2245,7 @@ struct ASTBase { Statement statement; - extern (D) this(Loc loc, Statement s) + extern (D) this(const ref Loc loc, Statement s) { super(loc); this.statement = s; @@ -2261,7 +2261,7 @@ struct ASTBase { Identifier ident; - extern (D) this(Loc loc, Identifier ident) + extern (D) this(const ref Loc loc, Identifier ident) { super(loc); this.ident = ident; @@ -2277,7 +2277,7 @@ struct ASTBase { Identifier ident; - extern (D) this(Loc loc, Identifier ident) + extern (D) this(const ref Loc loc, Identifier ident) { super(loc); this.ident = ident; @@ -2291,7 +2291,7 @@ struct ASTBase extern (C++) final class GotoDefaultStatement : Statement { - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc); } @@ -2306,7 +2306,7 @@ struct ASTBase { Expression exp; - extern (D) this(Loc loc, Expression exp) + extern (D) this(const ref Loc loc, Expression exp) { super(loc); this.exp = exp; @@ -2322,7 +2322,7 @@ struct ASTBase { Identifier ident; - extern (D) this(Loc loc, Identifier ident) + extern (D) this(const ref Loc loc, Identifier ident) { super(loc); this.ident = ident; @@ -2339,7 +2339,7 @@ struct ASTBase Expression exp; Statement _body; - extern (D) this(Loc loc, Expression exp, Statement _body) + extern (D) this(const ref Loc loc, Expression exp, Statement _body) { super(loc); this.exp = exp; @@ -2358,7 +2358,7 @@ struct ASTBase Statement _body; Loc endloc; - extern (D) this(Loc loc, Expression exp, Statement _body, Loc endloc) + extern (D) this(const ref Loc loc, Expression exp, Statement _body, Loc endloc) { super(loc); this.exp = exp; @@ -2377,7 +2377,7 @@ struct ASTBase Statement _body; Catches* catches; - extern (D) this(Loc loc, Statement _body, Catches* catches) + extern (D) this(const ref Loc loc, Statement _body, Catches* catches) { super(loc); this._body = _body; @@ -2395,7 +2395,7 @@ struct ASTBase Statement _body; Statement finalbody; - extern (D) this(Loc loc, Statement _body, Statement finalbody) + extern (D) this(const ref Loc loc, Statement _body, Statement finalbody) { super(loc); this._body = _body; @@ -2412,7 +2412,7 @@ struct ASTBase { Expression exp; - extern (D) this(Loc loc, Expression exp) + extern (D) this(const ref Loc loc, Expression exp) { super(loc); this.exp = exp; @@ -2428,7 +2428,7 @@ struct ASTBase { Token* tokens; - extern (D) this(Loc loc, Token* tokens) + extern (D) this(const ref Loc loc, Token* tokens) { super(loc); this.tokens = tokens; @@ -2444,12 +2444,12 @@ struct ASTBase { Expression exp; - final extern (D) this(Loc loc, Expression exp) + final extern (D) this(const ref Loc loc, Expression exp) { super(loc); this.exp = exp; } - final extern (D) this(Loc loc, Dsymbol declaration) + final extern (D) this(const ref Loc loc, Dsymbol declaration) { super(loc); this.exp = new DeclarationExp(loc, declaration); @@ -2470,12 +2470,12 @@ struct ASTBase { Statements* statements; - final extern (D) this(Loc loc, Statements* statements) + final extern (D) this(const ref Loc loc, Statements* statements) { super(loc); this.statements = statements; } - final extern (D) this(Loc loc, Statement[] sts...) + final extern (D) this(const ref Loc loc, Statement[] sts...) { super(loc); statements = new Statements(); @@ -2497,7 +2497,7 @@ struct ASTBase extern (C++) final class CompoundDeclarationStatement : CompoundStatement { - final extern (D) this(Loc loc, Statements* statements) + final extern (D) this(const ref Loc loc, Statements* statements) { super(loc, statements); } @@ -2512,7 +2512,7 @@ struct ASTBase { StorageClass stc; - final extern (D) this(Loc loc, Statements* s, StorageClass stc) + final extern (D) this(const ref Loc loc, Statements* s, StorageClass stc) { super(loc, s); this.stc = stc; @@ -2531,7 +2531,7 @@ struct ASTBase Identifier ident; Statement handler; - extern (D) this(Loc loc, Type t, Identifier id, Statement handler) + extern (D) this(const ref Loc loc, Type t, Identifier id, Statement handler) { this.loc = loc; this.type = t; @@ -4104,7 +4104,7 @@ struct ASTBase { Identifier ident; - extern (D) this(Loc loc, Identifier ident) + extern (D) this(const ref Loc loc, Identifier ident) { super(Tident, loc); this.ident = ident; @@ -4131,7 +4131,7 @@ struct ASTBase extern (C++) final class TypeReturn : TypeQualified { - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(Treturn, loc); } @@ -4154,7 +4154,7 @@ struct ASTBase { Expression exp; - extern (D) this(Loc loc, Expression exp) + extern (D) this(const ref Loc loc, Expression exp) { super(Ttypeof, loc); this.exp = exp; @@ -4178,7 +4178,7 @@ struct ASTBase { TemplateInstance tempinst; - final extern (D) this(Loc loc, TemplateInstance tempinst) + final extern (D) this(const ref Loc loc, TemplateInstance tempinst) { super(Tinstance, loc); this.tempinst = tempinst; @@ -4211,7 +4211,7 @@ struct ASTBase ubyte parens; ubyte size; - final extern (D) this(Loc loc, TOK op, int size) + final extern (D) this(const ref Loc loc, TOK op, int size) { this.loc = loc; this.op = op; @@ -4260,7 +4260,7 @@ struct ASTBase { Dsymbol declaration; - extern (D) this(Loc loc, Dsymbol declaration) + extern (D) this(const ref Loc loc, Dsymbol declaration) { super(loc, TOK.declaration, __traits(classInstanceSize, DeclarationExp)); this.declaration = declaration; @@ -4276,7 +4276,7 @@ struct ASTBase { dinteger_t value; - extern (D) this(Loc loc, dinteger_t value, Type type) + extern (D) this(const ref Loc loc, dinteger_t value, Type type) { super(loc, TOK.int64, __traits(classInstanceSize, IntegerExp)); assert(type); @@ -4368,7 +4368,7 @@ struct ASTBase ClassDeclaration cd; // class being instantiated Expressions* arguments; // Array of Expression's to call class constructor - extern (D) this(Loc loc, Expression thisexp, Expressions* newargs, ClassDeclaration cd, Expressions* arguments) + extern (D) this(const ref Loc loc, Expression thisexp, Expressions* newargs, ClassDeclaration cd, Expressions* arguments) { super(loc, TOK.newAnonymousClass, __traits(classInstanceSize, NewAnonClassExp)); this.thisexp = thisexp; @@ -4392,7 +4392,7 @@ struct ASTBase TOK tok2; // 'struct', 'union', etc. TemplateParameters* parameters; - extern (D) this(Loc loc, Type targ, Identifier id, TOK tok, Type tspec, TOK tok2, TemplateParameters* parameters) + extern (D) this(const ref Loc loc, Type targ, Identifier id, TOK tok, Type tspec, TOK tok2, TemplateParameters* parameters) { super(loc, TOK.is_, __traits(classInstanceSize, IsExp)); this.targ = targ; @@ -4413,7 +4413,7 @@ struct ASTBase { real_t value; - extern (D) this(Loc loc, real_t value, Type type) + extern (D) this(const ref Loc loc, real_t value, Type type) { super(loc, TOK.float64, __traits(classInstanceSize, RealExp)); this.value = value; @@ -4428,7 +4428,7 @@ struct ASTBase extern (C++) final class NullExp : Expression { - extern (D) this(Loc loc, Type type = null) + extern (D) this(const ref Loc loc, Type type = null) { super(loc, TOK.null_, __traits(classInstanceSize, NullExp)); this.type = type; @@ -4444,7 +4444,7 @@ struct ASTBase { RootObject obj; - extern (D) this(Loc loc, RootObject o) + extern (D) this(const ref Loc loc, RootObject o) { super(loc, TOK.typeid_, __traits(classInstanceSize, TypeidExp)); this.obj = o; @@ -4461,7 +4461,7 @@ struct ASTBase Identifier ident; Objects* args; - extern (D) this(Loc loc, Identifier ident, Objects* args) + extern (D) this(const ref Loc loc, Identifier ident, Objects* args) { super(loc, TOK.traits, __traits(classInstanceSize, TraitsExp)); this.ident = ident; @@ -4486,7 +4486,7 @@ struct ASTBase ubyte sz = 1; // 1: char, 2: wchar, 4: dchar char postfix = 0; // 'c', 'w', 'd' - extern (D) this(Loc loc, char* string) + extern (D) this(const ref Loc loc, char* string) { super(loc, TOK.string_, __traits(classInstanceSize, StringExp)); this.string = string; @@ -4494,7 +4494,7 @@ struct ASTBase this.sz = 1; // work around LDC bug #1286 } - extern (D) this(Loc loc, void* string, size_t len) + extern (D) this(const ref Loc loc, void* string, size_t len) { super(loc, TOK.string_, __traits(classInstanceSize, StringExp)); this.string = cast(char*)string; @@ -4502,7 +4502,7 @@ struct ASTBase this.sz = 1; // work around LDC bug #1286 } - extern (D) this(Loc loc, void* string, size_t len, char postfix) + extern (D) this(const ref Loc loc, void* string, size_t len, char postfix) { super(loc, TOK.string_, __traits(classInstanceSize, StringExp)); this.string = cast(char*)string; @@ -4524,7 +4524,7 @@ struct ASTBase Type newtype; Expressions* arguments; // Array of Expression's - extern (D) this(Loc loc, Expression thisexp, Expressions* newargs, Type newtype, Expressions* arguments) + extern (D) this(const ref Loc loc, Expression thisexp, Expressions* newargs, Type newtype, Expressions* arguments) { super(loc, TOK.new_, __traits(classInstanceSize, NewExp)); this.thisexp = thisexp; @@ -4544,7 +4544,7 @@ struct ASTBase Expressions* keys; Expressions* values; - extern (D) this(Loc loc, Expressions* keys, Expressions* values) + extern (D) this(const ref Loc loc, Expressions* keys, Expressions* values) { super(loc, TOK.assocArrayLiteral, __traits(classInstanceSize, AssocArrayLiteralExp)); assert(keys.dim == values.dim); @@ -4563,20 +4563,20 @@ struct ASTBase Expression basis; Expressions* elements; - extern (D) this(Loc loc, Expressions* elements) + extern (D) this(const ref Loc loc, Expressions* elements) { super(loc, TOK.arrayLiteral, __traits(classInstanceSize, ArrayLiteralExp)); this.elements = elements; } - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.arrayLiteral, __traits(classInstanceSize, ArrayLiteralExp)); elements = new Expressions(); elements.push(e); } - extern (D) this(Loc loc, Expression basis, Expressions* elements) + extern (D) this(const ref Loc loc, Expression basis, Expressions* elements) { super(loc, TOK.arrayLiteral, __traits(classInstanceSize, ArrayLiteralExp)); this.basis = basis; @@ -4595,7 +4595,7 @@ struct ASTBase TemplateDeclaration td; TOK tok; - extern (D) this(Loc loc, Dsymbol s) + extern (D) this(const ref Loc loc, Dsymbol s) { super(loc, TOK.function_, __traits(classInstanceSize, FuncExp)); this.td = s.isTemplateDeclaration(); @@ -4621,7 +4621,7 @@ struct ASTBase Expression lwr; Expression upr; - extern (D) this(Loc loc, Expression lwr, Expression upr) + extern (D) this(const ref Loc loc, Expression lwr, Expression upr) { super(loc, TOK.interval, __traits(classInstanceSize, IntervalExp)); this.lwr = lwr; @@ -4636,7 +4636,7 @@ struct ASTBase extern (C++) final class TypeExp : Expression { - extern (D) this(Loc loc, Type type) + extern (D) this(const ref Loc loc, Type type) { super(loc, TOK.type, __traits(classInstanceSize, TypeExp)); this.type = type; @@ -4652,7 +4652,7 @@ struct ASTBase { ScopeDsymbol sds; - extern (D) this(Loc loc, ScopeDsymbol sds) + extern (D) this(const ref Loc loc, ScopeDsymbol sds) { super(loc, TOK.scope_, __traits(classInstanceSize, ScopeExp)); this.sds = sds; @@ -4669,7 +4669,7 @@ struct ASTBase { Identifier ident; - final extern (D) this(Loc loc, Identifier ident) + final extern (D) this(const ref Loc loc, Identifier ident) { super(loc, TOK.identifier, __traits(classInstanceSize, IdentifierExp)); this.ident = ident; @@ -4685,7 +4685,7 @@ struct ASTBase { Expression e1; - final extern (D) this(Loc loc, TOK op, int size, Expression e1) + final extern (D) this(const ref Loc loc, TOK op, int size, Expression e1) { super(loc, op, size); this.e1 = e1; @@ -4701,7 +4701,7 @@ struct ASTBase { TOK subop; // which of the derived classes this is - final extern (D) this(Loc loc, TOK subop, int size) + final extern (D) this(const ref Loc loc, TOK subop, int size) { super(loc, TOK.default_, size); this.subop = subop; @@ -4718,7 +4718,7 @@ struct ASTBase Expression e1; Expression e2; - final extern (D) this(Loc loc, TOK op, int size, Expression e1, Expression e2) + final extern (D) this(const ref Loc loc, TOK op, int size, Expression e1, Expression e2) { super(loc, op, size); this.e1 = e1; @@ -4736,7 +4736,7 @@ struct ASTBase Dsymbol s; bool hasOverloads; - extern (D) this(Loc loc, Dsymbol s, bool hasOverloads = true) + extern (D) this(const ref Loc loc, Dsymbol s, bool hasOverloads = true) { super(loc, TOK.dSymbol, __traits(classInstanceSize, DsymbolExp)); this.s = s; @@ -4754,7 +4754,7 @@ struct ASTBase TemplateDeclaration td; FuncDeclaration fd; - extern (D) this(Loc loc, TemplateDeclaration td, FuncDeclaration fd = null) + extern (D) this(const ref Loc loc, TemplateDeclaration td, FuncDeclaration fd = null) { super(loc, TOK.template_, __traits(classInstanceSize, TemplateExp)); //printf("TemplateExp(): %s\n", td.toChars()); @@ -4773,7 +4773,7 @@ struct ASTBase Declaration var; bool hasOverloads; - final extern (D) this(Loc loc, TOK op, int size, Declaration var, bool hasOverloads) + final extern (D) this(const ref Loc loc, TOK op, int size, Declaration var, bool hasOverloads) { super(loc, op, size); assert(var); @@ -4789,7 +4789,7 @@ struct ASTBase extern (C++) final class VarExp : SymbolExp { - extern (D) this(Loc loc, Declaration var, bool hasOverloads = true) + extern (D) this(const ref Loc loc, Declaration var, bool hasOverloads = true) { if (var.isVarDeclaration()) hasOverloads = false; @@ -4809,7 +4809,7 @@ struct ASTBase Expression e0; Expressions* exps; - extern (D) this(Loc loc, Expression e0, Expressions* exps) + extern (D) this(const ref Loc loc, Expression e0, Expressions* exps) { super(loc, TOK.tuple, __traits(classInstanceSize, TupleExp)); //printf("TupleExp(this = %p)\n", this); @@ -4817,14 +4817,14 @@ struct ASTBase this.exps = exps; } - extern (D) this(Loc loc, Expressions* exps) + extern (D) this(const ref Loc loc, Expressions* exps) { super(loc, TOK.tuple, __traits(classInstanceSize, TupleExp)); //printf("TupleExp(this = %p)\n", this); this.exps = exps; } - extern (D) this(Loc loc, TupleDeclaration tup) + extern (D) this(const ref Loc loc, TupleDeclaration tup) { super(loc, TOK.tuple, __traits(classInstanceSize, TupleExp)); this.exps = new Expressions(); @@ -4905,7 +4905,7 @@ struct ASTBase extern (C++) final class DollarExp : IdentifierExp { - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc, Id.dollar); } @@ -4918,7 +4918,7 @@ struct ASTBase extern (C++) class ThisExp : Expression { - final extern (D) this(Loc loc) + final extern (D) this(const ref Loc loc) { super(loc, TOK.this_, __traits(classInstanceSize, ThisExp)); } @@ -4931,7 +4931,7 @@ struct ASTBase extern (C++) final class SuperExp : ThisExp { - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc); op = TOK.super_; @@ -4945,7 +4945,7 @@ struct ASTBase extern (C++) final class AddrExp : UnaExp { - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.address, __traits(classInstanceSize, AddrExp), e); } @@ -4971,11 +4971,11 @@ struct ASTBase extern (C++) final class PtrExp : UnaExp { - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.star, __traits(classInstanceSize, PtrExp), e); } - extern (D) this(Loc loc, Expression e, Type t) + extern (D) this(const ref Loc loc, Expression e, Type t) { super(loc, TOK.star, __traits(classInstanceSize, PtrExp), e); type = t; @@ -4989,7 +4989,7 @@ struct ASTBase extern (C++) final class NegExp : UnaExp { - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.negate, __traits(classInstanceSize, NegExp), e); } @@ -5002,7 +5002,7 @@ struct ASTBase extern (C++) final class UAddExp : UnaExp { - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.uadd, __traits(classInstanceSize, UAddExp), e); } @@ -5015,7 +5015,7 @@ struct ASTBase extern (C++) final class NotExp : UnaExp { - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.not, __traits(classInstanceSize, NotExp), e); } @@ -5028,7 +5028,7 @@ struct ASTBase extern (C++) final class ComExp : UnaExp { - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.tilde, __traits(classInstanceSize, ComExp), e); } @@ -5043,7 +5043,7 @@ struct ASTBase { bool isRAII; - extern (D) this(Loc loc, Expression e, bool isRAII) + extern (D) this(const ref Loc loc, Expression e, bool isRAII) { super(loc, TOK.delete_, __traits(classInstanceSize, DeleteExp), e); this.isRAII = isRAII; @@ -5060,12 +5060,12 @@ struct ASTBase Type to; ubyte mod = cast(ubyte)~0; - extern (D) this(Loc loc, Expression e, Type t) + extern (D) this(const ref Loc loc, Expression e, Type t) { super(loc, TOK.cast_, __traits(classInstanceSize, CastExp), e); this.to = t; } - extern (D) this(Loc loc, Expression e, ubyte mod) + extern (D) this(const ref Loc loc, Expression e, ubyte mod) { super(loc, TOK.cast_, __traits(classInstanceSize, CastExp), e); this.mod = mod; @@ -5081,18 +5081,18 @@ struct ASTBase { Expressions* arguments; - extern (D) this(Loc loc, Expression e, Expressions* exps) + extern (D) this(const ref Loc loc, Expression e, Expressions* exps) { super(loc, TOK.call, __traits(classInstanceSize, CallExp), e); this.arguments = exps; } - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.call, __traits(classInstanceSize, CallExp), e); } - extern (D) this(Loc loc, Expression e, Expression earg1) + extern (D) this(const ref Loc loc, Expression e, Expression earg1) { super(loc, TOK.call, __traits(classInstanceSize, CallExp), e); auto arguments = new Expressions(); @@ -5104,7 +5104,7 @@ struct ASTBase this.arguments = arguments; } - extern (D) this(Loc loc, Expression e, Expression earg1, Expression earg2) + extern (D) this(const ref Loc loc, Expression e, Expression earg1, Expression earg2) { super(loc, TOK.call, __traits(classInstanceSize, CallExp), e); auto arguments = new Expressions(); @@ -5124,7 +5124,7 @@ struct ASTBase { Identifier ident; - extern (D) this(Loc loc, Expression e, Identifier ident) + extern (D) this(const ref Loc loc, Expression e, Identifier ident) { super(loc, TOK.dotIdentifier, __traits(classInstanceSize, DotIdExp), e); this.ident = ident; @@ -5140,7 +5140,7 @@ struct ASTBase { Expression msg; - extern (D) this(Loc loc, Expression e, Expression msg = null) + extern (D) this(const ref Loc loc, Expression e, Expression msg = null) { super(loc, TOK.assert_, __traits(classInstanceSize, AssertExp), e); this.msg = msg; @@ -5154,7 +5154,7 @@ struct ASTBase extern (C++) final class CompileExp : UnaExp { - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.mixin_, __traits(classInstanceSize, CompileExp), e); } @@ -5167,7 +5167,7 @@ struct ASTBase extern (C++) final class ImportExp : UnaExp { - extern (D) this(Loc loc, Expression e) + extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.import_, __traits(classInstanceSize, ImportExp), e); } @@ -5182,12 +5182,12 @@ struct ASTBase { TemplateInstance ti; - extern (D) this(Loc loc, Expression e, Identifier name, Objects* tiargs) + extern (D) this(const ref Loc loc, Expression e, Identifier name, Objects* tiargs) { super(loc, TOK.dotTemplateInstance, __traits(classInstanceSize, DotTemplateInstanceExp), e); this.ti = new TemplateInstance(loc, name, tiargs); } - extern (D) this(Loc loc, Expression e, TemplateInstance ti) + extern (D) this(const ref Loc loc, Expression e, TemplateInstance ti) { super(loc, TOK.dotTemplateInstance, __traits(classInstanceSize, DotTemplateInstanceExp), e); this.ti = ti; @@ -5203,7 +5203,7 @@ struct ASTBase { Expressions* arguments; - extern (D) this(Loc loc, Expression e1, Expression index = null) + extern (D) this(const ref Loc loc, Expression e1, Expression index = null) { super(loc, TOK.array, __traits(classInstanceSize, ArrayExp), e1); arguments = new Expressions(); @@ -5211,7 +5211,7 @@ struct ASTBase arguments.push(index); } - extern (D) this(Loc loc, Expression e1, Expressions* args) + extern (D) this(const ref Loc loc, Expression e1, Expressions* args) { super(loc, TOK.array, __traits(classInstanceSize, ArrayExp), e1); arguments = args; @@ -5225,7 +5225,7 @@ struct ASTBase extern (C++) final class FuncInitExp : DefaultInitExp { - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc, TOK.functionString, __traits(classInstanceSize, FuncInitExp)); } @@ -5238,7 +5238,7 @@ struct ASTBase extern (C++) final class PrettyFuncInitExp : DefaultInitExp { - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc, TOK.prettyFunction, __traits(classInstanceSize, PrettyFuncInitExp)); } @@ -5251,7 +5251,7 @@ struct ASTBase extern (C++) final class FileInitExp : DefaultInitExp { - extern (D) this(Loc loc, TOK tok) + extern (D) this(const ref Loc loc, TOK tok) { super(loc, tok, __traits(classInstanceSize, FileInitExp)); } @@ -5264,7 +5264,7 @@ struct ASTBase extern (C++) final class LineInitExp : DefaultInitExp { - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc, TOK.line, __traits(classInstanceSize, LineInitExp)); } @@ -5277,7 +5277,7 @@ struct ASTBase extern (C++) final class ModuleInitExp : DefaultInitExp { - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc, TOK.moduleString, __traits(classInstanceSize, ModuleInitExp)); } @@ -5293,7 +5293,7 @@ struct ASTBase const bool isGenerated; bool allowCommaExp; - extern (D) this(Loc loc, Expression e1, Expression e2, bool generated = true) + extern (D) this(const ref Loc loc, Expression e1, Expression e2, bool generated = true) { super(loc, TOK.comma, __traits(classInstanceSize, CommaExp), e1, e2); allowCommaExp = isGenerated = generated; @@ -5320,7 +5320,7 @@ struct ASTBase extern (C++) final class PowExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.pow, __traits(classInstanceSize, PowExp), e1, e2); } @@ -5333,7 +5333,7 @@ struct ASTBase extern (C++) final class MulExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.mul, __traits(classInstanceSize, MulExp), e1, e2); } @@ -5346,7 +5346,7 @@ struct ASTBase extern (C++) final class DivExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.div, __traits(classInstanceSize, DivExp), e1, e2); } @@ -5359,7 +5359,7 @@ struct ASTBase extern (C++) final class ModExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.mod, __traits(classInstanceSize, ModExp), e1, e2); } @@ -5372,7 +5372,7 @@ struct ASTBase extern (C++) final class AddExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.add, __traits(classInstanceSize, AddExp), e1, e2); } @@ -5385,7 +5385,7 @@ struct ASTBase extern (C++) final class MinExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.min, __traits(classInstanceSize, MinExp), e1, e2); } @@ -5398,7 +5398,7 @@ struct ASTBase extern (C++) final class CatExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.concatenate, __traits(classInstanceSize, CatExp), e1, e2); } @@ -5411,7 +5411,7 @@ struct ASTBase extern (C++) final class ShlExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.leftShift, __traits(classInstanceSize, ShlExp), e1, e2); } @@ -5424,7 +5424,7 @@ struct ASTBase extern (C++) final class ShrExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.rightShift, __traits(classInstanceSize, ShrExp), e1, e2); } @@ -5437,7 +5437,7 @@ struct ASTBase extern (C++) final class UshrExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.unsignedRightShift, __traits(classInstanceSize, UshrExp), e1, e2); } @@ -5464,7 +5464,7 @@ struct ASTBase extern (C++) final class InExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.in_, __traits(classInstanceSize, InExp), e1, e2); } @@ -5503,7 +5503,7 @@ struct ASTBase extern (C++) final class AndExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.and, __traits(classInstanceSize, AndExp), e1, e2); } @@ -5516,7 +5516,7 @@ struct ASTBase extern (C++) final class XorExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.xor, __traits(classInstanceSize, XorExp), e1, e2); } @@ -5529,7 +5529,7 @@ struct ASTBase extern (C++) final class OrExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.or, __traits(classInstanceSize, OrExp), e1, e2); } @@ -5542,7 +5542,7 @@ struct ASTBase extern (C++) final class LogicalExp : BinExp { - extern (D) this(Loc loc, TOK op, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, TOK op, Expression e1, Expression e2) { super(loc, op, __traits(classInstanceSize, LogicalExp), e1, e2); } @@ -5557,7 +5557,7 @@ struct ASTBase { Expression econd; - extern (D) this(Loc loc, Expression econd, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression econd, Expression e1, Expression e2) { super(loc, TOK.question, __traits(classInstanceSize, CondExp), e1, e2); this.econd = econd; @@ -5571,7 +5571,7 @@ struct ASTBase extern (C++) final class AssignExp : BinExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.assign, __traits(classInstanceSize, AssignExp), e1, e2); } @@ -5584,7 +5584,7 @@ struct ASTBase extern (C++) class BinAssignExp : BinExp { - final extern (D) this(Loc loc, TOK op, int size, Expression e1, Expression e2) + final extern (D) this(const ref Loc loc, TOK op, int size, Expression e1, Expression e2) { super(loc, op, size, e1, e2); } @@ -5597,7 +5597,7 @@ struct ASTBase extern (C++) final class AddAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.addAssign, __traits(classInstanceSize, AddAssignExp), e1, e2); } @@ -5610,7 +5610,7 @@ struct ASTBase extern (C++) final class MinAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.minAssign, __traits(classInstanceSize, MinAssignExp), e1, e2); } @@ -5623,7 +5623,7 @@ struct ASTBase extern (C++) final class MulAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.mulAssign, __traits(classInstanceSize, MulAssignExp), e1, e2); } @@ -5636,7 +5636,7 @@ struct ASTBase extern (C++) final class DivAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.divAssign, __traits(classInstanceSize, DivAssignExp), e1, e2); } @@ -5649,7 +5649,7 @@ struct ASTBase extern (C++) final class ModAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.modAssign, __traits(classInstanceSize, ModAssignExp), e1, e2); } @@ -5662,7 +5662,7 @@ struct ASTBase extern (C++) final class PowAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.powAssign, __traits(classInstanceSize, PowAssignExp), e1, e2); } @@ -5675,7 +5675,7 @@ struct ASTBase extern (C++) final class AndAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.andAssign, __traits(classInstanceSize, AndAssignExp), e1, e2); } @@ -5688,7 +5688,7 @@ struct ASTBase extern (C++) final class OrAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.orAssign, __traits(classInstanceSize, OrAssignExp), e1, e2); } @@ -5701,7 +5701,7 @@ struct ASTBase extern (C++) final class XorAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.xorAssign, __traits(classInstanceSize, XorAssignExp), e1, e2); } @@ -5714,7 +5714,7 @@ struct ASTBase extern (C++) final class ShlAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.leftShiftAssign, __traits(classInstanceSize, ShlAssignExp), e1, e2); } @@ -5727,7 +5727,7 @@ struct ASTBase extern (C++) final class ShrAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.rightShiftAssign, __traits(classInstanceSize, ShrAssignExp), e1, e2); } @@ -5740,7 +5740,7 @@ struct ASTBase extern (C++) final class UshrAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.unsignedRightShiftAssign, __traits(classInstanceSize, UshrAssignExp), e1, e2); } @@ -5753,7 +5753,7 @@ struct ASTBase extern (C++) final class CatAssignExp : BinAssignExp { - extern (D) this(Loc loc, Expression e1, Expression e2) + extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.concatenateAssign, __traits(classInstanceSize, CatAssignExp), e1, e2); } @@ -5769,7 +5769,7 @@ struct ASTBase Loc loc; Identifier ident; - final extern (D) this(Loc loc, Identifier ident) + final extern (D) this(const ref Loc loc, Identifier ident) { this.loc = loc; this.ident = ident; @@ -5789,7 +5789,7 @@ struct ASTBase RootObject specAlias; RootObject defaultAlias; - extern (D) this(Loc loc, Identifier ident, Type specType, RootObject specAlias, RootObject defaultAlias) + extern (D) this(const ref Loc loc, Identifier ident, Type specType, RootObject specAlias, RootObject defaultAlias) { super(loc, ident); this.ident = ident; @@ -5809,7 +5809,7 @@ struct ASTBase Type specType; Type defaultType; - final extern (D) this(Loc loc, Identifier ident, Type specType, Type defaultType) + final extern (D) this(const ref Loc loc, Identifier ident, Type specType, Type defaultType) { super(loc, ident); this.ident = ident; @@ -5825,7 +5825,7 @@ struct ASTBase extern (C++) final class TemplateTupleParameter : TemplateParameter { - extern (D) this(Loc loc, Identifier ident) + extern (D) this(const ref Loc loc, Identifier ident) { super(loc, ident); this.ident = ident; @@ -5843,7 +5843,7 @@ struct ASTBase Expression specValue; Expression defaultValue; - extern (D) this(Loc loc, Identifier ident, Type valType, + extern (D) this(const ref Loc loc, Identifier ident, Type valType, Expression specValue, Expression defaultValue) { super(loc, ident); @@ -5861,7 +5861,7 @@ struct ASTBase extern (C++) final class TemplateThisParameter : TemplateTypeParameter { - extern (D) this(Loc loc, Identifier ident, Type specType, Type defaultType) + extern (D) this(const ref Loc loc, Identifier ident, Type specType, Type defaultType) { super(loc, ident, specType, defaultType); } @@ -5876,7 +5876,7 @@ struct ASTBase { Loc loc; - final extern (D) this(Loc loc) + final extern (D) this(const ref Loc loc) { this.loc = loc; } @@ -5894,7 +5894,7 @@ struct ASTBase ForeachStatement aggrfe; ForeachRangeStatement rangefe; - final extern (D) this(Loc loc, ForeachStatement aggrfe, ForeachRangeStatement rangefe) + final extern (D) this(const ref Loc loc, ForeachStatement aggrfe, ForeachRangeStatement rangefe) in { assert(!!aggrfe ^ !!rangefe); @@ -5911,7 +5911,7 @@ struct ASTBase { Expression exp; - final extern (D) this(Loc loc, Expression exp) + final extern (D) this(const ref Loc loc, Expression exp) { super(loc); this.exp = exp; @@ -5972,7 +5972,7 @@ struct ASTBase { Loc loc; - final extern (D) this(Loc loc) + final extern (D) this(const ref Loc loc) { this.loc = loc; } @@ -5998,7 +5998,7 @@ struct ASTBase { Expression exp; - extern (D) this(Loc loc, Expression exp) + extern (D) this(const ref Loc loc, Expression exp) { super(loc); this.exp = exp; @@ -6020,7 +6020,7 @@ struct ASTBase Identifiers field; Initializers value; - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc); } @@ -6044,7 +6044,7 @@ struct ASTBase uint dim; Type type; - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc); } @@ -6065,7 +6065,7 @@ struct ASTBase extern (C++) final class VoidInitializer : Initializer { - extern (D) this(Loc loc) + extern (D) this(const ref Loc loc) { super(loc); } @@ -6105,7 +6105,7 @@ struct ASTBase bool isdeprecated; Expression msg; - extern (D) this(Loc loc, Identifiers* packages, Identifier id, Expression msg, bool isdeprecated) + extern (D) this(const ref Loc loc, Identifiers* packages, Identifier id, Expression msg, bool isdeprecated) { this.loc = loc; this.packages = packages; diff --git a/src/dmd/dclass.d b/src/dmd/dclass.d index d8dbd92e8825..e9b2781825b8 100644 --- a/src/dmd/dclass.d +++ b/src/dmd/dclass.d @@ -223,7 +223,7 @@ extern (C++) class ClassDeclaration : AggregateDeclaration Symbol* cpp_type_info_ptr_sym; // cached instance of class Id.cpp_type_info_ptr - final extern (D) this(Loc loc, Identifier id, BaseClasses* baseclasses, Dsymbols* members, bool inObject) + final extern (D) this(const ref Loc loc, Identifier id, BaseClasses* baseclasses, Dsymbols* members, bool inObject) { if (!id) { @@ -991,7 +991,7 @@ extern (C++) class ClassDeclaration : AggregateDeclaration */ extern (C++) final class InterfaceDeclaration : ClassDeclaration { - extern (D) this(Loc loc, Identifier id, BaseClasses* baseclasses) + extern (D) this(const ref Loc loc, Identifier id, BaseClasses* baseclasses) { super(loc, id, baseclasses, null, false); if (id == Id.IUnknown) // IUnknown is the root of all COM interfaces diff --git a/src/dmd/declaration.d b/src/dmd/declaration.d index b6954150d324..73cdf39dd47f 100644 --- a/src/dmd/declaration.d +++ b/src/dmd/declaration.d @@ -561,7 +561,7 @@ extern (C++) final class TupleDeclaration : Declaration bool isexp; // true: expression tuple TypeTuple tupletype; // !=null if this is a type tuple - extern (D) this(Loc loc, Identifier id, Objects* objects) + extern (D) this(const ref Loc loc, Identifier id, Objects* objects) { super(id); this.loc = loc; @@ -692,7 +692,7 @@ extern (C++) final class AliasDeclaration : Declaration Dsymbol overnext; // next in overload list Dsymbol _import; // !=null if unresolved internal alias for selective import - extern (D) this(Loc loc, Identifier id, Type type) + extern (D) this(const ref Loc loc, Identifier id, Type type) { super(id); //printf("AliasDeclaration(id = '%s', type = %p)\n", id.toChars(), type); @@ -702,7 +702,7 @@ extern (C++) final class AliasDeclaration : Declaration assert(type); } - extern (D) this(Loc loc, Identifier id, Dsymbol s) + extern (D) this(const ref Loc loc, Identifier id, Dsymbol s) { super(id); //printf("AliasDeclaration(id = '%s', s = %p)\n", id.toChars(), s); @@ -1098,7 +1098,7 @@ extern (C++) class VarDeclaration : Declaration VarDeclarations* maybes; // STC.maybescope variables that are assigned to this STC.maybescope variable - final extern (D) this(Loc loc, Type type, Identifier id, Initializer _init, StorageClass storage_class = STC.undefined_) + final extern (D) this(const ref Loc loc, Type type, Identifier id, Initializer _init, StorageClass storage_class = STC.undefined_) { super(id); //printf("VarDeclaration('%s')\n", id.toChars()); @@ -1668,7 +1668,7 @@ extern (C++) final class SymbolDeclaration : Declaration { StructDeclaration dsym; - extern (D) this(Loc loc, StructDeclaration dsym) + extern (D) this(const ref Loc loc, StructDeclaration dsym) { super(dsym.ident); this.loc = loc; @@ -2140,7 +2140,7 @@ extern (C++) final class TypeInfoVectorDeclaration : TypeInfoDeclaration */ extern (C++) final class ThisDeclaration : VarDeclaration { - extern (D) this(Loc loc, Type t) + extern (D) this(const ref Loc loc, Type t) { super(loc, t, Id.This, null); storage_class |= STC.nodtor; diff --git a/src/dmd/dimport.d b/src/dmd/dimport.d index bb236d7ba2c5..bda52fbd089d 100644 --- a/src/dmd/dimport.d +++ b/src/dmd/dimport.d @@ -47,7 +47,7 @@ extern (C++) final class Import : Dsymbol // corresponding AliasDeclarations for alias=name pairs AliasDeclarations aliasdecls; - extern (D) this(Loc loc, Identifiers* packages, Identifier id, Identifier aliasId, int isstatic) + extern (D) this(const ref Loc loc, Identifiers* packages, Identifier id, Identifier aliasId, int isstatic) { super(null); assert(id); diff --git a/src/dmd/dmodule.d b/src/dmd/dmodule.d index af598926770d..7690c05035b0 100644 --- a/src/dmd/dmodule.d +++ b/src/dmd/dmodule.d @@ -1327,7 +1327,7 @@ struct ModuleDeclaration bool isdeprecated; // if it is a deprecated module Expression msg; - extern (D) this(Loc loc, Identifiers* packages, Identifier id, Expression msg, bool isdeprecated) + extern (D) this(const ref Loc loc, Identifiers* packages, Identifier id, Expression msg, bool isdeprecated) { this.loc = loc; this.packages = packages; diff --git a/src/dmd/expression.d b/src/dmd/expression.d index e6a2e6c6babf..68fb00b36d2b 100644 --- a/src/dmd/expression.d +++ b/src/dmd/expression.d @@ -7451,7 +7451,7 @@ extern (C++) final class ObjcClassReferenceExp : Expression { ClassDeclaration classDeclaration; - extern (D) this(Loc loc, ClassDeclaration classDeclaration) + extern (D) this(const ref Loc loc, ClassDeclaration classDeclaration) { super(loc, TOK.objcClassReference, __traits(classInstanceSize, ObjcClassReferenceExp)); diff --git a/src/dmd/parse.d b/src/dmd/parse.d index 62afdd17600b..719fe83a9976 100644 --- a/src/dmd/parse.d +++ b/src/dmd/parse.d @@ -235,7 +235,7 @@ final class Parser(AST) : Lexer * Input: * loc location in source file of mixin */ - extern (D) this(Loc loc, AST.Module _module, const(char)[] input, bool doDocComment) + extern (D) this(const ref Loc loc, AST.Module _module, const(char)[] input, bool doDocComment) { super(_module ? _module.srcfile.toChars() : null, input.ptr, 0, input.length, doDocComment, false);