This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Change type of instruction pointers for cfghooks
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Ian Lance Taylor <ian at airs dot com>
- Cc: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, gcc-patches at gcc dot gnu dot org
- Date: 13 Dec 2005 01:55:03 +0100
- Subject: Re: [patch] Change type of instruction pointers for cfghooks
- References: <20051212223348.GA25488@atrey.karlin.mff.cuni.cz> <m37ja9zxmw.fsf@gossamer.airs.com>
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