[clang] Basic, Sema: introduce `__attribute__((__personality__(...)))` (PR #185225)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 9 07:57:39 PDT 2026


compnerd wrote:

> However, creating an arbitrary runtime function without ensuring that we don't have an existing "user defined" function here is concerning. What happens if you assign a 'personality' to the name of a different function? Is that not problematic? Particularly if the type doesn't match?

I understand and acknowledge the concern.

I think the question is what is "user defined"? In some senses it is exactly what we need here - the user is the language runtime author.

The conflict issue exists today as well. I could define my own implementation of the C or C++ personality and cause that conflict, which would likely be given higher precedence by the linker being locally defined.

We can certainly do more type checking on the personality routine. Keep in mind that even for cases where we could in theory do more today (`__gxx_personality_v0` from libc++abi) we do not.

I agree that any additional analysis that we can do, the better it is, but the possibility of preventing misuse is difficult when it is such low level.

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


More information about the cfe-commits mailing list