dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.

* dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
	* ir.texi: Document THUNK_DECLs.

From-SVN: r29709
This commit is contained in:
Mark Mitchell 1999-09-29 19:00:46 +00:00 committed by Mark Mitchell
parent b5ac18ea8c
commit e9e7f18109
3 changed files with 43 additions and 13 deletions

View File

@ -1,5 +1,8 @@
1999-09-29 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
* ir.texi: Document THUNK_DECLs.
* cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c.
(TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
(TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.

View File

@ -600,6 +600,7 @@ dequeue_and_dump (di)
break;
case FUNCTION_DECL:
case THUNK_DECL:
if (dump_children_p)
{
queue_and_dump_index (di, "scpe", DECL_REAL_CONTEXT (t), 0);
@ -610,18 +611,26 @@ dequeue_and_dump (di)
dump_string(di, "extern");
else
dump_string (di, "static");
if (DECL_FUNCTION_MEMBER_P (t))
dump_string (di, "member");
if (DECL_CONSTRUCTOR_P (t))
dump_string (di, "constructor");
if (DECL_DESTRUCTOR_P (t))
dump_string (di, "destructor");
if (DECL_OVERLOADED_OPERATOR_P (t))
dump_string (di, "operator");
if (DECL_CONV_FN_P (t))
dump_string (di, "conversion");
if (dump_children_p)
dump_child ("body", DECL_SAVED_TREE (t));
if (TREE_CODE (t) == FUNCTION_DECL)
{
if (DECL_FUNCTION_MEMBER_P (t))
dump_string (di, "member");
if (DECL_CONSTRUCTOR_P (t))
dump_string (di, "constructor");
if (DECL_DESTRUCTOR_P (t))
dump_string (di, "destructor");
if (DECL_OVERLOADED_OPERATOR_P (t))
dump_string (di, "operator");
if (DECL_CONV_FN_P (t))
dump_string (di, "conversion");
if (dump_children_p)
dump_child ("body", DECL_SAVED_TREE (t));
}
else
{
dump_int (di, "dlta", THUNK_DELTA (t));
dump_child ("init", DECL_INITIAL (t));
}
break;
case NAMESPACE_DECL:

View File

@ -733,6 +733,8 @@ FIXME: Talk about @code{TYPE_NONCOPIED_PARTS}.
@tindex NAMESPACE_DECL
@tindex RESULT_DECL
@tindex TEMPLATE_DECL
@tindex THUNK_DECL
@findex THUNK_DELTA
@tindex USING_DECL
@findex DECL_INITIAL
@findex DECL_SIZE
@ -855,6 +857,21 @@ can safely ignore @code{TEMPLATE_DECL}s, but should examine
@code{FUNCTION_DECL} nodes on the specializations list just as they
would ordinary @code{FUNCTION_DECL} nodes.
@item THUNK_DECL
These nodes represent stub code that adjusts the @code{this} pointer and
then jumps to another function. When the jumped-to function returns,
control is transferred directly to the caller, without returning to the
thunk. The first parameter to the thunk is always the @code{this}
pointer; the thunk should add @code{THUNK_DELTA} to this value. (The
@code{THUNK_DECL} is an @code{int}, not an @code{INTEGER_CST}.) Then,
the thunk should jump to the location given by @code{DECL_INITIAL}; this
will always be an expression for the address of a function.
You can use @code{DECL_ASSEMBLER_NAME}, @code{TREE_PUBLIC}, and
@code{DECL_ARGUMENTS} with a @code{THUNK_DECL}, just as with a
@code{FUNCTION_DECL}.
@item USING_DECL
Back-ends can safely ignore these nodes.
@ -870,7 +887,8 @@ Back-ends can safely ignore these nodes.
@cindex function
@tindex FUNCTION_DECL
@tindex OVERLOAD
@findex OVL_
@findex OVL_CURRENT
@findex OVL_NEXT
A function is represented by a @code{FUNCTION_DECL} node. A set of
overloaded functions is sometimes represented by a @code{OVERLOAD} node.