[clang] Mark CXX module initializer with PACBTI attributes (PR #133716)

Victor Campos via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 4 03:56:28 PDT 2025


================
@@ -818,6 +818,12 @@ void CodeGenModule::EmitCXXModuleInitFunc(Module *Primary) {
     Fn->addFnAttr("device-init");
   }
 
+  if (getTarget().isBranchProtectionSupportedArch(
+          getTarget().getTargetOpts().CPU)) {
+    TargetInfo::BranchProtectionInfo BPI(getLangOpts());
+    getTargetCodeGenInfo().setBranchProtectionFnAttributes(BPI, (*Fn));
----------------
vhscampos wrote:

Thanks. I'll make the required changes to use `setTargetAttributes`.

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


More information about the cfe-commits mailing list