* [tree-ssa] coding style for structure fields
@ 2003-03-03 16:33 Diego Novillo
2003-03-03 17:04 ` law
0 siblings, 1 reply; 2+ messages in thread
From: Diego Novillo @ 2003-03-03 16:33 UTC (permalink / raw)
To: gcc
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [tree-ssa] coding style for structure fields
2003-03-03 16:33 [tree-ssa] coding style for structure fields Diego Novillo
@ 2003-03-03 17:04 ` law
0 siblings, 0 replies; 2+ messages in thread
From: law @ 2003-03-03 17:04 UTC (permalink / raw)
To: Diego Novillo; +Cc: gcc
In message <1046706013.29022.11.camel@tornado> , Diego Novillo writes:
>I think I'm getting sick of this. I see two problems:
Can't blame you. I'm not a big fan of the inline accessor functions :-)
>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?
I would recommend you use the schemes used elsewhere in GCC, namely
lvalue macros.
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-03 16:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-03 16:33 [tree-ssa] coding style for structure fields Diego Novillo
2003-03-03 17:04 ` law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).