Bernd Schmidt <bschm...@redhat.com> writes: > On 11/07/2015 01:22 PM, Richard Sandiford wrote: >> I'm working on a patch series that needs to be able to treat built-in >> functions and internal functions in a similar way. This patch adds a >> new enum, combined_fn, that combines the two together. It also adds >> utility functions for seeing which combined_fn (if any) is called by >> a given CALL_EXPR or gcall. >> >> Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. >> OK to install? > > I see it's already acked, but have you considered just doing away with > the builtin/internal function distinction?
I think they're too different to be done away with entirely. built-in functions map directly to a specific C-level callable function and must have an fndecl, whereas no internal function should have an fndecl. Whether a built-in function is available depends on the selected language and what declarations the front-end has seen, while whether an internal function is available depends entirely on GCC internal information. We always have the option of not handling a built-in function specially and simply calling its function in the normal way, whereas for internal functions we always need to opencode the function in GCC. Thanks, Richard