tree.c (decl_function_context): Handle virtual functions.

* tree.c (decl_function_context): Handle virtual functions.

        * tlink.c (scan_linker_output): Don't look in demangled name when
        looking for linker output keywords.

        * dwarfout.c (output_type): We can defer namespace-scope classes.

From-SVN: r30950
This commit is contained in:
Jason Merrill 1999-12-15 09:37:48 +00:00 committed by Jason Merrill
parent 04a2ecf780
commit 6ff7fb9572
4 changed files with 25 additions and 3 deletions

View File

@ -1,3 +1,12 @@
1999-12-15 Jason Merrill <jason@casey.cygnus.com>
* tree.c (decl_function_context): Handle virtual functions.
* tlink.c (scan_linker_output): Don't look in demangled name when
looking for linker output keywords.
* dwarfout.c (output_type): We can defer namespace-scope classes.
Wed Dec 15 01:23:29 1999 Jeffrey A Law (law@cygnus.com)
* regclass.c (record_reg_classes): Update comment for merging

View File

@ -4448,9 +4448,8 @@ output_type (type, containing_scope)
if (TYPE_SIZE (type) == 0
&& (TYPE_CONTEXT (type) == NULL
|| (TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't'
&& TREE_CODE (TYPE_CONTEXT (type)) != FUNCTION_TYPE
&& TREE_CODE (TYPE_CONTEXT (type)) != METHOD_TYPE))
|| AGGREGATE_TYPE_P (TYPE_CONTEXT (type))
|| TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL)
&& !finalizing)
{
/* We can't do this for function-local types, and we don't need

View File

@ -638,6 +638,11 @@ scan_linker_output (fname)
else if (p = index (oldq, '"'), p)
p++, q = index (p, '"');
/* Don't let the strstr's below see the demangled name; we
might get spurious matches. */
if (p)
p[-1] = '\0';
/* We need to check for certain error keywords here, or we would
mistakenly use GNU ld's "In function `foo':" message. */
if (q && (strstr (oldq, "ndefined")

View File

@ -4802,6 +4802,15 @@ decl_function_context (decl)
if (TREE_CODE (decl) == SAVE_EXPR)
context = SAVE_EXPR_CONTEXT (decl);
/* C++ virtual functions use DECL_CONTEXT for the class of the vtable
where we look up the function at runtime. Such functions always take
a first argument of type 'pointer to real context'.
C++ should really be fixed to use DECL_CONTEXT for the real context,
and use something else for the "virtual context". */
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VINDEX (decl))
context = TYPE_MAIN_VARIANT
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));
else
context = DECL_CONTEXT (decl);