AggregateDeclaration

Abstract aggregate as a common ancestor for Class- and StructDeclaration.

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.

nonHiddenFields
size_t nonHiddenFields()
searchCtor
Dsymbol searchCtor()

Look for constructor declaration.

setDeprecated
void setDeprecated()

Flag this aggregate as deprecated

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

Variables

aggNew
NewDeclaration aggNew;

allocator

aliasthis
AliasThis aliasthis;

forward unresolved lookups to aliasthis

alignsize
uint alignsize;

size of struct for alignment purposes

classKind
ClassKind classKind;

specifies whether this is a D, C++, Objective-C or anonymous struct/class/interface

cppmangle
CPPMANGLE cppmangle;

Specify whether to mangle the aggregate as a class or a struct This information is used by the MSVC mangler Only valid for class and struct. TODO: Merge with ClassKind ?

ctor
Dsymbol ctor;

CtorDeclaration or TemplateDeclaration

defaultCtor
CtorDeclaration defaultCtor;

default constructor - should have no arguments, because it would be stored in TypeInfo_Class.defaultConstructor

deferred
Dsymbol deferred;

any deferred semantic2() or semantic3() symbol

dtor
DtorDeclaration dtor;

aggregate destructor calling dtors and member constructors

dtors
DtorDeclarations dtors;

Array of destructors

enclosing
Dsymbol enclosing;

!=null if is nested pointing to the dsymbol that directly enclosing it. 1. The function that enclosing it (nested struct and class) 2. The class that enclosing it (nested class only) 3. If enclosing aggregate is template, its enclosing dsymbol.

fieldDtor
FuncDeclaration fieldDtor;

aggregate destructor for just the fields

fields
VarDeclarations fields;

VarDeclaration fields

getRTInfo
Expression getRTInfo;

pointer to GC info generated by object.RTInfo(this)

inv
FuncDeclaration inv;

Merged invariant calling all members of invs

invs
FuncDeclarations invs;

Array of invariants

mangleOverride
MangleOverride* mangleOverride;

overridden symbol with pragma(mangle, "...") if not null

noDefaultCtor
bool noDefaultCtor;

no default construction

primaryDtor
DtorDeclaration primaryDtor;

non-deleting C++ destructor, same as dtor for D

sinit
Symbol* sinit;

initializer symbol

sizeok
Sizeok sizeok;

set when structsize contains valid data

stag
Symbol* stag;

tag symbol for debug data

storage_class
StorageClass storage_class;
structsize
uint structsize;

size of struct

tidtor
DtorDeclaration tidtor;

aggregate destructor used in TypeInfo (must have extern(D) ABI)

type
Type type;
visibility
Visibility visibility;
vthis
VarDeclaration vthis;

'this' parameter if this aggregate is nested

vthis2
VarDeclaration vthis2;

'this' parameter if this aggregate is a template and is nested

Inherited Members

From ScopeDsymbol

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

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

symtabLookup
Dsymbol symtabLookup(Dsymbol s, Identifier id)

Look up identifier in symbol table.

hasStaticCtorOrDtor
bool hasStaticCtorOrDtor()

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

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

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.

Suggestion Box / Bug Report