dwarf2out.c (gen_type_die): Check for typedefs before calling for TYPE_MAIN_VARIANT.

* dwarf2out.c (gen_type_die): Check for typedefs before calling
	for TYPE_MAIN_VARIANT.

From-SVN: r62258
This commit is contained in:
Daniel Jacobowitz 2003-02-01 21:12:55 +00:00 committed by Daniel Jacobowitz
parent 53585c36db
commit 5d7bed9d6f
2 changed files with 20 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2003-02-01 Daniel Jacobowitz <drow@mvista.com>
* dwarf2out.c (gen_type_die): Check for typedefs before calling
for TYPE_MAIN_VARIANT.
2003-02-01 Richard Henderson <rth@redhat.com>
* libgcc2.c: Include auto-host.h.

View File

@ -11606,6 +11606,21 @@ gen_type_die (type, context_die)
if (type == NULL_TREE || type == error_mark_node)
return;
if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
{
if (TREE_ASM_WRITTEN (type))
return;
/* Prevent broken recursion; we can't hand off to the same type. */
if (DECL_ORIGINAL_TYPE (TYPE_NAME (type)) == type)
abort ();
TREE_ASM_WRITTEN (type) = 1;
gen_decl_die (TYPE_NAME (type), context_die);
return;
}
/* We are going to output a DIE to represent the unqualified version
of this type (i.e. without any const or volatile qualifiers) so
get the main variant (i.e. the unqualified version) of this type
@ -11617,18 +11632,6 @@ gen_type_die (type, context_die)
if (TREE_ASM_WRITTEN (type))
return;
if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
{
/* Prevent broken recursion; we can't hand off to the same type. */
if (DECL_ORIGINAL_TYPE (TYPE_NAME (type)) == type)
abort ();
TREE_ASM_WRITTEN (type) = 1;
gen_decl_die (TYPE_NAME (type), context_die);
return;
}
switch (TREE_CODE (type))
{
case ERROR_MARK: