Hi, I'am one of the lead developers from "Linux Verification Center" (http://www.linuxtesting.org/) at ISPRAS in Russia. Last several years we make instruments for linux testing along with the "Linux Foundation" (http://linuxfoundation.org/) under the LSB-Infrastructure project. Some our instruments use gcc as a parser through the command "g++ -fdump-translation-unit". Dump that gcc creates by this command doesn't contain some necessary things and we have to add some changes to the sources of gcc and recompile it. We consider that some of these changes may be useful for other users of gcc. Following patch for file dump.c from gcc sources contains a few additional code that adds to the resulting dump useful function attributes: inline, volatile, const. --- dump.c 2007-08-02 14:36:13.000000000 +0400 +++ dump.c 2009-04-07 14:34:14.000000000 +0400 @@ -297,6 +297,15 @@ case FUNCTION_DECL: if (!DECL_THUNK_P (t)) { + /* Dump whether function is const. */ + if (DECL_CONST_MEMFUNC_P(t)) + dump_string_field(di, "qual", "c"); + /* Dump whether function is volatile. */ + if (DECL_VOLATILE_MEMFUNC_P(t)) + dump_string_field(di, "qual", "v"); + /* Dump whether function is inline. */ + if (DECL_DECLARED_INLINE_P(t)) + dump_string_field (di, "note", "inline"); if (DECL_OVERLOADED_OPERATOR_P (t)) { dump_string_field (di, "note", "operator"); dump_op (di, t);
Created attachment 17600 [details] This patch add some absent function attributes to the tree-dump
this dump file is only supposed to be used to debug gcc.
Subject: Re: Some absent attributes in the tree-dump should be added pinskia at gcc dot gnu dot org a écrit : > ------- Comment #2 from pinskia at gcc dot gnu dot org 2009-04-07 18:28 ------- > this dump file is only supposed to be used to debug gcc. True. For what it is worth, you might want to post your patch to gcc-patches@gcc.gnu.org so that it has more exposure and triggers more discussion. For patches, the gcc-patches mailing list tends to get more exposure to the GCC hackers than the bugzilla.
Did you send the patch to the gcc-patches mailing list?
Hi Gaby. What do you think about this? I suppose, if we like the idea, we could apply the patch even without a Copyright assignment, because it's so small, and resolve the issue.
g++ no longer supports the -fdump-translation-unit flag: $ /usr/local/bin/g++ -c -fdump-translation-unit -fsyntax-only -std=gnu++98 53360.cc cc1plus: error: unrecognized command line option ‘-fdump-translation-unit’ $ I think I remember some debate on gcc-patches about removing it for gcc8 but I forget the link to the thread... closing as WONTFIX since the flag probably won't be coming back