This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Some absent attributes in the tree-dump should be added (in gcc 4.3.3)


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 (4.3.3) contains a few
additional code that adds to the resulting dump useful function attributes:
inline, volatile, const. Bugzilla link: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39679


--- 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);


--- 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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]