aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr/avr-c.c
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2013-01-17 17:14:53 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2013-01-17 17:14:53 +0000
commite52a8b712b7e831d71d208aadae7be74ee19b1f5 (patch)
treea9ef2351cc3cafdba3f141d533b81f32fb43e490 /gcc/config/avr/avr-c.c
parent610fb637256be2bd904fac22a683b45d2d9294da (diff)
downloadgcc-e52a8b712b7e831d71d208aadae7be74ee19b1f5.zip
gcc-e52a8b712b7e831d71d208aadae7be74ee19b1f5.tar.gz
gcc-e52a8b712b7e831d71d208aadae7be74ee19b1f5.tar.bz2
builtins.def (DEF_BUILTIN): Factor out "__builtin_avr_" from NAME, turn NAME to an uppercase identifier.
* config/avr/builtins.def (DEF_BUILTIN): Factor out "__builtin_avr_" from NAME, turn NAME to an uppercase identifier. Factor out 'CODE_FOR_' from ICODE, use 'nothing' instead of '-1'. Remove ID. Adjust comments. * config/avr/avr-c.c (avr_builtin_name): Remove. (avr_cpu_cpp_builtins): Use DEF_BUILTIN instead of for-loop. * config/avr/avr.c (avr_tolower): New static function. (DEF_BUILTIN): Remove parameter ID. Prefix ICODE by 'CODE_FOR_'. Stringify NAME, prefix it with "__builtin_avr_" and lowercase it. (avr_expand_builtin): Assert insn_code != CODE_FOR_nothing for default expansion. From-SVN: r195276
Diffstat (limited to 'gcc/config/avr/avr-c.c')
-rw-r--r--gcc/config/avr/avr-c.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/gcc/config/avr/avr-c.c b/gcc/config/avr/avr-c.c
index 2685f4b..075d9ef 100644
--- a/gcc/config/avr/avr-c.c
+++ b/gcc/config/avr/avr-c.c
@@ -70,14 +70,6 @@ avr_toupper (char *up, const char *lo)
/* Worker function for TARGET_CPU_CPP_BUILTINS. */
-static const char *const avr_builtin_name[] =
- {
-#define DEF_BUILTIN(NAME, N_ARGS, ID, TYPE, CODE) NAME,
-#include "builtins.def"
-#undef DEF_BUILTIN
- NULL
- };
-
void
avr_cpu_cpp_builtins (struct cpp_reader *pfile)
{
@@ -176,13 +168,10 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
/* Define builtin macros so that the user can easily query whether or
not a specific builtin is available. */
- for (i = 0; avr_builtin_name[i]; i++)
- {
- const char *name = avr_builtin_name[i];
- char *Name = (char*) alloca (1 + strlen (name));
-
- cpp_define (pfile, avr_toupper (Name, name));
- }
+#define DEF_BUILTIN(NAME, N_ARGS, TYPE, CODE) \
+ cpp_define (pfile, "__BUILTIN_AVR_" #NAME);
+#include "builtins.def"
+#undef DEF_BUILTIN
/* Builtin macros for the __int24 and __uint24 type. */