FunctionDecl¶
-
public final class
FunctionDecl
extends SymbolDecl¶ The specific SymbolTable entry for a function definition.
Fields¶
definitionSymbolTable¶
-
public SymbolTable
definitionSymbolTable
¶ symbolTable containing the principal FunctionDecl of this function. null corresponds to the rootSymbolTable.
formalArgRank¶
-
public int
formalArgRank
¶ for a formal parameter, its rank in the parameters list. From 1 up (special 0 for result).
initFunctionDecls¶
-
public FunctionDecl[]
initFunctionDecls
¶ When this is a “pointer-to-function” variable, holding a pointer to a function, holds the function it is given upon initialization.
Constructors¶
FunctionDecl¶
-
public
FunctionDecl
(Tree identTree, Unit unit, SymbolTable symbolTable)¶
Methods¶
argumentsTypesSpec¶
-
public WrapperTypeSpec[]
argumentsTypesSpec
()¶
declarationMatchesCall¶
-
public boolean
declarationMatchesCall
(TypeSpec callResultType, TypeSpec[] callArgTypes)¶ - Returns
true if this declaration of a function matches (i.e. can be called with) the types of the given actual arguments callArgTypes (and optionally matches the expected type of the result callResultType, although we are not sure it is reasonable to type-check on the result type?).
functionTypeSpec¶
-
public FunctionTypeSpec
functionTypeSpec
()¶
getDiffSymbolHolder¶
-
public NewSymbolHolder
getDiffSymbolHolder
(int diffSort, ActivityPattern pattern, int replica)¶ - Returns
the NewSymbolHolder that has been stored by setDiffSymbolHolder() as the differentiated symbol of this SymbolDecl, for the given diffSort and for the given pattern.
isTarget¶
-
public boolean
isTarget
(WrapperTypeSpec modelTypeSpec)¶
replaceDiffSymbolHolder¶
-
protected void
replaceDiffSymbolHolder
(NewSymbolHolder oldNSH, NewSymbolHolder newNSH)¶ For every NewSymbolHolder that is stored in this SymbolDecl (in provision of the moment when this Symboldecl will receive its finalname), replace it with newNSH if it was oldNSH. This is used when oldNSH is absorbed by newNSH.
returnTypeSpec¶
-
public WrapperTypeSpec
returnTypeSpec
()¶
sameTypes¶
-
public boolean
sameTypes
(WrapperTypeSpec otherReturnType, WrapperTypeSpec[] otherArgumentsTypes)¶
setDiffSymbolHolder¶
-
public void
setDiffSymbolHolder
(int diffSort, ActivityPattern pattern, int replica, NewSymbolHolder nSH)¶ Puts the NewSymbolHolder “nSH” as the differentiated symbol of this FunctionDecl, for the given diffSort and for the given ActivityPattern. “diffSort” is here because there may be different coexisting derivative symbols for a given original symbol, for example F_FWD, F_BWD, F_B for a given function F. “pattern” is used here only for functions, that may have several different coexisting derivatives, one per calling ActivityPattern. “replica” is not used, it is only for VariableDecl’s.
type¶
-
public WrapperTypeSpec
type
()¶