aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2024-11-11 12:32:13 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2024-11-11 12:32:13 +0000
commit9d14f677a0da80bc6355955469c69709b1d3c67e (patch)
tree32915e2302ca5aa12385dc1576e6d06a72c687b7 /gcc/config.gcc
parente22d80d4f0f8d33f538c1a4bad07b2c819a6d55c (diff)
downloadgcc-9d14f677a0da80bc6355955469c69709b1d3c67e.zip
gcc-9d14f677a0da80bc6355955469c69709b1d3c67e.tar.gz
gcc-9d14f677a0da80bc6355955469c69709b1d3c67e.tar.bz2
Add push/pop_function_decl
For the aarch64 simd clones patches, it would be useful to be able to push a function declaration onto the cfun stack, even though it has no function body associated with it. That is, we want cfun to be null, current_function_decl to be the decl itself, and the target and optimisation flags to reflect the declaration. This patch adds a push/pop_function_decl pair to do that. I think the more direct way of doing what I want to do under the existing interface would have been: push_cfun (nullptr); invoke_set_current_function_hook (fndecl); pop_cfun (); where invoke_set_current_function_hook would need to become public. But it seemed safer to use the higher-level routines, since it makes sure that the target/optimisation changes are synchronised with the function changes. In particular, if cfun was null before the sequence above, the pop_cfun would leave the flags unchanged, rather than restore them to the state before the push_cfun. gcc/ * function.h (push_function_decl, pop_function_decl): Declare. * function.cc (set_function_decl): New function, extracted from... (set_cfun): ...here. (push_function_decl): New function, extracted from... (push_cfun): ...here. (pop_cfun_1): New function, extracted from... (pop_cfun): ...here. (pop_function_decl): New function.
Diffstat (limited to 'gcc/config.gcc')
0 files changed, 0 insertions, 0 deletions