Commit 43048a06 by Mark Mitchell Committed by Mark Mitchell

mangle.c (write_special_name_constructor): Don't generate assembler junk when…

mangle.c (write_special_name_constructor): Don't generate assembler junk when confronted with an old-style constructor.

	* mangle.c (write_special_name_constructor): Don't generate
	assembler junk when confronted with an old-style constructor.
	(write_special_name_destructor): Likewise.
	(mangle_decl_string): Do it here instead.

From-SVN: r37508
parent 35d9f39d
2000-11-16 Mark Mitchell <mark@codesourcery.com>
* mangle.c (write_special_name_constructor): Don't generate
assembler junk when confronted with an old-style constructor.
(write_special_name_destructor): Likewise.
(mangle_decl_string): Do it here instead.
2000-11-16 Nathan Sidwell <nathan@codesourcery.com> 2000-11-16 Nathan Sidwell <nathan@codesourcery.com>
* call.c (op_error): Make error messages clearer. * call.c (op_error): Make error messages clearer.
......
...@@ -1077,12 +1077,16 @@ static void ...@@ -1077,12 +1077,16 @@ static void
write_special_name_constructor (ctor) write_special_name_constructor (ctor)
tree ctor; tree ctor;
{ {
if (DECL_COMPLETE_CONSTRUCTOR_P (ctor)) if (DECL_COMPLETE_CONSTRUCTOR_P (ctor)
/* Even though we don't ever emit a definition of the
old-style destructor, we still have to consider entities
(like static variables) nested inside it. */
|| DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (ctor))
write_string ("C1"); write_string ("C1");
else if (DECL_BASE_CONSTRUCTOR_P (ctor)) else if (DECL_BASE_CONSTRUCTOR_P (ctor))
write_string ("C2"); write_string ("C2");
else else
write_string ("C*INTERNAL*"); my_friendly_abort (20001115);
} }
/* Handle destructor productions of non-terminal <special-name>. /* Handle destructor productions of non-terminal <special-name>.
...@@ -1102,13 +1106,16 @@ write_special_name_destructor (dtor) ...@@ -1102,13 +1106,16 @@ write_special_name_destructor (dtor)
{ {
if (DECL_DELETING_DESTRUCTOR_P (dtor)) if (DECL_DELETING_DESTRUCTOR_P (dtor))
write_string ("D0"); write_string ("D0");
else if (DECL_COMPLETE_DESTRUCTOR_P (dtor)) else if (DECL_COMPLETE_DESTRUCTOR_P (dtor)
/* Even though we don't ever emit a definition of the
old-style destructor, we still have to consider entities
(like static variables) nested inside it. */
|| DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (dtor))
write_string ("D1"); write_string ("D1");
else if (DECL_BASE_DESTRUCTOR_P (dtor)) else if (DECL_BASE_DESTRUCTOR_P (dtor))
write_string ("D2"); write_string ("D2");
else else
/* Old-ABI destructor. */ my_friendly_abort (20001115);
write_string ("D*INTERNAL*");
} }
/* Return the discriminator for ENTITY appearing inside /* Return the discriminator for ENTITY appearing inside
...@@ -2002,7 +2009,16 @@ mangle_decl_string (decl) ...@@ -2002,7 +2009,16 @@ mangle_decl_string (decl)
if (TREE_CODE (decl) == TYPE_DECL) if (TREE_CODE (decl) == TYPE_DECL)
write_type (TREE_TYPE (decl)); write_type (TREE_TYPE (decl));
else else
write_mangled_name (decl); {
write_mangled_name (decl);
if (DECL_LANG_SPECIFIC (decl)
&& (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)
|| DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl)))
/* We need a distinct mangled name for these entities, but
we should never actually output it. So, we append some
characters the assembler won't like. */
write_string (" *INTERNAL* ");
}
result = finish_mangling (); result = finish_mangling ();
if (DEBUG_MANGLE) if (DEBUG_MANGLE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment