[llvm] [CodeGen][ARM64EC] Mangle EH personality handler names (PR #121652)

Billy Laws via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 15:46:05 PST 2025


================
@@ -807,6 +807,17 @@ bool AArch64Arm64ECCallLowering::runOnModule(Module &Mod) {
   SetVector<GlobalAlias *> PatchableFns;
 
   for (Function &F : Mod) {
+    if (F.hasPersonalityFn()) {
+      GlobalValue *PersFn =
+          cast<GlobalValue>(F.getPersonalityFn()->stripPointerCasts());
+      if (PersFn->getValueType() && PersFn->getValueType()->isFunctionTy()) {
+        if (std::optional<std::string> MangledName =
+                getArm64ECMangledFunctionName(PersFn->getName().str())) {
+          PersFn->setName(MangledName.value());
----------------
bylaws wrote:

>From my testing with msvc it seems like only a reference to the mangled function is emitted and x86 personality functions aren't supported 

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


More information about the llvm-commits mailing list