Skip to content
Snippets Groups Projects
user avatar
Yangyu Chen authored
This patch implements the TARGET_OPTION_VALID_VERSION_ATTRIBUTE_P for
RISC-V. This hook is used to process attribute
((target_version ("..."))).

As it is the first patch which introduces the target_version attribute,
we also set TARGET_HAS_FMV_TARGET_ATTRIBUTE to 0 to use "target_version"
for function versioning.

Co-Developed-by: default avatarHank Chang <hank.chang@sifive.com>
Signed-off-by: default avatarYangyu Chen <cyy@cyyself.name>

gcc/ChangeLog:

	* config/riscv/riscv-protos.h
	(riscv_process_target_attr): Remove as it is not used.
	(riscv_option_valid_version_attribute_p): Declare.
	(riscv_process_target_version_attr): Declare.
	* config/riscv/riscv-target-attr.cc
	(riscv_target_attrs): Renamed from riscv_attributes.
	(riscv_target_version_attrs): New attributes for target_version.
	(riscv_process_one_target_attr): New arguments to select attrs.
	(riscv_process_target_attr): Likewise.
	(riscv_option_valid_attribute_p): Likewise.
	(riscv_process_target_version_attr): New function.
	(riscv_option_valid_version_attribute_p): New function.
	* config/riscv/riscv.cc
	(TARGET_OPTION_VALID_VERSION_ATTRIBUTE_P): Implement it.
	* config/riscv/riscv.h (TARGET_HAS_FMV_TARGET_ATTRIBUTE): Define
	it to 0 to use "target_version" for function versioning.
bd975bd1
History
Name Last commit Last update