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
18 changes: 9 additions & 9 deletions src/dmd/attrib.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern (C++) abstract class AttribDeclaration : Dsymbol
{
Dsymbols* decl; // array of Dsymbol's

final extern (D) this(Dsymbols* decl)
extern (D) this(Dsymbols* decl)
{
this.decl = decl;
}
Expand Down Expand Up @@ -278,7 +278,7 @@ extern (C++) class StorageClassDeclaration : AttribDeclaration
{
StorageClass stc;

final extern (D) this(StorageClass stc, Dsymbols* decl)
extern (D) this(StorageClass stc, Dsymbols* decl)
{
super(decl);
this.stc = stc;
Expand Down Expand Up @@ -519,7 +519,7 @@ extern (C++) final class ProtDeclaration : AttribDeclaration
* p = protection attribute data
* decl = declarations which are affected by this protection attribute
*/
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;
Expand All @@ -533,7 +533,7 @@ extern (C++) final class ProtDeclaration : AttribDeclaration
* pkg_identifiers = list of identifiers for a qualified package name
* decl = declarations which are affected by this protection attribute
*/
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;
Expand Down Expand Up @@ -605,7 +605,7 @@ extern (C++) final class AlignDeclaration : AttribDeclaration
static assert(STRUCTALIGN_DEFAULT != UNKNOWN);
structalign_t salign = UNKNOWN;

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;
Expand Down Expand Up @@ -640,7 +640,7 @@ extern (C++) final class AnonDeclaration : AttribDeclaration
uint anonstructsize; // size of anonymous struct
uint anonalignsize; // size of anonymous struct for alignment purposes

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;
Expand Down Expand Up @@ -758,7 +758,7 @@ extern (C++) final class PragmaDeclaration : AttribDeclaration
{
Expressions* args; // array of Expression's

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;
Expand Down Expand Up @@ -825,7 +825,7 @@ extern (C++) class ConditionalDeclaration : AttribDeclaration
Condition condition;
Dsymbols* elsedecl; // array of Dsymbol's for else block

final extern (D) this(Condition condition, Dsymbols* decl, Dsymbols* elsedecl)
extern (D) this(Condition condition, Dsymbols* decl, Dsymbols* elsedecl)
{
super(decl);
//printf("ConditionalDeclaration::ConditionalDeclaration()\n");
Expand Down Expand Up @@ -1205,7 +1205,7 @@ extern (C++) final class CompileDeclaration : AttribDeclaration
ScopeDsymbol scopesym;
bool compiled;

extern (D) this(Loc loc, Expression exp)
extern (D) this(const ref Loc loc, Expression exp)
{
super(null);
//printf("CompileDeclaration(loc = %d)\n", loc.linnum);
Expand Down
18 changes: 9 additions & 9 deletions src/dmd/cond.d
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extern (C++) abstract class Condition : RootObject
return DYNCAST.condition;
}

final extern (D) this(Loc loc)
extern (D) this(const ref Loc loc)
{
this.loc = loc;
}
Expand Down Expand Up @@ -101,7 +101,7 @@ extern (C++) final class StaticForeach : RootObject
*/
bool needExpansion = false;

final extern (D) this(Loc loc,ForeachStatement aggrfe,ForeachRangeStatement rangefe)
extern (D) this(const ref Loc loc,ForeachStatement aggrfe,ForeachRangeStatement rangefe)
in
{
assert(!!aggrfe ^ !!rangefe);
Expand Down Expand Up @@ -167,7 +167,7 @@ extern (C++) final class StaticForeach : RootObject
* Returns:
* AST of the expression `(){ s; }()` with location loc.
*/
private extern(D) Expression wrapAndCall(Loc loc, Statement s)
private extern(D) Expression wrapAndCall(const ref Loc loc, Statement s)
{
auto tf = new TypeFunction(new Parameters(), null, 0, LINK.default_, 0);
auto fd = new FuncLiteralDeclaration(loc, loc, tf, TOK.reserved, null);
Expand All @@ -190,7 +190,7 @@ extern (C++) final class StaticForeach : RootObject
* `foreach (parameters; lower .. upper) s;`
* Where aggregate/lower, upper are as for the current StaticForeach.
*/
private extern(D) Statement createForeach(Loc loc, Parameters* parameters, Statement s)
private extern(D) Statement createForeach(const ref Loc loc, Parameters* parameters, Statement s)
{
if (aggrfe)
{
Expand Down Expand Up @@ -223,7 +223,7 @@ extern (C++) final class StaticForeach : RootObject
* }
*/

private extern(D) TypeStruct createTupleType(Loc loc, Expressions* e, Scope* sc)
private extern(D) TypeStruct createTupleType(const ref Loc loc, Expressions* e, Scope* sc)
{ // TODO: move to druntime?
auto sid = Identifier.generateId("Tuple");
auto sdecl = new StructDeclaration(loc, sid, false);
Expand All @@ -248,7 +248,7 @@ extern (C++) final class StaticForeach : RootObject
* An AST for the expression `Tuple(e)`.
*/

private extern(D) Expression createTuple(Loc loc, TypeStruct type, Expressions* e)
private extern(D) Expression createTuple(const ref Loc loc, TypeStruct type, Expressions* e)
{ // TODO: move to druntime?
return new CallExp(loc, new TypeExp(loc, type), e);
}
Expand Down Expand Up @@ -428,7 +428,7 @@ extern (C++) class DVCondition : Condition
Identifier ident;
Module mod;

final extern (D) this(Module mod, uint level, Identifier ident)
extern (D) this(Module mod, uint level, Identifier ident)
{
super(Loc.initial);
this.mod = mod;
Expand Down Expand Up @@ -681,7 +681,7 @@ extern (C++) final class VersionCondition : DVCondition
* loc = Where the identifier is set
* ident = identifier being checked (ident[$] must be '\0')
*/
extern(D) static void checkReserved(Loc loc, const(char)[] ident)
extern(D) static void checkReserved(const ref Loc loc, const(char)[] ident)
{
if (isReserved(ident))
error(loc, "version identifier `%s` is reserved and cannot be set",
Expand Down Expand Up @@ -818,7 +818,7 @@ extern (C++) final class StaticIfCondition : Condition
Expression exp;
int nest; // limit circular dependencies

extern (D) this(Loc loc, Expression exp)
extern (D) this(const ref Loc loc, Expression exp)
{
super(loc);
this.exp = exp;
Expand Down
22 changes: 12 additions & 10 deletions src/dmd/denum.d
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern (C++) final class EnumDeclaration : ScopeDsymbol
bool added;
int inuse;

extern (D) this(Loc loc, Identifier id, Type memtype)
extern (D) this(const ref Loc loc, Identifier id, Type memtype)
{
super(id);
//printf("EnumDeclaration() %s\n", toChars());
Expand Down Expand Up @@ -168,7 +168,7 @@ extern (C++) final class EnumDeclaration : ScopeDsymbol
* Returns:
* corresponding value of .max/.min
*/
Expression getMaxMinValue(Loc loc, Identifier id)
Expression getMaxMinValue(const ref Loc loc, Identifier id)
{
//printf("EnumDeclaration::getMaxValue()\n");
bool first = true;
Expand Down Expand Up @@ -249,7 +249,7 @@ extern (C++) final class EnumDeclaration : ScopeDsymbol
return e;
}

Expression getDefaultValue(Loc loc)
Expression getDefaultValue(const ref Loc loc)
{
//printf("EnumDeclaration::getDefaultValue() %p %s\n", this, toChars());
if (defaultval)
Expand Down Expand Up @@ -280,17 +280,18 @@ extern (C++) final class EnumDeclaration : ScopeDsymbol
return defaultval;
}

Type getMemtype(Loc loc)
Type getMemtype(const ref Loc loc)
{
if (!loc.isValid())
loc = this.loc;
if (_scope)
{
/* Enum is forward referenced. We don't need to resolve the whole thing,
* just the base type
*/
if (memtype)
memtype = memtype.typeSemantic(loc, _scope);
{
Loc locx = loc.isValid() ? loc : this.loc;
memtype = memtype.typeSemantic(locx, _scope);
}
else
{
if (!isAnonymous() && members)
Expand All @@ -303,7 +304,8 @@ extern (C++) final class EnumDeclaration : ScopeDsymbol
memtype = Type.tint32;
else
{
error(loc, "is forward referenced looking for base type");
Loc locx = loc.isValid() ? loc : this.loc;
error(locx, "is forward referenced looking for base type");
return Type.terror;
}
}
Expand Down Expand Up @@ -343,7 +345,7 @@ extern (C++) final class EnumMember : VarDeclaration

EnumDeclaration ed;

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;
Expand All @@ -361,7 +363,7 @@ extern (C++) final class EnumMember : VarDeclaration
return "enum member";
}

Expression getVarExp(Loc loc, Scope* sc)
Expression getVarExp(const ref Loc loc, Scope* sc)
{
dsymbolSemantic(this, sc);
if (errors)
Expand Down
6 changes: 3 additions & 3 deletions src/dmd/dstruct.d
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ extern (C++) class StructDeclaration : AggregateDeclaration
// For those, today TypeInfo_Struct is generated in COMDAT.
bool requestTypeInfo;

final extern (D) this(Loc loc, Identifier id, bool inObject)
extern (D) this(const ref Loc loc, Identifier id, bool inObject)
{
super(loc, id);
zeroInit = 0; // assume false until we do semantic processing
Expand Down Expand Up @@ -439,7 +439,7 @@ extern (C++) class StructDeclaration : AggregateDeclaration
* false if any errors occur,
* otherwise true and elements[] are rewritten for the output.
*/
final bool fit(Loc loc, Scope* sc, Expressions* elements, Type stype)
final bool fit(const ref Loc loc, Scope* sc, Expressions* elements, Type stype)
{
if (!elements)
return true;
Expand Down Expand Up @@ -586,7 +586,7 @@ extern (C++) class StructDeclaration : AggregateDeclaration
*/
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);
}
Expand Down
22 changes: 11 additions & 11 deletions src/dmd/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ extern (C++) final class TemplateDeclaration : ScopeDsymbol
// threaded list of previous instantiation attempts on stack
TemplatePrevious* previous;

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);
static if (LOG)
Expand Down Expand Up @@ -5016,7 +5016,7 @@ extern (C++) class TemplateParameter
bool dependent;

/* ======================== TemplateParameter =============================== */
final extern (D) this(Loc loc, Identifier ident)
extern (D) this(const ref Loc loc, Identifier ident)
{
this.loc = loc;
this.ident = ident;
Expand Down Expand Up @@ -5119,7 +5119,7 @@ extern (C++) class TemplateTypeParameter : TemplateParameter

extern (C++) static __gshared Type tdummy = null;

final 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);
this.ident = ident;
Expand Down Expand Up @@ -5282,7 +5282,7 @@ extern (C++) class TemplateTypeParameter : TemplateParameter
*/
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);
}
Expand Down Expand Up @@ -5315,7 +5315,7 @@ extern (C++) final class TemplateValueParameter : TemplateParameter

extern (D) static __gshared Expression[void*] edummies;

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);
Expand Down Expand Up @@ -5544,7 +5544,7 @@ extern (C++) final class TemplateAliasParameter : TemplateParameter

extern (C++) static __gshared Dsymbol sdummy = null;

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;
Expand Down Expand Up @@ -5756,7 +5756,7 @@ extern (C++) final class TemplateAliasParameter : TemplateParameter
*/
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;
Expand Down Expand Up @@ -5926,7 +5926,7 @@ extern (C++) class TemplateInstance : ScopeDsymbol
TemplateInstance tnext; // non-first instantiated instances
Module minst; // the top module that instantiated this instance

final extern (D) this(Loc loc, Identifier ident, Objects* tiargs)
extern (D) this(const ref Loc loc, Identifier ident, Objects* tiargs)
{
super(null);
static if (LOG)
Expand All @@ -5942,7 +5942,7 @@ extern (C++) class TemplateInstance : ScopeDsymbol
* This constructor is only called when we figured out which function
* template to instantiate.
*/
final extern (D) this(Loc loc, TemplateDeclaration td, Objects* tiargs)
extern (D) this(const ref Loc loc, TemplateDeclaration td, Objects* tiargs)
{
super(null);
static if (LOG)
Expand Down Expand Up @@ -6600,7 +6600,7 @@ extern (C++) class TemplateInstance : ScopeDsymbol
* Returns:
* false if one or more arguments have errors.
*/
static bool semanticTiargs(Loc loc, Scope* sc, Objects* tiargs, int flags)
static bool semanticTiargs(const ref Loc loc, Scope* sc, Objects* tiargs, int flags)
{
// Run semantic on each argument, place results in tiargs[]
//printf("+TemplateInstance.semanticTiargs()\n");
Expand Down Expand Up @@ -7613,7 +7613,7 @@ extern (C++) final class TemplateMixin : TemplateInstance
{
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,
Expand Down
8 changes: 4 additions & 4 deletions src/dmd/dversion.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ extern (C++) final class DebugSymbol : Dsymbol
{
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;
Expand Down Expand Up @@ -121,13 +121,13 @@ extern (C++) final class VersionSymbol : Dsymbol
{
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;
Expand Down
Loading