gccint: Function Properties
1
1 11.8.2 Function Properties
1 --------------------------
1
1 To determine the scope of a function, you can use the 'DECL_CONTEXT'
1 macro. This macro will return the class (either a 'RECORD_TYPE' or a
1 'UNION_TYPE') or namespace (a 'NAMESPACE_DECL') of which the function is
1 a member. For a virtual function, this macro returns the class in which
1 the function was actually defined, not the base class in which the
1 virtual declaration occurred.
1
1 In C, the 'DECL_CONTEXT' for a function maybe another function. This
1 representation indicates that the GNU nested function extension is in
1 use. For details on the semantics of nested functions, see the GCC
1 Manual. The nested function can refer to local variables in its
1 containing function. Such references are not explicitly marked in the
1 tree structure; back ends must look at the 'DECL_CONTEXT' for the
1 referenced 'VAR_DECL'. If the 'DECL_CONTEXT' for the referenced
1 'VAR_DECL' is not the same as the function currently being processed,
1 and neither 'DECL_EXTERNAL' nor 'TREE_STATIC' hold, then the reference
1 is to a local variable in a containing function, and the back end must
1 take appropriate action.
1
1 'DECL_EXTERNAL'
1 This predicate holds if the function is undefined.
1
1 'TREE_PUBLIC'
1 This predicate holds if the function has external linkage.
1
1 'TREE_STATIC'
1 This predicate holds if the function has been defined.
1
1 'TREE_THIS_VOLATILE'
1 This predicate holds if the function does not return normally.
1
1 'TREE_READONLY'
1 This predicate holds if the function can only read its arguments.
1
1 'DECL_PURE_P'
1 This predicate holds if the function can only read its arguments,
1 but may also read global memory.
1
1 'DECL_VIRTUAL_P'
1 This predicate holds if the function is virtual.
1
1 'DECL_ARTIFICIAL'
1 This macro holds if the function was implicitly generated by the
1 compiler, rather than explicitly declared. In addition to
1 implicitly generated class member functions, this macro holds for
1 the special functions created to implement static initialization
1 and destruction, to compute run-time type information, and so
1 forth.
1
1 'DECL_FUNCTION_SPECIFIC_TARGET'
1 This macro returns a tree node that holds the target options that
1 are to be used to compile this particular function or 'NULL_TREE'
1 if the function is to be compiled with the target options specified
1 on the command line.
1
1 'DECL_FUNCTION_SPECIFIC_OPTIMIZATION'
1 This macro returns a tree node that holds the optimization options
1 that are to be used to compile this particular function or
1 'NULL_TREE' if the function is to be compiled with the optimization
1 options specified on the command line.
1