Previous:Function Basics, Up:Functions [Contents][Index]
To determine the scope of a function, you can use theDECL_CONTEXT macro. This macro will return the class(either aRECORD_TYPE or aUNION_TYPE) or namespace (aNAMESPACE_DECL) of which the function is a member. For a virtualfunction, this macro returns the class in which the function wasactually defined, not the base class in which the virtual declarationoccurred.
In C, theDECL_CONTEXT for a function maybe another function.This representation indicates that the GNU nested function extensionis in use. For details on the semantics of nested functions, see theGCC Manual. The nested function can refer to local variables in itscontaining function. Such references are not explicitly marked in thetree structure; back ends must look at theDECL_CONTEXT for thereferencedVAR_DECL. If theDECL_CONTEXT for thereferencedVAR_DECL is not the same as the function currentlybeing processed, and neitherDECL_EXTERNAL norTREE_STATIC hold, then the reference is to a local variable ina containing function, and the back end must take appropriate action.
DECL_EXTERNAL ¶This predicate holds if the function is undefined.
TREE_PUBLIC ¶This predicate holds if the function has external linkage.
TREE_STATIC ¶This predicate holds if the function has been defined.
TREE_THIS_VOLATILE ¶This predicate holds if the function does not return normally.
TREE_READONLY ¶This predicate holds if the function can only read its arguments.
DECL_PURE_P ¶This predicate holds if the function can only read its arguments, butmay also read global memory.
DECL_VIRTUAL_P ¶This predicate holds if the function is virtual.
DECL_ARTIFICIAL ¶This macro holds if the function was implicitly generated by thecompiler, rather than explicitly declared. In addition to implicitlygenerated class member functions, this macro holds for the specialfunctions created to implement static initialization and destruction, tocompute run-time type information, and so forth.
DECL_FUNCTION_SPECIFIC_TARGET ¶This macro returns a tree node that holds the target options that areto be used to compile this particular function orNULL_TREE ifthe function is to be compiled with the target options specified onthe command line.
DECL_FUNCTION_SPECIFIC_OPTIMIZATION ¶This macro returns a tree node that holds the optimization optionsthat are to be used to compile this particular function orNULL_TREE if the function is to be compiled with theoptimization options specified on the command line.
Previous:Function Basics, Up:Functions [Contents][Index]