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]

Re: [RFA] Extend demangler to recognize destructors/constructors



Stylistic notes.

Jim Blandy <jimb@zwingli.cygnus.com> writes:

[...]

| + 
| +   /* Set to non-zero iff this name is a constructor.  The actual value
| +      is '1', '2', or '3', indicating a complete object, base object,
| +      or complete object allocating constructor.  */
| +   int is_constructor;
| + 
| +   /* Set to non-zero iff this name is a destructor.  The actual value
| +      is '0', '1', or '2', indicating a deleting, complete object, or
| +      base object destructor.  */
| +   int is_destructor;

May I suggest use of enums to make it much more readable?  I realize
that makes  

       dm->is_destructor = peek_char (dm);

less straigthforward but will make use of

     int
     is_gnu_v3_mangled_constructor (const char *name)

and 
     int
     is_gnu_v3_mangled_destructor (const char *name)

self explanatory.


-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com


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