From: jason Date: Wed, 15 Dec 1999 09:37:48 +0000 (+0000) Subject: * tree.c (decl_function_context): Handle virtual functions. X-Git-Tag: upstream/4.9.2~104156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53bdb86c380f3f819d819ee928f00eb6bfad5d05;p=platform%2Fupstream%2Flinaro-gcc.git * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30950 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6309779..b300d61 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +1999-12-15 Jason Merrill + + * 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 diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index 1df09c6..cb9e77f 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -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 diff --git a/gcc/tlink.c b/gcc/tlink.c index 3fdd135..a6130a1 100644 --- a/gcc/tlink.c +++ b/gcc/tlink.c @@ -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") diff --git a/gcc/tree.c b/gcc/tree.c index 37a8654..78ea4cf 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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);