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

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 12 03:45:00 PST 2025


================
@@ -25,7 +26,14 @@ EHPersonality llvm::classifyEHPersonality(const Value *Pers) {
       Pers ? dyn_cast<GlobalValue>(Pers->stripPointerCasts()) : nullptr;
   if (!F || !F->getValueType() || !F->getValueType()->isFunctionTy())
     return EHPersonality::Unknown;
-  return StringSwitch<EHPersonality>(F->getName())
+
+  std::string Name = F->getName().str();
+  if (Triple(F->getParent()->getTargetTriple()).isWindowsArm64EC()) {
+    if (auto DemangledName = getArm64ECDemangledFunctionName(Name))
+      Name = *DemangledName;
----------------
cjacek wrote:

Since we're recognizing only C symbols here anyway, I guess we could use `StringRef` for the name and `consume_front("#")` here.

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


More information about the llvm-commits mailing list