[patch,avr] Tidy builtins.def

Georg-Johann Lay avr@gjlay.de
Tue Jan 15 14:54:00 GMT 2013


This patch factors out stuff from builtins.def that is used again and again.
Strings like the "__builtin_avr_" common to all builtins is moved to the
implementation of DEF_BUILTIN.

Similar for ICODE and CODE_FOR_.

ID is no more needed, the needed enums are derived from NAME.

There is no functional change, the only purpose is an easier and better
legibility of builtins.def and reduced redundancies.

Lightly tested.

Ok for trunk?

Johann


	* config/avr/builtins.def (DEF_BUILTIN): Factor out "__builtin_avr_"
	from NAME and 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: builtin-refact.diff
Type: text/x-patch
Size: 7469 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130115/2b4d7895/attachment.bin>


More information about the Gcc-patches mailing list