]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/arm/arm-protos.h
[PATCH 1/15] arm: Make mbranch-protection opts parsing common to AArch32/64
authorAndrea Corallo <andrea.corallo@arm.com>
Mon, 6 Dec 2021 10:34:35 +0000 (11:34 +0100)
committerAndrea Corallo <andrea.corallo@arm.com>
Mon, 23 Jan 2023 10:20:09 +0000 (11:20 +0100)
commitd8dadbc9a5199bf7bac1ab7376b0f84f45e94350
tree17ca1cb26898d0d6c537dcc3fe5b4c871e2e940f
parent47465fff9738b08796f4b52570fec49bbdbf3e57
[PATCH 1/15] arm: Make mbranch-protection opts parsing common to AArch32/64

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.

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.
* config/arm/arm.opt (config/arm/aarch-common.h): Include header.
(aarch_ra_sign_scope, aarch_enable_bti): Declare variable.
* config/arm/arm.cc: Add missing includes.

Co-Authored-By: Tejas Belagod <tbelagod@arm.com>
13 files changed:
gcc/common/config/aarch64/aarch64-common.cc
gcc/config/aarch64/aarch64-c.cc
gcc/config/aarch64/aarch64-opts.h
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.cc
gcc/config/aarch64/aarch64.md
gcc/config/aarch64/aarch64.opt
gcc/config/arm/aarch-common-protos.h
gcc/config/arm/aarch-common.cc
gcc/config/arm/aarch-common.h [new file with mode: 0644]
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.cc
gcc/config/arm/arm.opt