* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30950
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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
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")
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);