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: RFA: Add -frecord-gcc-switches command line switch


Hi Mark,

I like this patch.  I have some nits, but I'll review & approve a
revised version.

Thanks for the patch review. A revised version is attached which addresses all of the issues that you raised.


	* target-def.h (TARGET_ASM_RECORD_GCC_SWITCHES): Provide a default
	definition.

I think the default should be NULL for this hook, and then turned on selectively for platforms where we know they work. It's a bad thing if the compiler has switches that don't cause "I'm unsupported" error messages, but do not work.

I have done this, and I have also added an information message saying "-frecord-gcc-switches is not supported by the current target" if the switch is when the target does not define TARGET_ASM_RECORD_GCC_SWITCHES.


This section
+is only created however if the @option{-fverbose-asm2} switch has been
+enabled.

Why? Why does -frecord-gcc-switches have interdependency with -fverbose-asm2?

Thinko - this was left in from an earlier version of the patch. The interdependency with -fverbose-asm2 was removed during development. (In fact I think that the -fverbose-asm2 switch no longer exists).


Is this revised version OK to apply ?

Cheers
  Nick

gcc/ChangeLog
2006-12-05  Nick Clifton  <nickc@redhat.com>

	* common.opt (record-gcc-switches): New command line switch.
	* target.h (print_switch_type): New enum.
	(print_switch_fn_type): New typedef for a function pointer.
	(struct gcc_target): Add record_gcc_switches and
	record_gcc_switches_section fields.
	* target-def.h (TARGET_ASM_RECORD_GCC_SWITCHES): Provide a
        default definition.
	(TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Provide a default
	definition.
	* toplev.c (print_single_switch): Simplify by providing a
	pointer to function that will format and output the switch
	appropriately.
	(print_switch_values): Likewise.
	(print_to_asm_out_file): New function.
	(print_to_stderr): New function.
	(init_asm_output): If flag_record_gcc_switches is set then if
        the target supports recording the switches then emit them into
        the assembler output file, otherwise tell the user that the
        switch is not supported.
	* varasm.c (varasm_print_gcc_option): New function.
	(default_record_gcc_switches): New function.  Default handler
	for the record_gcc_switches target hook.
	* doc/tm.texi (TARGET_ASM_RECORD_GCC_SWITCHES): Document the new
	target hook.
	(TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Likewise.
	* doc/invoke.texi (-frecord-gcc-switches): Document.

Attachment: gcc.record-options.patch.bz2
Description: BZip2 compressed data


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