RFC - Next refactoring steps

Andrew MacLeod amacleod@redhat.com
Thu Sep 5 13:25:00 GMT 2013


On 09/05/2013 09:08 AM, Richard Biener wrote:
> On Thu, Sep 5, 2013 at 2:57 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
>> Now that tree.h is split in two, there are some follow up things that will
>> facilitate the deforestation of gimple.  I've also thrown in a couple of
>> structuring issues for good measure.
>>
>> What are your thoughts on these subjects?
> Jumping in from the side I suggest you start de-foresting existing headers
> where they say
>
> /* In foobar.c */
> ...
>
> to simply add a foobar.h with the contents that follow.  Bonus points if you
> actually verify all definitions from X.c are declaed in X.h (the /* In ... */
> annotations are hopelessly out-of-date in some cases).
>
> More bonus points if you avoid pass-xyz.h files but instead move code
> useful to multiple passes to more appropriate places.  That said, definitely
> avoid pass-xyz.h ;)
>
> Richard.
>

Yes, well that's high on the list too, I just hadnt given it a lot of 
thought yet.  Yes, thisbis probably the right thing to do. However, The 
functions in tree.c that I need would then end up in tree.h... which 
isnt good for me :-)     we could have a tree-proto.h for just  this one 
file or something like that.  I dont think tree-core is the right place, 
but...

Anyway, that would resolve the tree-checking and place to put protoypes 
issue just fine.  I'd definitely go for the bonus points :-).   I also 
think a lot of include files are including a lot of crud they dont need 
too... In  glancing at those 4 .h files that include tree.h, they have 
along list of includes, most of which are also included in the .c 
files.  And many of those have #includes they don't need I bet.   I'd 
have alook at that on the way through the file too.


Andrew




More information about the Gcc-patches mailing list