vtjnash wrote:

I think, from reading the code, that currently the only way to do that would be 
to guess at the internal name and then define an alias that prevents the 
compiler from creating the function using CreateRuntimeFunction call:
```c++
extern "C" {
static void fake__C_specific_handler(...);
static void __C_specific_handler(...) 
__attribute__((alias("fake__C_specific_handler")));
}
```

To intercept this call:
```c++
static llvm::FunctionCallee getPersonalityFn(CodeGenModule &CGM,
                                             const EHPersonality &Personality) {
  return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty, true),
                                   Personality.PersonalityFn,
                                   llvm::AttributeList(), /*Local=*/true);
}
```

https://github.com/llvm/llvm-project/pull/176952
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to