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]
Other format: [Raw text]

Re: [patch] Change type of instruction pointers for cfghooks


Ian Lance Taylor <ian@airs.com> writes:

| Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> writes:
| 
| > cfg hooks currently use void * pointers when expression or position of
| > an instruction needs to be passed to them, so that they can be used for
| > both trees and rtl.  This patch makes them use union containing rtx and
| > tree instead, for the following reasons:
| > 
| > 1) Better for type checking -- we would now get a warning or error if
| >    an argument of wrong type is passed to them.
| > 2) It might turn out useful to change the type for trees to
| >    block_stmt_iterator, in which case this change makes it easier to
| >    spot the places where the change needs to be done.
| 
| Hmmm, to me this seems sort of ugly and verbose, and it still doesn't
| give us strong type checking--it doesn't check whether we correctly
| passed a tree or an rtx as appropriate.
| 
| If we want strong type checking here, I think we should just use tiny
| functions as wrappers around the hooks--e.g. split_block_rtl and
| split_block_tree.

I agree with that analysis.

-- Gaby


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