This is the mail archive of the gcc@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: Creating assembler comments from RTL


> 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.


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