AggregateDeclaration

extern (C++) abstract
class AggregateDeclaration : ScopeDsymbol {
Type type;
StorageClass storage_class;
Prot protection;
uint structsize;
uint alignsize;
VarDeclarations fields;
Sizeok sizeok;
Dsymbol deferred;
bool isdeprecated;
Dsymbol enclosing;
VarDeclaration vthis;
FuncDeclarations invs;
FuncDeclaration inv;
NewDeclaration aggNew;
DeleteDeclaration aggDelete;
Dsymbol ctor;
CtorDeclaration defaultCtor;
Dsymbol aliasthis;
bool noDefaultCtor;
FuncDeclarations dtors;
FuncDeclaration dtor;
Expression getRTInfo;
Symbol* stag;
Symbol* sinit;
}

Members

Functions

checkOverlappedFields
bool checkOverlappedFields()

Calculate fieldi.overlapped and overlapUnsafe, and check that all of explicit field initializers have unique memory space on instance.

determineFields
bool determineFields()

Find all instance fields, then push them into fields.

determineSize
bool determineSize(Loc loc)

Collect all instance fields, then determine instance size.

fill
bool fill(Loc loc, Expressions* elements, bool ctorinit)

Fill out remainder of elements[] with default initializers for fields[].

isNested
bool isNested()

Returns true if there's an extra member which is the 'this' pointer to the enclosing context (enclosing aggregate or function)

newScope
Scope* newScope(Scope* sc)

Create a new scope from sc. semantic, semantic2 and semantic3 will use this for aggregate members.

searchCtor
Dsymbol searchCtor()

Look for constructor declaration.

Static functions

alignmember
void alignmember(structalign_t alignment, uint size, uint* poffset)

Do byte or word alignment as necessary. Align sizes of 0, as we may not know array sizes yet.

placeField
uint placeField(uint* nextoffset, uint memsize, uint memalignsize, structalign_t alignment, uint* paggsize, uint* paggalignsize, bool isunion)

Place a member (mem) into an aggregate (agg), which can be a struct, union or class

Inherited Members

From ScopeDsymbol

search
Dsymbol search(Loc loc, Identifier ident, int flags = SearchLocalsOnly)

This function is #1 on the list of functions that eat cpu time. Be very, very careful about slowing it down.

findGetMembers
FuncDeclaration findGetMembers()

Look for member of the form: const(MemberInfo)[] getMembers(string); Returns NULL if not found

hasStaticCtorOrDtor
bool hasStaticCtorOrDtor()

Return true if any of the members are static ctors or static dtors, or if any members have members that are.

dim
size_t dim(Dsymbols* members)

Determine number of Dsymbols, folding in AttribDeclaration members.

getNth
Dsymbol getNth(Dsymbols* members, size_t nth, size_t* pn = null)

Get nth Dsymbol, folding in AttribDeclaration members.

_foreach
int _foreach(Scope* sc, Dsymbols* members, scope ForeachDg dg, size_t* pn = null)

Expands attribute declarations in members in depth first order. Calls dg(size_t symidx, Dsymbol *sym) for each member. If dg returns !=0, stops and returns that value else returns 0. Use this function to avoid the O(N + N^2/2) complexity of calculating dim and calling N times getNth.

Meta