Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

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 usinga local clone.

dmd.dsymbolsem

Does the semantic 1 pass on the AST, which looks at symbol declarations but not initializers or function bodies.
Authors:
Walter Bright
License:
Boost License 1.0

Sourcedsymbolsem.d

Documentationhttps://dlang.org/phobos/dmd_dsymbolsem.html

Coveragehttps://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/dsymbolsem.d

voiddsymbolSemantic(Dsymboldsym, Scope*sc);
Does semantic analysis on the public face of declarations.
voidaddDeferredSemantic(Dsymbols);
Can't run semantic on s now, try again later.
voidrunDeferredSemantic();
Run semantic() on deferred symbols.
uinteger_tsize(Dsymbol_this, Locloc);
Returns:
SIZE_INVALID when the size cannot be determined
AlignDeclarationgetAlignment(AlignDeclarationad, Scope*sc);
Determine the numerical value of the AlignmentDeclaration
Parameters:
AlignDeclarationadAlignmentDeclaration
Scope*sccontext
Returns:
ad with alignment value determined
DsymboltoAlias2(Dsymbols);
Resolve recursive tuple expansion in eponymous template.
DsymboltoAlias(Dsymbols);
If this symbol is really an alias for another, return that other. If needed, semantic() is invoked due to resolve forward reference.
boolisPOD(StructDeclarationsd);
Determine if struct is POD (Plain Old Data).
POD is defined as:
  1. not nested
  2. no postblits, destructors, or assignment operators
  3. noref fields or fields that are themselves non-POD
The idea being these are compatible with C structs.
Returns:
true if struct is POD
boolfillVtbl(BaseClass*bc, ClassDeclarationcd, FuncDeclarations*vtbl, intnewinstance);
Fill in vtbl[] for base class based on member functions of class cd.

Inputbc BaseClass vtbl if !=NULL, fill it in newinstance !=0 means all entries must be filled in by members of cd, not members of any base classes of cd.

Returns:
true if any entries were filled in by members of cd (not exclusively by base classes)
boolisRvalueConstructor(StructDeclarationsd, CtorDeclarationctor);
Check if ctor is an rvalue constructor. A constructor that receives a single parameter of the same type asUnqual!typeof(this) is an rvalue constructor.
Parameters:
StructDeclarationsdstruct that ctor is a member of
CtorDeclarationctorconstructor to test
Returns:
true if it is an rvalue constructor
ExpressionresolveAliasThis(Scope*sc, Expressione, boolgag = false, boolfindOnly = false);
Find thealias this symbol of e's type.
Parameters:
Scope*sccontext
Expressioneexpression forming thethis
boolgagdo not print errors, returnnull instead
boolfindOnlydon't do further processing like resolving properties, i.e. just return plain dotExp() result.
Returns:
Expression that ise.aliasthis
voidaddEnumMembersToSymtab(EnumDeclarationed, Scope*sc, ScopeDsymbolsds);
Add members of EnumDeclaration to the symbol table(s).
Parameters:
EnumDeclarationedEnumDeclaration
Scope*sccontext ofed
ScopeDsymbolsdssymbol table thated resides in
boolfollowInstantiationContext(Dsymbold, Dsymbolp1, Dsymbolp2 = null);
Returns true if any of the symbolsp1 orp2 resides in the enclosing instantiation scope ofthis.
DsymboltoParentP(Dsymbold, Dsymbolp1, Dsymbolp2 = null);
Returns the declaration scope scope ofthis unless any of the symbolsp1 orp2 resides in its enclosing instantiation scope then the latter is returned.
intapply(Dsymbolsymbol, int function(Dsymbol, void*)fp, void*ctx);
Iterate this dsymbol or members of this scoped dsymbol, then callfp with the found symbol andparams.
Parameters:
Dsymbolsymbolthe dsymbol or parent of members to call fp on
int function(Dsymbol, void*)fpfunction pointer to process the iterated symbol. If it returns nonzero, the iteration will be aborted.
void*ctxcontext parameter passed to fp.
Returns:
nonzero if the iteration is aborted by the return value of fp, or 0 if it's completed.
booldetermineFields(AggregateDeclarationad);
Find all instance fields inad, then push them intofields.
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:
AggregateDeclarationadthe AggregateDeclaration to examine
Returns:
false if any errors occur.
ModuleloadCoreStdcConfig();
A Singleton that loads core.stdc.config
Returns:
Module of core.stdc.config, null if couldn't find it
ModuleloadStdMath();
A Singleton that loads std.math
Returns:
Module of std.math, null if couldn't find it
voidadjustLocForMixin(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)[]inputmixin text
Locloclocation of expansion
BaseLocbaseLoclocation to adjust
OutputmixinOutsink for mixin text data
Returns:
adjusted loc suitable for Parser
Dsymbolsearch(Dsymbold, Locloc, Identifierident, SearchOptFlagsflags = SearchOpt.all);
Search for ident as member of d.
Parameters:
Dsymbolddsymbol where ident is searched for
Locloclocation to print for error messages
Identifieridentidentifier to search for
SearchOptFlagsflagssearch options
Returns:
null if not found
voidsetScope(Dsymbold, Scope*sc);
Set scope for future semantic analysis so we can deal better with forward references.
Parameters:
Dsymbolddsymbol for which the scope is set
Scope*scscope that is used to set the value
boolload(Importimp, Scope*sc);
Load module.
Returns:
true for errors, false for success
voidcheckGNUABITag(Dsymbolsym, LINKlinkage);
Called from a symbol's semantic to check ifgnuAbiTag UDA can be applied to them
Directly emits an error if the UDA doesn't work with this symbol
Parameters:
Dsymbolsymsymbol to check forgnuAbiTag
LINKlinkageLinkage of the symbol (Declaration.link or sc.link)
boolisGNUABITag(Expressione);
Check if the provided expression referencescore.attribute.gnuAbiTag
This should be called after semantic has been run on the expression. Semantic on UDA happens in semantic2 (seedmd.semantic2).
Parameters:
ExpressioneExpression to check (usually fromUserAttributeDeclaration.atts)
Returns:
true if the expression references the compiler-recognizedgnuAbiTag
booldetermineSize(AggregateDeclarationad, Locloc);
Collect all instance fields, then determine instance size.
Returns:
false if failed to determine the size.
booloneMember(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
boolhasStaticCtorOrDtor(Dsymbold);
Return true if any of the members are static ctors or static dtors, or if any members have members that are.
bool_isZeroInit(Expressionexp);
Determine if exp is all binary zeros.
Parameters:
Expressionexpexpression to check
Returns:
true if it's all binary 0
boolhasPointers(Dsymbold);
Is Dsymbol a variable that contains pointers?
int_foreach(Scope*sc, Dsymbols*members, scope ForeachDgdg, 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.
Returns:
last value returned by dg()
voidgetLocalClasses(Modulemod, ref ClassDeclarationsaclasses);
Create array of the local classes in the Module, suitable for inclusion in ModuleInfo
Parameters:
Modulemodthe Module
ClassDeclarationsaclassesarray to fill in
Returns:
array of local classes
booloneMembers(Dsymbols*members, out Dsymbolps, Identifierident);
Same as Dsymbol::oneMember(), but look at an array of Dsymbols.
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Sat Feb 21 00:04:56 2026

[8]ページ先頭

©2009-2026 Movatter.jp