This is the mail archive of the gcc@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]

[tree-ssa] coding style for structure fields


For statement and variable annotations, we have a set of inline
functions that given a tree, they set or get the corresponding field in
the tree annotation.

I think I'm getting sick of this.  I see two problems:

        1. The interface to these inline functions is convenient, but it
           may cause unnecessary calls to the functions that retrieve
           the tree annotation.  It is not uncommon for a function to
           retrieve several different annotations for the same
           statement.  At the very least, I would like to change the
           interface so that instead of a 'tree', we provide an
           annotation directly.
        2. I've always disliked get/set accessors.  I don't mind get
           accessors, but when I'm modifying a field, I'd like to see an
           assignment.  The alternative is to wrap these accessors in
           lvalue-macros like the TREE_* macros.  I don't think I like
           that too much either.

I realize that these stylistic issues are highly subjective, but I'd
like to get an idea of what other folks think.  Should we move inline
with the rest of GCC and use lvalue-macros?  Should we maintain the
current get/set inline macros?

For #1, I will probably change the interface soon because it's more of a
performance issue.


Diego.


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