mangle.c (write_name): Use <unscoped-name> for names directly in function scope.

* mangle.c (write_name): Use <unscoped-name> for names directly in
	function scope.
	(write_unscoped_name): Accept names directly in function scope.

From-SVN: r37603
This commit is contained in:
Alex Samuel 2000-11-21 04:38:08 +00:00 committed by Alex Samuel
parent 5d81021ea1
commit beac9b932c
2 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2000-11-16 Alex Samuel <samuel@codesourcery.com>
* mangle.c (write_name): Use <unscoped-name> for names directly in
function scope.
(write_unscoped_name): Accept names directly in function scope.
2000-11-20 Nathan Sidwell <nathan@codesourcery.com> 2000-11-20 Nathan Sidwell <nathan@codesourcery.com>
* lex.c (rid_to_yy, RID_EXPORT): Make unique keyword. * lex.c (rid_to_yy, RID_EXPORT): Make unique keyword.

View File

@ -674,10 +674,15 @@ write_name (decl, ignore_local_scope)
else else
context = (DECL_CONTEXT (decl) == NULL) ? NULL : CP_DECL_CONTEXT (decl); context = (DECL_CONTEXT (decl) == NULL) ? NULL : CP_DECL_CONTEXT (decl);
/* Decls in :: or ::std scope are treated specially. */ /* A decl in :: or ::std scope is treated specially. The former is
mangled using <unscoped-name> or <unscoped-template-name>, the
latter with a special substitution. Also, a name that is
directly in a local function scope is also mangled with
<unscoped-name> rather than a full <nested-name>. */
if (context == NULL if (context == NULL
|| context == global_namespace || context == global_namespace
|| DECL_NAMESPACE_STD_P (context)) || DECL_NAMESPACE_STD_P (context)
|| (ignore_local_scope && TREE_CODE (context) == FUNCTION_DECL))
{ {
tree template_info; tree template_info;
/* Is this a template instance? */ /* Is this a template instance? */
@ -748,8 +753,11 @@ write_unscoped_name (decl)
write_string ("St"); write_string ("St");
write_unqualified_name (decl); write_unqualified_name (decl);
} }
/* If not, it should be in the global namespace. */ /* If not, it should be either in the global namespace, or directly
else if (context == global_namespace || context == NULL) in a local function scope. */
else if (context == global_namespace
|| context == NULL
|| TREE_CODE (context) == FUNCTION_DECL)
write_unqualified_name (decl); write_unqualified_name (decl);
else else
my_friendly_abort (20000521); my_friendly_abort (20000521);