On 04/10/2025 22:15, Jeff Law wrote:


On 10/3/25 12:27 PM, Yangyu Chen wrote:
This patch adds support for target_clones table option. The
target_clones table option allows users to specify multiple versions
of a function and select the version at runtime based on the specified
table.

The target clone table is a JSON object where function names serve as
keys, and their values are nested objects. Each nested object maps
architecture names to lists of target clone attributes. This structure
allows specifying function clones for different architectures. Below is
an example:
So how is this expected to interact with languages that mangle names? Is the mangled named used in the json file?  How are you going to handle lookups in that scenario?

I think the documentation needs a bit more work -- unlike an option that just toggles a code generation feature on/off, this feature needs to actually document the format of the json file, preferably with an embedded example.  It'll need to touch on limitations (is it specific to a subset of languages, how is mangling handled, etc).

So at this point it looks like an interesting idea with a proof of concept.  Assuming you have a reasonable answer for how to deal with other languages, then the question I think we need to answer (as a project) is whether or not we want the feature.
Hi all,

As this seems to have stalled out slightly, I will put my vote on the side of wanting this feature.

It is something we're quite interested in and can imagine several uses for. We were looking into doing something very similar so this solves an issue for us.

Alfie>
Jeff



Reply via email to