Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
ddmd.aggregate
Compiler implementation of the
D programming language.
Authors:
License:
Source: aggregate.d
- abstract class
AggregateDeclaration: ddmd.dsymbol.ScopeDsymbol; -
- Scope*
newScope(Scope*sc); - Create a new scope from
sc. semantic, semantic2 and semantic3 will use this for aggregate members. - final bool
determineFields(); - Find all instance fields, then push them into fields.Runs semantic() for all instance field variables, but also the field types can reamin yet not resolved forward references, except direct recursive definitions. After the process sizeok is set to SIZEOKfwd.Returns:
falseif any errors occur. - final bool
determineSize(Locloc); - Collect all instance fields, then determine instance size.Returns:
falseif failed to determine the size. - final bool
checkOverlappedFields(); - Calculate field[i].overlapped and overlapUnsafe, and check that all of explicit field initializers have unique memory space on instance.Returns:
trueif any errors happen. - final bool
fill(Locloc, Expressions*elements, boolctorinit); - Fill out remainder of
elements[] with default initializers for fields[].Parameters:Loc loclocation Expressions* elementsexplicit arguments which given to construct object. bool ctorinittrueif theelementswill be used for default initialization.Returns:falseif any errors occur. Otherwise, returnstrueand the missing arguments will be pushed inelements[]. - static void
alignmember(structalign_talignment, uintsize, uint*poffset); - Do byte or word
alignmentas necessary. Align sizes of 0, as we may not know array sizes yet.alignment: struct
alignmentthat is in effectsize:
alignmentrequirement of field - static uint
placeField(uint*nextoffset, uintmemsize, uintmemalignsize, structalign_talignment, uint*paggsize, uint*paggalignsize, boolisunion); - Place a member (mem) into an aggregate (agg), which can be a struct, union or classReturns:offset to place field at
nextoffset: next location in aggregate
memsize: size of member
memalignsize: natural
alignmentof memberalignment:
alignmentin effect for this memberpaggsize: size of aggregate (updated)
paggalignsize:
alignmentof aggregate (updated)isunion: the aggregate is a union
- final bool
isNested(); - Returns
trueif there's an extra member which is the 'this' pointer to the enclosing context (enclosing aggregate or function) - final Dsymbol
searchCtor(); - Look for constructor declaration.
Copyright © 1999-2017 by the D Language Foundation | Page generated by
Ddoc on (no date time)