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
16 changes: 8 additions & 8 deletions src/dmd/aggregate.d
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
Scope* newScope(Scope* sc)
{
auto sc2 = sc.push(this);
sc2.stc &= STCsafe | STCtrusted | STCsystem;
sc2.stc &= STC.safe | STC.trusted | STC.system;
sc2.parent = this;
if (isUnionDeclaration())
sc2.inunion = 1;
Expand Down Expand Up @@ -166,7 +166,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
auto v = s.isVarDeclaration();
if (!v)
return 0;
if (v.storage_class & STCmanifest)
if (v.storage_class & STC.manifest)
return 0;

auto ad = cast(AggregateDeclaration)param;
Expand All @@ -180,14 +180,14 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
if (v.aliassym)
return 0; // If this variable was really a tuple, skip it.

if (v.storage_class & (STCstatic | STCextern | STCtls | STCgshared | STCmanifest | STCctfe | STCtemplateparameter))
if (v.storage_class & (STC.static_ | STC.extern_ | STC.tls | STC.gshared | STC.manifest | STC.ctfe | STC.templateparameter))
return 0;
if (!v.isField() || v.semanticRun < PASSsemanticdone)
return 1; // unresolvable forward reference

ad.fields.push(v);

if (v.storage_class & STCref)
if (v.storage_class & STC.ref_)
return 0;
auto tv = v.type.baseElemOf();
if (tv.ty != Tstruct)
Expand Down Expand Up @@ -472,7 +472,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
}
else
{
if ((vx.storage_class & STCnodefaultctor) && !ctorinit)
if ((vx.storage_class & STC.nodefaultctor) && !ctorinit)
{
.error(loc, "field `%s.%s` must be initialized because it has no default constructor",
type.toChars(), vx.toChars());
Expand Down Expand Up @@ -614,7 +614,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
return;
if (isUnionDeclaration() || isInterfaceDeclaration())
return;
if (storage_class & STCstatic)
if (storage_class & STC.static_)
return;

// If nested struct, add in hidden 'this' pointer to outer scope
Expand Down Expand Up @@ -656,13 +656,13 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol

assert(!vthis);
vthis = new ThisDeclaration(loc, t);
//vthis.storage_class |= STCref;
//vthis.storage_class |= STC.ref_;

// Emulate vthis.addMember()
members.push(vthis);

// Emulate vthis.dsymbolSemantic()
vthis.storage_class |= STCfield;
vthis.storage_class |= STC.field;
vthis.parent = this;
vthis.protection = Prot(PROTpublic);
vthis.alignment = t.alignment();
Expand Down
236 changes: 120 additions & 116 deletions src/dmd/astbase.d

Large diffs are not rendered by default.

36 changes: 1 addition & 35 deletions src/dmd/astcodegen.d
Original file line number Diff line number Diff line change
Expand Up @@ -49,41 +49,7 @@ struct ASTCodegen
alias Tsarray = dmd.mtype.Tsarray;
alias Terror = dmd.mtype.Terror;

alias STCconst = dmd.declaration.STCconst;
alias STCimmutable = dmd.declaration.STCimmutable;
alias STCshared = dmd.declaration.STCshared;
alias STCwild = dmd.declaration.STCwild;
alias STCin = dmd.declaration.STCin;
alias STCout = dmd.declaration.STCout;
alias STCref = dmd.declaration.STCref;
alias STClazy = dmd.declaration.STClazy;
alias STCscope = dmd.declaration.STCscope;
alias STCfinal = dmd.declaration.STCfinal;
alias STCauto = dmd.declaration.STCauto;
alias STCreturn = dmd.declaration.STCreturn;
alias STCmanifest = dmd.declaration.STCmanifest;
alias STCgshared = dmd.declaration.STCgshared;
alias STCtls = dmd.declaration.STCtls;
alias STCsafe = dmd.declaration.STCsafe;
alias STCsystem = dmd.declaration.STCsystem;
alias STCtrusted = dmd.declaration.STCtrusted;
alias STCnothrow = dmd.declaration.STCnothrow;
alias STCpure = dmd.declaration.STCpure;
alias STCproperty = dmd.declaration.STCproperty;
alias STCnogc = dmd.declaration.STCnogc;
alias STCdisable = dmd.declaration.STCdisable;
alias STCundefined = dmd.declaration.STCundefined;
alias STC_TYPECTOR = dmd.declaration.STC_TYPECTOR;
alias STCoverride = dmd.declaration.STCoverride;
alias STCabstract = dmd.declaration.STCabstract;
alias STCsynchronized = dmd.declaration.STCsynchronized;
alias STCdeprecated = dmd.declaration.STCdeprecated;
alias STCstatic = dmd.declaration.STCstatic;
alias STCextern = dmd.declaration.STCextern;
alias STCfuture = dmd.declaration.STCfuture;
alias STCalias = dmd.declaration.STCalias;
alias STClocal = dmd.declaration.STClocal;

alias STC = dmd.declaration.STC;
alias Dsymbol = dmd.dsymbol.Dsymbol;
alias Dsymbols = dmd.dsymbol.Dsymbols;
alias PROTprivate = dmd.dsymbol.PROTprivate;
Expand Down
32 changes: 16 additions & 16 deletions src/dmd/attrib.d
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,16 @@ extern (C++) class StorageClassDeclaration : AttribDeclaration
/* These sets of storage classes are mutually exclusive,
* so choose the innermost or most recent one.
*/
if (stc & (STCauto | STCscope | STCstatic | STCextern | STCmanifest))
scstc &= ~(STCauto | STCscope | STCstatic | STCextern | STCmanifest);
if (stc & (STCauto | STCscope | STCstatic | STCtls | STCmanifest | STCgshared))
scstc &= ~(STCauto | STCscope | STCstatic | STCtls | STCmanifest | STCgshared);
if (stc & (STCconst | STCimmutable | STCmanifest))
scstc &= ~(STCconst | STCimmutable | STCmanifest);
if (stc & (STCgshared | STCshared | STCtls))
scstc &= ~(STCgshared | STCshared | STCtls);
if (stc & (STCsafe | STCtrusted | STCsystem))
scstc &= ~(STCsafe | STCtrusted | STCsystem);
if (stc & (STC.auto_ | STC.scope_ | STC.static_ | STC.extern_ | STC.manifest))
scstc &= ~(STC.auto_ | STC.scope_ | STC.static_ | STC.extern_ | STC.manifest);
if (stc & (STC.auto_ | STC.scope_ | STC.static_ | STC.tls | STC.manifest | STC.gshared))
scstc &= ~(STC.auto_ | STC.scope_ | STC.static_ | STC.tls | STC.manifest | STC.gshared);
if (stc & (STC.const_ | STC.immutable_ | STC.manifest))
scstc &= ~(STC.const_ | STC.immutable_ | STC.manifest);
if (stc & (STC.gshared | STC.shared_ | STC.tls))
scstc &= ~(STC.gshared | STC.shared_ | STC.tls);
if (stc & (STC.safe | STC.trusted | STC.system))
scstc &= ~(STC.safe | STC.trusted | STC.system);
scstc |= stc;
//printf("scstc = x%llx\n", scstc);
return createNewScope(sc, scstc, sc.linkage, sc.cppmangle,
Expand Down Expand Up @@ -349,13 +349,13 @@ extern (C++) class StorageClassDeclaration : AttribDeclaration
{
Dsymbol s = (*d)[i];
//printf("\taddMember %s to %s\n", s.toChars(), sds.toChars());
// STClocal needs to be attached before the member is added to the scope (because it influences the parent symbol)
// STC.local needs to be attached before the member is added to the scope (because it influences the parent symbol)
if (auto decl = s.isDeclaration())
{
decl.storage_class |= stc & STClocal;
decl.storage_class |= stc & STC.local;
if (auto sdecl = s.isStorageClassDeclaration()) // TODO: why is this not enough to deal with the nested case?
{
sdecl.stc |= stc & STClocal;
sdecl.stc |= stc & STC.local;
}
}
s.addMember(sc2, sds);
Expand Down Expand Up @@ -386,7 +386,7 @@ extern (C++) final class DeprecatedDeclaration : StorageClassDeclaration

extern (D) this(Expression msg, Dsymbols* decl)
{
super(STCdeprecated, decl);
super(STC.deprecated_, decl);
this.msg = msg;
}

Expand All @@ -397,7 +397,7 @@ extern (C++) final class DeprecatedDeclaration : StorageClassDeclaration
}

/**
* Provides a new scope with `STCdeprecated` and `Scope.depdecl` set
* Provides a new scope with `STC.deprecated_` and `Scope.depdecl` set
*
* Calls `StorageClassDeclaration.newScope` (as it must be called or copied
* in any function overriding `newScope`), then set the `Scope`'s depdecl.
Expand Down Expand Up @@ -1142,7 +1142,7 @@ extern (C++) final class StaticForeachDeclaration : AttribDeclaration
* another scope, like:
*
* static foreach (i; 0 .. 10) // loop variables for different indices do not conflict.
* { // this body is expanded into 10 ForwardingAttribDeclarations, where `i` has storage class STClocal
* { // this body is expanded into 10 ForwardingAttribDeclarations, where `i` has storage class STC.local
* mixin("enum x" ~ to!string(i) ~ " = i"); // ok, can access current loop variable
* }
*
Expand Down
4 changes: 2 additions & 2 deletions src/dmd/blockexit.d
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ int blockExit(Statement s, FuncDeclaration func, bool mustNotThrow)
{
// Assume the worst
result = BE.fallthru | BE.return_ | BE.goto_ | BE.halt;
if (!(s.stc & STCnothrow))
if (!(s.stc & STC.nothrow_))
{
if (mustNotThrow && !(s.stc & STCnothrow))
if (mustNotThrow && !(s.stc & STC.nothrow_))
s.deprecation("asm statement is assumed to throw - mark it with `nothrow` if it does not");
else
result |= BE.throw_;
Expand Down
4 changes: 2 additions & 2 deletions src/dmd/canthrow.d
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ private bool Dsymbol_canThrow(Dsymbol s, FuncDeclaration func, bool mustNotThrow
s = s.toAlias();
if (s != vd)
return Dsymbol_canThrow(s, func, mustNotThrow);
if (vd.storage_class & STCmanifest)
if (vd.storage_class & STC.manifest)
{
}
else if (vd.isStatic() || vd.storage_class & (STCextern | STCtls | STCgshared))
else if (vd.isStatic() || vd.storage_class & (STC.extern_ | STC.tls | STC.gshared))
{
}
else
Expand Down
Loading