[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

Bill Wendling via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 30 07:23:49 PDT 2025


================
@@ -3639,6 +3639,64 @@ make the function's CFI jump table canonical. See :ref:`the CFI documentation
   }];
 }
 
+def CFISaltDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Use ``__attribute__((cfi_salt("<salt>")))`` on a function declaration, function
----------------
bwendling wrote:

All good questions. I'm going to see if the attribute could be restricted to C, as I don't think there's a good way to handle any of the issues with virtual functions you mention here.

As for modules/PCH files, those are C++ features, correct? I literally have no experience with them.

Re name mangling: Probably not, as that would be a departure from other attributes, which typically don't interact with name mangling. The example you gave in C would result in a runtime error. Not ideal, but possibly the correct behavior.

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


More information about the cfe-commits mailing list