Add a generic lhd_simulate_enum_decl
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 7 Jan 2020 10:21:26 +0000 (10:21 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 7 Jan 2020 10:21:26 +0000 (10:21 +0000)
commitab341f5003f8ad9f5ee30ce566d68d8284a31f00
tree0bf5b28df193c9cc10990bf5bd48d954dbc5afa9
parent683e93d1975f676d00096b7c93b942dbd0491800
Add a generic lhd_simulate_enum_decl

Normally we only create SVE ACLE functions when arm_sve.h is included.
But for LTO we need to do it at start-up, so that the functions are
already defined when streaming in the LTO objects.

One hitch with doing that is that LTO doesn't yet implement the
simulate_enum_decl langhook.  This patch adds a simple default
implementation that it can use.

2020-01-07  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* langhooks-def.h (lhd_simulate_enum_decl): Declare.
(LANG_HOOKS_SIMULATE_ENUM_DECL): Use it.
* langhooks.c: Include stor-layout.h.
(lhd_simulate_enum_decl): New function.
* config/aarch64/aarch64-sve-builtins.cc (init_builtins): Call
handle_arm_sve_h for the LTO frontend.
(register_vector_type): Cope with null returns from pushdecl.

gcc/testsuite/
* gcc.target/aarch64/sve/pcs/asm_4.c: New test.

From-SVN: r279954
gcc/ChangeLog
gcc/config/aarch64/aarch64-sve-builtins.cc
gcc/langhooks-def.h
gcc/langhooks.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/pcs/asm_4.c [new file with mode: 0644]