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]

Re: Target-ize FUNCTION_{END_PROLOGUE,BEGIN_EPILOGUE}


Richard Henderson wrote:-

> Well, you can document when they're called -- at the end and
> beginning of the prologue and epilogue respectively.  Cross
> reference that to the prologue and epilogue md patterns.

I've committed the patch.  How's this for docs?

Remember, I don't understand this part of the compiler - in
particular, to me the natural question is why do we need these two
variants?  Why not just put TARGET_ASM_FUNCTION_END_PROLOGUE stuff at
the end of TARGET_ASM_FUNCTION_PROLOGUE, and similarly for the begin
epilogue version?  Now, I know they're not the same, since they're not
called one after the other in the code.  But I remain confused, which
is why I didn't want to document the stuff.

Neil.

	* doc/md.texi: Update, add anchors.
	* doc/tm.texi: Document TARGET_ASM_FUNCTION_END_PROLOGUE
	and TARGET_ASM_FUNCTION_BEGIN_EPILOGUE.

Index: doc/md.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/md.texi,v
retrieving revision 1.11
diff -u -p -r1.11 md.texi
--- md.texi	2001/07/03 00:46:05	1.11
+++ md.texi	2001/07/08 20:27:50
@@ -2900,25 +2900,27 @@ is to be used, and simple moves to @code
 @code{EH_RETURN_HANDLER_RTX} are not sufficient.
 
 @cindex @code{prologue} instruction pattern
+@anchor{prologue instruction pattern}
 @item @samp{prologue}
 This pattern, if defined, emits RTL for entry to a function.  The function
 entry is responsible for setting up the stack frame, initializing the frame
 pointer register, saving callee saved registers, etc.
 
 Using a prologue pattern is generally preferred over defining
-@code{FUNCTION_PROLOGUE} to emit assembly code for the prologue.
+@code{TARGET_ASM_FUNCTION_PROLOGUE} to emit assembly code for the prologue.
 
 The @code{prologue} pattern is particularly useful for targets which perform
 instruction scheduling.
 
 @cindex @code{epilogue} instruction pattern
+@anchor{epilogue instruction pattern}
 @item @samp{epilogue}
 This pattern, if defined, emits RTL for exit from a function.  The function
 exit is responsible for deallocating the stack frame, restoring callee saved
 registers and emitting the return instruction.
 
 Using an epilogue pattern is generally preferred over defining
-@code{FUNCTION_EPILOGUE} to emit assembly code for the prologue.
+@code{TARGET_ASM_FUNCTION_EPILOGUE} to emit assembly code for the prologue.
 
 The @code{epilogue} pattern is particularly useful for targets which perform
 instruction scheduling or which have delay slots for their return instruction.
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.28
diff -u -p -r1.28 tm.texi
--- tm.texi	2001/07/08 20:05:17	1.28
+++ tm.texi	2001/07/08 20:28:21
@@ -3766,6 +3766,16 @@ or by a debugger, there is no reason why
 need agree with that used by other compilers for a machine.
 @end deftypefn
 
+@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_END_PROLOGUE (FILE *@var{file})
+If defined, a function that outputs assembler code at the end of a
+prologue (@pxref{prologue instruction pattern}).
+@end deftypefn
+
+@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_BEGIN_EPILOGUE (FILE *@var{file})
+If defined, a function that outputs assembler code at the beginning of
+an epilogue (@pxref{epilogue instruction pattern}).
+@end deftypefn
+
 @deftypefn {Target Hook} void TARGET_ASM_FUNCTION_EPILOGUE (FILE *@var{file}, HOST_WIDE_INT @var{size})
 If defined, a function that outputs the assembler code for exit from a
 function.  The epilogue is responsible for restoring the saved


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