This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Fix ObjC @"string" machinery
On 26 Jun 2005, at 22.31, Richard Henderson wrote:
On Wed, Jun 22, 2005 at 12:21:55PM -0700, Ziemowit Laski wrote:
Language hook? Although it seems heavyweight for this small use,
it's supposed to be the canonical way of insulating the backend
from random frontend hackery and global variables and such, right?
Actually, how about introducing a targetm.objc structure for such
things?
In addition to a 'targetm.objc.next_runtime' flag, we could then also
put in a 'targetm.objc.create_string' hook.
How about putting stuff in a file specific to the c front ends,
much like we do for pragma handling (config/cpu/cpu-c.c).
That would be a clean solution, yes. Thing is, in this particular case,
we need 'flag_next_runtime' (or whatever/whenever it winds up as) to be
accessible by the section selection logic
(darwin.c:machopic_select_section()),
which is not specific to C front ends.
At this point, I'm leaning toward using a lang_hook (as Stan and David
Ayers have suggested). Would that approach be acceptable, or do you
have other ideas?
Thanks,
--Zem
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477