diff options
author | Nick Clifton <nickc@redhat.com> | 2006-12-07 10:54:13 +0000 |
---|---|---|
committer | Nick Clifton <nickc@gcc.gnu.org> | 2006-12-07 10:54:13 +0000 |
commit | e0d9d0ddb643a4e9372e3bb1104ce299a200df45 (patch) | |
tree | 46d6178c94554a22a20fe838a94fbf98cec94d4d /gcc/target.h | |
parent | 1d49ee6a7985f8eb2a759a3d22fb3c8fec92a403 (diff) | |
download | gcc-e0d9d0ddb643a4e9372e3bb1104ce299a200df45.zip gcc-e0d9d0ddb643a4e9372e3bb1104ce299a200df45.tar.gz gcc-e0d9d0ddb643a4e9372e3bb1104ce299a200df45.tar.bz2 |
common.opt (record-gcc-switches): New command line switch.
* 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 (eld_record_gcc_switches): New function. Example 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.
From-SVN: r119615
Diffstat (limited to 'gcc/target.h')
-rw-r--r-- | gcc/target.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/gcc/target.h b/gcc/target.h index 1147142..b59f561 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -51,6 +51,22 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "tm.h" #include "insn-modes.h" +/* Types used by the record_gcc_switches() target function. */ +typedef enum +{ + SWITCH_TYPE_PASSED, /* A switch passed on the command line. */ + SWITCH_TYPE_ENABLED, /* An option that is currently enabled. */ + SWITCH_TYPE_DESCRIPTIVE, /* Descriptive text, not a switch or option. */ + SWITCH_TYPE_LINE_START, /* Please emit any necessary text at the start of a line. */ + SWITCH_TYPE_LINE_END /* Please emit a line terminator. */ +} +print_switch_type; + +typedef int (* print_switch_fn_type) (print_switch_type, const char *); + +/* An example implementation for ELF targets. Defined in varasm.c */ +extern int elf_record_gcc_switches (print_switch_type type, const char *); + struct stdarg_info; struct spec_info_def; @@ -196,10 +212,18 @@ struct gcc_target external. */ void (*external_libcall) (rtx); - /* Output an assembler directive to mark decl live. This instructs + /* Output an assembler directive to mark decl live. This instructs linker to not dead code strip this symbol. */ void (*mark_decl_preserved) (const char *); + /* Output a record of the command line switches that have been passed. */ + print_switch_fn_type record_gcc_switches; + /* The name of the section that the example ELF implementation of + record_gcc_switches will use to store the information. Target + specific versions of record_gcc_switches may or may not use + this information. */ + const char * record_gcc_switches_section; + /* Output the definition of a section anchor. */ void (*output_anchor) (rtx); @@ -796,7 +820,7 @@ struct gcc_target target modifications). */ void (*adjust_class_at_definition) (tree type); } cxx; - + /* For targets that need to mark extra registers as live on entry to the function, they should define this target hook and set their bits in the bitmap passed in. */ |