]> git.ipfire.org Git - people/ms/gcc.git/commit
d: Delay removing DECL_EXTERNAL from thunks until funcion has finished
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 13 Mar 2023 21:04:24 +0000 (22:04 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Mon, 13 Mar 2023 21:18:20 +0000 (22:18 +0100)
commitbcf467a1dfa7afcde57f4c132d1b666778145c93
tree9da4bd31cdced1d59fc0873aaf8716fdeb41c089
parent9cf0823836bd50d6a6be4d656da79b5cba45c02d
d: Delay removing DECL_EXTERNAL from thunks until funcion has finished

Second part to fixing PR109108, don't blindly generate the associated
function definition of all referenced thunks in the compilation. Just
delay finishing a thunk until the function gets codegen itself.  If the
function never gets a definition, then the thunk is left as "extern".

gcc/d/ChangeLog:

* decl.cc (finish_thunk): Unset DECL_EXTERNAL on thunk.
(make_thunk): Set DECL_EXTERNAL on thunk, don't call build_decl_tree.
(finish_function): Call finish_thunk on forward referenced thunks.

(cherry picked from commit d1bddcaf15a362d88c29337295a0aaaaaa037642)
gcc/d/decl.cc