summaryrefslogtreecommitdiff
path: root/gcc/config/avr
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-19 08:54:37 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-19 08:54:37 +0000
commitc3e475a49a3fa9bbd938f488cd9c6904450877d8 (patch)
tree7a399644607ffc6f2575a321c9226c7affad1845 /gcc/config/avr
parentd799a62969010c98bc73069756aff0ef930c3693 (diff)
downloadgcc-c3e475a49a3fa9bbd938f488cd9c6904450877d8.tar.gz
* config/avr/avr.c (avr_init_stack, avr_mcu_name): Make static.
(TARGET_HANDLE_OPTION): Override default. (avr_handle_option): New function. * config/avr/avr.h (MASK_ALL_DEBUG, MASK_ORDER_1, MASK_INSN_SIZE_DUMP) (MASK_ORDER_2, MASK_NO_TABLEJUMP, MASK_INT8, MASK_NO_INTERRUPTS) (MASK_CALL_PROLOGUES, MASK_TINY_STACK, MASK_SHORT_CALLS) (TARGET_ORDER_1, TARGET_ORDER_2, TARGET_INT8, TARGET_NO_INTERRUPTS) (TARGET_INSN_SIZE_DUMP, TARGET_CALL_PROLOGUES, TARGET_TINY_STACK) (TARGET_NO_TABLEJUMP, TARGET_SHORT_CALLS, TARGET_ALL_DEBUG) (TARGET_SWITCHES, avr_init_stack, avr_mcu_name) (TARGET_OPTIONS): Delete. * config/avr/avr.opt: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96719 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/avr')
-rw-r--r--gcc/config/avr/avr.c27
-rw-r--r--gcc/config/avr/avr.h51
-rw-r--r--gcc/config/avr/avr.opt65
3 files changed, 90 insertions, 53 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index e7a453ee63c..4d1a9ce0f1f 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -48,6 +48,7 @@
/* Maximal allowed offset for an address in the LD command */
#define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE))
+static bool avr_handle_option (size_t, const char *, int);
static int avr_naked_function_p (tree);
static int interrupt_function_p (tree);
static int signal_function_p (tree);
@@ -111,10 +112,10 @@ static int epilogue_size;
static int jump_tables_size;
/* Initial stack value specified by the `-minit-stack=' option */
-const char *avr_init_stack = "__stack";
+static const char *avr_init_stack = "__stack";
/* Default MCU name */
-const char *avr_mcu_name = "avr2";
+static const char *avr_mcu_name = "avr2";
/* Preprocessor macros to define depending on MCU type. */
const char *avr_base_arch_macro;
@@ -244,6 +245,8 @@ int avr_case_values_threshold = 30000;
#define TARGET_ATTRIBUTE_TABLE avr_attribute_table
#undef TARGET_ASM_FUNCTION_RODATA_SECTION
#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION avr_handle_option
#undef TARGET_INSERT_ATTRIBUTES
#define TARGET_INSERT_ATTRIBUTES avr_insert_attributes
#undef TARGET_SECTION_TYPE_FLAGS
@@ -263,6 +266,26 @@ int avr_case_values_threshold = 30000;
struct gcc_target targetm = TARGET_INITIALIZER;
+/* Implement TARGET_HANDLE_OPTION. */
+
+static bool
+avr_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+{
+ switch (code)
+ {
+ case OPT_minit_stack_:
+ avr_init_stack = arg;
+ return true;
+
+ case OPT_mmcu_:
+ avr_mcu_name = arg;
+ return true;
+
+ default:
+ return true;
+ }
+}
+
void
avr_override_options (void)
{
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 6b54c37626b..e0a9c75dcad 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -42,53 +42,6 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
-/* This declaration should be present. */
-extern int target_flags;
-
-#define MASK_ALL_DEBUG 0x00000FE0
-#define MASK_ORDER_1 0x00001000
-#define MASK_INSN_SIZE_DUMP 0x00002000
-#define MASK_ORDER_2 0x00004000
-#define MASK_NO_TABLEJUMP 0x00008000
-#define MASK_INT8 0x00010000
-#define MASK_NO_INTERRUPTS 0x00020000
-#define MASK_CALL_PROLOGUES 0x00040000
-#define MASK_TINY_STACK 0x00080000
-#define MASK_SHORT_CALLS 0x00100000
-
-#define TARGET_ORDER_1 (target_flags & MASK_ORDER_1)
-#define TARGET_ORDER_2 (target_flags & MASK_ORDER_2)
-#define TARGET_INT8 (target_flags & MASK_INT8)
-#define TARGET_NO_INTERRUPTS (target_flags & MASK_NO_INTERRUPTS)
-#define TARGET_INSN_SIZE_DUMP (target_flags & MASK_INSN_SIZE_DUMP)
-#define TARGET_CALL_PROLOGUES (target_flags & MASK_CALL_PROLOGUES)
-#define TARGET_TINY_STACK (target_flags & MASK_TINY_STACK)
-#define TARGET_NO_TABLEJUMP (target_flags & MASK_NO_TABLEJUMP)
-#define TARGET_SHORT_CALLS (target_flags & MASK_SHORT_CALLS)
-#define TARGET_ALL_DEBUG (target_flags & MASK_ALL_DEBUG)
-
-#define TARGET_SWITCHES { \
- { "order1", MASK_ORDER_1, NULL }, \
- { "order2", MASK_ORDER_2, NULL }, \
- { "int8", MASK_INT8, N_("Assume int to be 8 bit integer") }, \
- { "no-interrupts", MASK_NO_INTERRUPTS, \
- N_("Change the stack pointer without disabling interrupts") }, \
- { "call-prologues", MASK_CALL_PROLOGUES, \
- N_("Use subroutines for function prologue/epilogue") }, \
- { "tiny-stack", MASK_TINY_STACK, \
- N_("Change only the low 8 bits of the stack pointer") }, \
- { "no-tablejump", MASK_NO_TABLEJUMP, \
- N_("Do not generate tablejump insns") }, \
- { "short-calls", MASK_SHORT_CALLS, \
- N_("Use rjmp/rcall (limited range) on >8K devices") }, \
- { "size", MASK_INSN_SIZE_DUMP, \
- N_("Output instruction sizes to the asm file") }, \
- { "deb", MASK_ALL_DEBUG, NULL }, \
- { "", 0, NULL } }
-
-extern const char *avr_init_stack;
-extern const char *avr_mcu_name;
-
extern const char *avr_base_arch_macro;
extern const char *avr_extra_arch_macro;
extern int avr_mega_p;
@@ -98,10 +51,6 @@ extern int avr_asm_only_p;
#define AVR_MEGA (avr_mega_p && !TARGET_SHORT_CALLS)
#define AVR_ENHANCED (avr_enhanced_p)
-#define TARGET_OPTIONS { \
- { "init-stack=", &avr_init_stack, N_("Specify the initial stack address"), 0}, \
- { "mcu=", &avr_mcu_name, N_("Specify the MCU name"), 0} }
-
#define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
#define OVERRIDE_OPTIONS avr_override_options ()
diff --git a/gcc/config/avr/avr.opt b/gcc/config/avr/avr.opt
new file mode 100644
index 00000000000..8d40f926907
--- /dev/null
+++ b/gcc/config/avr/avr.opt
@@ -0,0 +1,65 @@
+; Options for the ATMEL AVR port of the compiler.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 2, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING. If not, write to the Free
+; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+; 02111-1307, USA.
+
+mcall-prologues
+Target Report Mask(CALL_PROLOGUES)
+Use subroutines for function prologues and epilogues
+
+mmcu=
+Target RejectNegative Joined
+-mmcu=MCU Select the target MCU
+
+mdeb
+Target Report Undocumented Mask(ALL_DEBUG)
+
+minit-stack=
+Target RejectNegative Joined
+-minit-stack=STACK Use STACK as the initial value of the stack pointer
+
+mint8
+Target Report Mask(INT8)
+Use an 8-bit 'int' type
+
+mno-interrupts
+Target Report RejectNegative Mask(NO_INTERRUPTS)
+Change the stack pointer without disabling interrupts
+
+mno-tablejump
+Target Report RejectNegative Mask(NO_TABLEJUMP)
+Do not generate tablejump insns
+
+morder1
+Target Report Undocumented Mask(ORDER_1)
+
+morder2
+Target Report Undocumented Mask(ORDER_2)
+
+mshort-calls
+Target Report Mask(SHORT_CALLS)
+Use rjmp/rcall (limited range) on >8K devices
+
+msize
+Target Report Mask(INSN_SIZE_DUMP)
+Output instruction sizes to the asm file
+
+mtiny-stack
+Target Report Mask(TINY_STACK)
+Change only the low 8 bits of the stack pointer