On 28/04/2022 10:08, Andrea Corallo via Gcc-patches wrote:
Hi all,

This change refactors all the mbranch-protection option parsing code and
types to make it common to both AArch32 and AArch64 backends.

This change also pulls in some supporting types from AArch64 to make
it common (aarch_parse_opt_result).

The significant changes in this patch are the movement of all branch
protection parsing routines from aarch64.c to aarch-common.c and
supporting data types and static data structures.

This patch also pre-declares variables and types required in the
aarch32 back-end for moved variables for function sign scope and key
to prepare for the impending series of patches that support parsing
the feature mbranch-protection in the aarch32 back-end.

This patch implements the changes requested and was pre-approved here
<https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586139.html>.

gcc/ChangeLog:

        * common/config/aarch64/aarch64-common.cc: Include aarch-common.h.
        (all_architectures): Fix comment.
        (aarch64_parse_extension): Rename return type, enum value names.
        * config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Rename
        factored out aarch_ra_sign_scope and aarch_ra_sign_key variables.
        Also rename corresponding enum values.
        * config/aarch64/aarch64-opts.h (aarch64_function_type): Factor
        out aarch64_function_type and move it to common code as
        aarch_function_type in aarch-common.h.
        * config/aarch64/aarch64-protos.h: Include common types header,
        move out types aarch64_parse_opt_result and aarch64_key_type to
        aarch-common.h
        * config/aarch64/aarch64.cc: Move mbranch-protection parsing types
        and functions out into aarch-common.h and aarch-common.cc.  Fix up
        all the name changes resulting from the move.
        * config/aarch64/aarch64.md: Fix up aarch64_ra_sign_key type name change
        and enum value.
        * config/aarch64/aarch64.opt: Include aarch-common.h to import
        type move.  Fix up name changes from factoring out common code and
        data.
        * config/arm/aarch-common-protos.h: Export factored out routines to both
        backends.
        * config/arm/aarch-common.cc: Include newly factored out types.  Move 
all
        mbranch-protection code and data structures from aarch64.cc.
        * config/arm/aarch-common.h: New header that declares types shared
        between aarch32 and aarch64 backends.
        * config/arm/arm-protos.h: Declare types and variables that are
        made common to aarch64 and aarch32 backends - aarch_ra_sign_key,
        aarch_ra_sign_scope and aarch_enable_bti.

Co-Authored-By: Tejas Belagod  <tbela...@arm.com>


OK, but please wait for the rest of this series to be approved before applying.

R.

Reply via email to