Hi all,

I'm looking at implementing target attributes for aarch64 and I have some 
questions about the hooks involved.
I haven't looked at this part of the compiler before, so forgive me if some of 
them seem obvious. I couldn't
figure it out from the documentation 
(https://gcc.gnu.org/onlinedocs/gccint/Target-Attributes.html#Target-Attributes)

* Seems to me that TARGET_OPTION_VALID_ATTRIBUTE_P is the most important one 
that parses
the string inside the __attribute__ ((target ("..."))) and sets the 
target-specific
flags appropriately. Is that correct?

* What is TARGET_ATTRIBUTE_TABLE used for? It's supposed to map attributes to 
handlers?
Isn't that what TARGET_OPTION_VALID_ATTRIBUTE_P is for?

* What is the use of TARGET_OPTION_SAVE and TARGET_OPTION_RESTORE? Is that used 
during
 something like LTO when different object files and functions are compiled with 
different
flags? Are these functions just supposed to 'backup' various tuning and ISA 
decisions?

* Is TARGET_COMP_TYPE_ATTRIBUTES the one that's supposed to handle incompatible 
attributes
being specified? (for example incompatible endianness or architecture levels)?

Thanks for any insight,
Kyrill

Reply via email to