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] Minor optimization: Turn a large macro into a function


Andi Kleen <ak@suse.de> writes:

> On Friday 02 February 2007 18:59, Ian Lance Taylor wrote:
> > Andi Kleen <ak@suse.de> writes:
> > 
> > > 2007-02-02  Andi Kleen  <ak@suse.de>
> > > 
> > > 	* varasm.c (asm_output_ascii): Add.
> > > 	* output.h (asm_output_ascii): Declare.
> > > 	* varasm.c, dwarf2asm.c: Call asm_output_ascii.
> > 
> > The right thing to do is to make this a target hook,
> > targetm.asm_out.ascii.  Let's do that instead.  You can just have the
> > default function call ASM_OUTPUT_ASCII for now, and we can fix the
> > backends at our leisure.
> 
> What advantages would that have over the simple call? Do you expect
> this to change at runtime? 

We have a general policy of converting complex target macros into
target hooks.  The advantage is getting complex macros out of the
CPU.h files and into the CPU.c files, where they can be written more
normally and debugged more easily.

Ian


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