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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 9 10:50:16 PDT 2026


================
@@ -1655,6 +1655,15 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
 
   PGO->verifyCounterMap();
 
+  if (CurCodeDecl->hasAttr<PersonalityAttr>()) {
+    StringRef Identifier =
+        CurCodeDecl->getAttr<PersonalityAttr>()->getRoutine()->getName();
+    llvm::FunctionCallee PersonalityRoutine =
+        CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty, true),
----------------
erichkeane wrote:

Part of my concern here though is that if we emit one with `createRuntimeFunction`, then the LLVM type doesn't match elsewhere from one of those signatures, is we end up having typemismatch concerns in LLVM, right?  So how do we resolve that?

Perhaps the issue is still that the documentation isn't clear enough for someone not intimately familiar with this to review it.

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


More information about the cfe-commits mailing list