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.
dmd.dsymbolsem
Does the semantic 1 pass on the AST, which looks at symbol declarations but not initializers
or function bodies.
Authors:
License:
Source dsymbolsem.d
Documentation https://dlang.org/phobos/dmd_dsymbolsem.html
- void
dsymbolSemantic
(Dsymboldsym
, Scope*sc
); - Does semantic analysis on the public face of declarations.
- AlignDeclaration
getAlignment
(AlignDeclarationad
, Scope*sc
); - Determine the numerical value of the AlignmentDeclarationParameters:
AlignDeclaration ad
AlignmentDeclaration Scope* sc
context Returns:ad with alignment value determined - bool
isRvalueConstructor
(StructDeclarationsd
, CtorDeclarationctor
); - Check if ctor is an rvalue constructor. A constructor that receives a single parameter of the same type as Unqual!typeof(this) is an rvalue constructor.Parameters:
StructDeclaration sd
struct that ctor is a member of CtorDeclaration ctor
constructor to test Returns:true if it is an rvalue constructor - Expression
resolveAliasThis
(Scope*sc
, Expressione
, boolgag
= false, boolfindOnly
= false); - Find the alias this symbol of e's type.Parameters:
Scope* sc
context Expression e
expression forming the this bool gag
do not print errors, return null instead bool findOnly
don't do further processing like resolving properties, i.e. just return plain dotExp() result. Returns:Expression that ise
.aliasthis - void
addEnumMembersToSymtab
(EnumDeclarationed
, Scope*sc
, ScopeDsymbolsds
); - Add members of EnumDeclaration to the symbol table(s).Parameters:
EnumDeclaration ed
EnumDeclaration Scope* sc
context of ed
ScopeDsymbol sds
symbol table that ed
resides in - bool
determineFields
(AggregateDeclarationad
); - Find all instance fields in
ad
, then push them into fields.Runs semantic() for all instance field variables, but also the field types can remain yet not resolved forward references, except direct recursive definitions. After the process sizeok is set to Sizeok.fwd.Parameters:AggregateDeclaration ad
the AggregateDeclaration to examine Returns:false if any errors occur. - void
adjustLocForMixin
(const(char)[]input
, Locloc
, ref BaseLocbaseLoc
, ref OutputmixinOut
); - Set up loc for a parse of a mixin. Append the input text to the mixin.Parameters:
const(char)[] input
mixin text Loc loc
location of expansion BaseLoc baseLoc
location to adjust Output mixinOut
sink for mixin text data Returns:adjusted loc suitable for Parser - Dsymbol
search
(Dsymbold
, Locloc
, Identifierident
, SearchOptFlagsflags
= SearchOpt.all); - Search for ident as member of d.Parameters:
Dsymbol d
dsymbol where ident is searched for Loc loc
location to print for error messages Identifier ident
identifier to search for SearchOptFlags flags
search options Returns:null if not found - void
setScope
(Dsymbold
, Scope*sc
); - Set scope for future semantic analysis so we can deal better with forward references.Parameters:
Dsymbol d
dsymbol for which the scope is set Scope* sc
scope that is used to set the value - bool
load
(Importimp
, Scope*sc
); - Load module.Returns:true for errors, false for success
- void
checkGNUABITag
(Dsymbolsym
, LINKlinkage
); - Called from a symbol's semantic to check if gnuAbiTag UDA can be applied to themDirectly emits an error if the UDA doesn't work with this symbolParameters:
Dsymbol sym
symbol to check for gnuAbiTag LINK linkage
Linkage of the symbol (Declaration.link or sc.link) - bool
isGNUABITag
(Expressione
); - Check if the provided expression references core.attribute.gnuAbiTagThis should be called after semantic has been run on the expression. Semantic on UDA happens in semantic2 (see dmd.semantic2).Parameters:
Expression e
Expression to check (usually from UserAttributeDeclaration.atts) Returns:true if the expression references the compiler-recognized gnuAbiTag - bool
determineSize
(AggregateDeclarationad
, Locloc
); - Collect all instance fields, then determine instance size.Returns:false if failed to determine the size.
- bool
oneMember
(Dsymbold
, out Dsymbolps
, Identifierident
); - Determine if this symbol is only one.Returns:false, ps = null: There are 2 or more symbols true, ps = null: There are zero symbols true, ps = symbol: The one and only one symbol
- bool
hasStaticCtorOrDtor
(Dsymbold
); - Return true if any of the members are static ctors or static dtors, or if any members have members that are.
Copyright © 1999-2025 by the D Language Foundation | Page generated by
Ddoc on Sun Apr 13 05:29:08 2025