[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

Jon Roelofs via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 17 09:22:31 PDT 2024


jroelofs wrote:

The current patch looks mostly good, but I'm still hung up on this:

> I'd like to support FMV in existing codebases as lean as possible, so the default version attribute would be optional to write as not all version/toolchain will support it. smallest possible codebase change to introduce multi versioning:
> 
> ```c
>  int foo(void);
> 
> + #ifdef __HAVE_FUNCTION_MULTI_VERSIONING
> + int __attribute__((target_version("feature"))) foo(void);
> + #endif
> ```

Are you imagining this would multi-version between the un-decorated `int foo(void);` and the `int __attribute__((target_version("feature"))) foo(void);` decorated one? In the current patch, it just gets the non-mangled name. And the fact that we get a not-mangled function that uses `feature` without going through a resolver is concerning to me.

https://github.com/llvm/llvm-project/pull/84405


More information about the cfe-commits mailing list