This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Creating assembler comments from RTL
- From: DJ Delorie <dj at redhat dot com>
- To: HutchinsonAndy at netscape dot net
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 9 Mar 2005 22:00:12 -0500
- Subject: Re: Creating assembler comments from RTL
- References: <129592EC.427D739D.B7B0B67F@netscape.net>
> Is there a good way of creating an assembler comments directly from RTL?
>
> I want to be able to add debugging/explanation strings to assembler
> listing (GAS). Unfortunately I want to do this from RTL prologue and
> epilogue (and thus avoid using TARGET_ASM_FUNCTION_EPILOGUE - where
> it would be easy!)
You might get part of it through the TARGET_START_FUNCTION hook.
You can also define insns that use unspec or unspec_volatile, which
are generated as part of your prologue/epilogue, that use a C function
to emit themselves as assembler. The C function can return a properly
formatted pattern that produces the comments you want in the final asm
file.
You could also hook ASM_OUTPUT_OPCODE to turn "keyword" opcodes from
those types of insns into full comments as needed.