FuncDeclaration

extern (C++)
class FuncDeclaration : Declaration {}

Constructors

this
this(Loc loc, Loc endloc, Identifier id, StorageClass storage_class, Type type)
Undocumented in source.

Members

Functions

accept
void accept(Visitor v)
Undocumented in source. Be warned that the author may not have intended to support it.
addPostInvariant
bool addPostInvariant()
Undocumented in source. Be warned that the author may not have intended to support it.
addPreInvariant
bool addPreInvariant()
Undocumented in source. Be warned that the author may not have intended to support it.
buildResultVar
void buildResultVar(Scope* sc, Type tret)

Declare result variable lazily.

checkClosure
bool checkClosure()

Check that the function contains any closure. If it's @nogc, report suitable errors. This is mostly consistent with FuncDeclaration::needsClosure().

checkForwardRef
bool checkForwardRef(Loc loc)

Check that this function type is properly resolved. If not, report "forward reference error" and return true.

checkNestedReference
bool checkNestedReference(Scope* sc, Loc loc)

In the current function, we are calling 'this' function. 1. Check to see if the current function can call 'this' function, issue error if not. 2. If the current function is not the parent of 'this' function, then add the current function to the list of siblings of 'this' function. 3. If the current function is a literal, and it's accessing an uplevel scope, then mark it as a delegate. Returns true if error occurs.

declareThis
VarDeclaration declareThis(Scope* sc, AggregateDeclaration ad)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(RootObject o)
Undocumented in source. Be warned that the author may not have intended to support it.
findTemplateDeclRoot
TemplateDeclaration findTemplateDeclRoot()

find function template root in overload list

findVtblIndex
int findVtblIndex(Dsymbols* vtbl, int dim)

Find index of function in vtbl[0..dim] that this function overrides. Prefer an exact match to a covariant one.

functionSemantic
bool functionSemantic()

Resolve forward reference of function signature - parameter types, return type, and attributes. Returns false if any errors exist in the signature.

functionSemantic3
bool functionSemantic3()

Resolve forward reference of function body. Returns false if any errors exist in the body.

getLevel
int getLevel(Loc loc, Scope* sc, FuncDeclaration fd)

Determine lexical level difference from 'this' to nested function 'fd'. Error if this cannot call fd.

getParameters
Parameters* getParameters(int* pvarargs)

Return the function's parameter list, and whether it is variadic or not.

hasNestedFrameRefs
bool hasNestedFrameRefs()

Determine if function's variables are referenced by a function nested within it.

inUnittest
bool inUnittest()

Returns true if function was declared directly or indirectly in a unittest block

isCMain
bool isCMain()
Undocumented in source. Be warned that the author may not have intended to support it.
isCodeseg
bool isCodeseg()
Undocumented in source. Be warned that the author may not have intended to support it.
isDllMain
bool isDllMain()
Undocumented in source. Be warned that the author may not have intended to support it.
isExport
bool isExport()
Undocumented in source. Be warned that the author may not have intended to support it.
isFinalFunc
bool isFinalFunc()
Undocumented in source. Be warned that the author may not have intended to support it.
isFuncDeclaration
inout(FuncDeclaration) isFuncDeclaration()
Undocumented in source. Be warned that the author may not have intended to support it.
isImportedSymbol
bool isImportedSymbol()
Undocumented in source. Be warned that the author may not have intended to support it.
isMain
bool isMain()
Undocumented in source. Be warned that the author may not have intended to support it.
isNested
bool isNested()

Determine if function needs a static frame pointer.

isNogc
bool isNogc()
Undocumented in source. Be warned that the author may not have intended to support it.
isNogcBypassingInference
bool isNogcBypassingInference()
Undocumented in source. Be warned that the author may not have intended to support it.
isOverloadable
bool isOverloadable()
Undocumented in source. Be warned that the author may not have intended to support it.
isPure
PURE isPure()
Undocumented in source. Be warned that the author may not have intended to support it.
isPureBypassingInference
PURE isPureBypassingInference()
Undocumented in source. Be warned that the author may not have intended to support it.
isSafe
bool isSafe()
Undocumented in source. Be warned that the author may not have intended to support it.
isSafeBypassingInference
bool isSafeBypassingInference()
Undocumented in source. Be warned that the author may not have intended to support it.
isThis
AggregateDeclaration isThis()

Determine if function is a non-static member function that has an implicit 'this' expression.

isTrusted
bool isTrusted()
Undocumented in source. Be warned that the author may not have intended to support it.
isUnique
FuncDeclaration isUnique()

If there are no overloads of function f, return that function, otherwise return NULL.

isVirtual
bool isVirtual()
Undocumented in source. Be warned that the author may not have intended to support it.
isVirtualMethod
bool isVirtualMethod()
Undocumented in source. Be warned that the author may not have intended to support it.
isWinMain
bool isWinMain()
Undocumented in source. Be warned that the author may not have intended to support it.
isolateReturn
bool isolateReturn()

Returns true if the function return value has no indirection which comes from the parameters.

kind
const(char)* kind()
Undocumented in source. Be warned that the author may not have intended to support it.
leastAsSpecialized
MATCH leastAsSpecialized(FuncDeclaration g)

Determine partial specialization order of 'this' vs g. This is very similar to TemplateDeclaration::leastAsSpecialized().

mergeFensure
Statement mergeFensure(Statement sf, Identifier oid)

Merge into this function the 'out' contracts of all it overrides. 'out's are AND'd together, i.e. all of them need to pass.

mergeFrequire
Statement mergeFrequire(Statement sf)

Merge into this function the 'in' contracts of all it overrides. 'in's are OR'd together, i.e. only one of them needs to pass.

needThis
bool needThis()
Undocumented in source. Be warned that the author may not have intended to support it.
needsClosure
bool needsClosure()

Look at all the variables in this function that are referenced by nested functions, and determine if a closure needs to be created for them.

overloadExactMatch
FuncDeclaration overloadExactMatch(Type t)

Find function in overload list that exactly matches t.

overloadInsert
bool overloadInsert(Dsymbol s)

Overload this FuncDeclaration with the new one f. Return true if successful; i.e. no conflict.

overloadModMatch
FuncDeclaration overloadModMatch(Loc loc, Type tthis, bool hasOverloads)

Find function in overload list that matches to the 'this' modifier. There's four result types.

overrideInterface
BaseClass* overrideInterface()

If function a function in a base class, return that base class.

overrides
int overrides(FuncDeclaration fd)

Determine if 'this' overrides fd. Return !=0 if it does.

parametersIntersect
bool parametersIntersect(Type t)

Returns true if an object typed t can have indirections which come from the parameters.

printGCUsage
void printGCUsage(Loc loc, const(char)* warn)
Undocumented in source. Be warned that the author may not have intended to support it.
searchLabel
LabelDsymbol searchLabel(Identifier ident)

Labels are in a separate scope, one per function.

semantic
void semantic(Scope* sc)
Undocumented in source. Be warned that the author may not have intended to support it.
semantic2
void semantic2(Scope* sc)
Undocumented in source. Be warned that the author may not have intended to support it.
semantic3
void semantic3(Scope* sc)
Undocumented in source. Be warned that the author may not have intended to support it.
setGC
bool setGC()

The function is doing something that may allocate with the GC, so mark it as not nogc (not no-how).

setImpure
bool setImpure()

The function is doing something impure, so mark it as impure. If there's a purity error, return true.

setUnsafe
bool setUnsafe()

The function is doing something unsave, so mark it as unsafe. If there's a safe error, return true.

syntaxCopy
Dsymbol syntaxCopy(Dsymbol s)
Undocumented in source. Be warned that the author may not have intended to support it.
toAliasFunc
FuncDeclaration toAliasFunc()
Undocumented in source. Be warned that the author may not have intended to support it.
toFullSignature
const(char)* toFullSignature()

for diagnostics, e.g. 'int foo(int x, int y) pure'

toPrettyChars
const(char)* toPrettyChars(bool QualifyTypes)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

genCfunc
FuncDeclaration genCfunc(Parameters* fparams, Type treturn, const(char)* name, StorageClass stc)

Generate a FuncDeclaration for a runtime library function.

genCfunc
FuncDeclaration genCfunc(Parameters* fparams, Type treturn, Identifier id, StorageClass stc)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

builtin
BUILTIN builtin;
Undocumented in source.
closureVars
VarDeclarations closureVars;
Undocumented in source.
ctfeCode
CompiledCtfeFunction* ctfeCode;
Undocumented in source.
endloc
Loc endloc;
Undocumented in source.
fbody
Statement fbody;
Undocumented in source.
fdensure
FuncDeclaration fdensure;
Undocumented in source.
fdrequire
FuncDeclaration fdrequire;
Undocumented in source.
fensure
Statement fensure;
Undocumented in source.
fes
ForeachStatement fes;
Undocumented in source.
flags
uint flags;
Undocumented in source.
foverrides
FuncDeclarations foverrides;
Undocumented in source.
frequire
Statement frequire;
Undocumented in source.
fthrows
Types* fthrows;
Undocumented in source.
generated
bool generated;
Undocumented in source.
gotos
GotoStatements* gotos;
Undocumented in source.
hasReturnExp
int hasReturnExp;
Undocumented in source.
inferRetType
bool inferRetType;
Undocumented in source.
inlineNest
int inlineNest;
Undocumented in source.
inlineStatusExp
ILS inlineStatusExp;
Undocumented in source.
inlineStatusStmt
ILS inlineStatusStmt;
Undocumented in source.
inlinedNestedCallees
FuncDeclarations* inlinedNestedCallees;
Undocumented in source.
inlining
PINLINE inlining;
Undocumented in source.
interfaceVirtual
BaseClass* interfaceVirtual;
Undocumented in source.
introducing
bool introducing;
Undocumented in source.
isArrayOp
bool isArrayOp;
Undocumented in source.
labtab
DsymbolTable labtab;
Undocumented in source.
localsymtab
DsymbolTable localsymtab;
Undocumented in source.
mangleString
const(char)* mangleString;
Undocumented in source.
naked
bool naked;
Undocumented in source.
nrvo_can
bool nrvo_can;
Undocumented in source.
nrvo_var
VarDeclaration nrvo_var;
Undocumented in source.
objc
Objc_FuncDeclaration objc;
Undocumented in source.
outId
Identifier outId;
Undocumented in source.
overnext
Dsymbol overnext;
Undocumented in source.
overnext0
FuncDeclaration overnext0;
Undocumented in source.
parameters
VarDeclarations* parameters;
Undocumented in source.
requiresClosure
bool requiresClosure;
Undocumented in source.
returnLabel
LabelDsymbol returnLabel;
Undocumented in source.
returns
ReturnStatements* returns;
Undocumented in source.
semantic3Errors
bool semantic3Errors;
Undocumented in source.
shidden
Symbol* shidden;
Undocumented in source.
siblingCallers
FuncDeclarations siblingCallers;
Undocumented in source.
storage_class2
StorageClass storage_class2;
Undocumented in source.
tintro
Type tintro;
Undocumented in source.
tookAddressOf
int tookAddressOf;
Undocumented in source.
v_argptr
VarDeclaration v_argptr;
Undocumented in source.
v_arguments
VarDeclaration v_arguments;
Undocumented in source.
vresult
VarDeclaration vresult;
Undocumented in source.
vtblIndex
int vtblIndex;
Undocumented in source.
vthis
VarDeclaration vthis;
Undocumented in source.

Inherited Members

From Declaration

type
Type type;
Undocumented in source.
originalType
Type originalType;
Undocumented in source.
storage_class
StorageClass storage_class;
Undocumented in source.
protection
Prot protection;
Undocumented in source.
linkage
LINK linkage;
Undocumented in source.
inuse
int inuse;
Undocumented in source.
mangleOverride
const(char)* mangleOverride;
Undocumented in source.
semantic
void semantic(Scope* sc)
Undocumented in source. Be warned that the author may not have intended to support it.
kind
const(char)* kind()
Undocumented in source. Be warned that the author may not have intended to support it.
size
d_uns64 size(Loc loc)
Undocumented in source. Be warned that the author may not have intended to support it.
checkModify
int checkModify(Loc loc, Scope* sc, Type t, Expression e1, int flag)

Check to see if declaration can be modified in this context (sc). Issue error if not.

search
Dsymbol search(Loc loc, Identifier ident, int flags)
Undocumented in source. Be warned that the author may not have intended to support it.
isStatic
bool isStatic()
Undocumented in source. Be warned that the author may not have intended to support it.
isDelete
bool isDelete()
Undocumented in source. Be warned that the author may not have intended to support it.
isDataseg
bool isDataseg()
Undocumented in source. Be warned that the author may not have intended to support it.
isThreadlocal
bool isThreadlocal()
Undocumented in source. Be warned that the author may not have intended to support it.
isCodeseg
bool isCodeseg()
Undocumented in source. Be warned that the author may not have intended to support it.
isCtorinit
bool isCtorinit()
Undocumented in source. Be warned that the author may not have intended to support it.
isFinal
bool isFinal()
Undocumented in source. Be warned that the author may not have intended to support it.
isAbstract
bool isAbstract()
Undocumented in source. Be warned that the author may not have intended to support it.
isConst
bool isConst()
Undocumented in source. Be warned that the author may not have intended to support it.
isImmutable
bool isImmutable()
Undocumented in source. Be warned that the author may not have intended to support it.
isWild
bool isWild()
Undocumented in source. Be warned that the author may not have intended to support it.
isAuto
bool isAuto()
Undocumented in source. Be warned that the author may not have intended to support it.
isScope
bool isScope()
Undocumented in source. Be warned that the author may not have intended to support it.
isSynchronized
bool isSynchronized()
Undocumented in source. Be warned that the author may not have intended to support it.
isParameter
bool isParameter()
Undocumented in source. Be warned that the author may not have intended to support it.
isDeprecated
bool isDeprecated()
Undocumented in source. Be warned that the author may not have intended to support it.
isOverride
bool isOverride()
Undocumented in source. Be warned that the author may not have intended to support it.
isResult
bool isResult()
Undocumented in source. Be warned that the author may not have intended to support it.
isField
bool isField()
Undocumented in source. Be warned that the author may not have intended to support it.
isIn
bool isIn()
Undocumented in source. Be warned that the author may not have intended to support it.
isOut
bool isOut()
Undocumented in source. Be warned that the author may not have intended to support it.
isRef
bool isRef()
Undocumented in source. Be warned that the author may not have intended to support it.
prot
Prot prot()
Undocumented in source. Be warned that the author may not have intended to support it.
isDeclaration
inout(Declaration) isDeclaration()
Undocumented in source. Be warned that the author may not have intended to support it.
accept
void accept(Visitor v)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta