================
@@ -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:
> > I'm going to see if the attribute could be restricted to C
>
> If you do restrict to C, then that should be all of the CFI attributes which
> are restricted to C? If so, we should definitely move on that before Clang 21
> is released.
I don't see why *all* CFI attributes should be restricted to C. There may be
some which can be for both, depending on circumstances.
I may change the name of this attribute 'kcfi_seed' to indicate that it's
fairly specifically meant for kernel code.
> > As for modules/PCH files, those are C++ features, correct? I literally have
> > no experience with them.
>
> Modules are a C++ feature, but PCH files are both C and C++ (precompiled
> headers). Basically, when you include a PCH file it's the same as including a
> textual header but instead you're including a serialized binary blob
> representing the textual header, so you can run into the same situations with
> invalid redeclarations. But I _think_ that's handled in a sufficiently
> generic way that you should be fine without any custom logic.
This would be a generic problem for all PCH's then; not just this one.
> > Re name mangling:
>
> This goes back to whether it's impacting the function type. Generally that's
> only an issue in C++, but we have the `overloadable` attribute which allows
> for overloading in C. And the way that's implemented is that it basically
> uses the C++ logic, including name mangling. So we may have to care about it,
> but if the salt attribute is not part of the function type, then there's no
> overloads and no need to worry.
Okay, sure.
https://github.com/llvm/llvm-project/pull/141846
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits