]> gcc.gnu.org Git - gcc.git/commit
LoongArch: gcc12: Implement option save/restore.
authorLulu Cheng <chenglulu@loongson.cn>
Fri, 15 Mar 2024 08:41:20 +0000 (16:41 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Mon, 1 Apr 2024 03:22:28 +0000 (11:22 +0800)
commitbf0b32d7929f8b4b15b21658d572b89ded03d8f8
treef897a9cf4a2580fbb4e3bfed3c850cf193b355c8
parent910ca284e386919d8b9ceda29faa125387ef9881
LoongArch: gcc12: Implement option save/restore.

LTO option streaming and target attributes both require per-function
target configuration, which is achieved via option save/restore.

We implement TARGET_OPTION_{SAVE,RESTORE} to switch the la_target
context in addition to other automatically maintained option states
(via the "Save" option property in the .opt files).

PR target/113233

gcc/ChangeLog:

* config/loongarch/genopts/loongarch.opt.in: Mark options with
the "Save" property.
* config/loongarch/loongarch-opts.cc
(loongarch_update_gcc_opt_status): Update the value of the
la_target to global_options.
* config/loongarch/loongarch-opts.h
(loongarch_update_gcc_opt_status): Add a function declaration.
* config/loongarch/loongarch.cc
(loongarch_option_override_internal): Call the function
loongarch_update_gcc_opt_status.
(loongarch_option_save): New functions.
(loongarch_option_restore): Likewise.
(TARGET_OPTION_SAVE): Define macro.
(TARGET_OPTION_RESTORE): Likewise.
* config/loongarch/loongarch.opt: Regenerate.

(cherry picked from commit ea2a9c76a1dcffbbec6e53655bef9236d3a8e691)
gcc/config/loongarch/genopts/loongarch.opt.in
gcc/config/loongarch/loongarch-opts.cc
gcc/config/loongarch/loongarch-opts.h
gcc/config/loongarch/loongarch.cc
gcc/config/loongarch/loongarch.opt
This page took 0.066612 seconds and 6 git commands to generate.