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


-- 
           Summary: Some absent attributes in the tree-dump should be added
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: susanin at ispras dot ru
 GCC build triplet: independent
  GCC host triplet: independent


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39679

Reply via email to