================
@@ -3042,8 +3042,23 @@ def BTFTypeTagDocs : Documentation {
let Category = DocCatType;
let Content = [{
Clang supports the ``__attribute__((btf_type_tag("ARGUMENT")))`` attribute for
-all targets. It only has effect when ``-g`` is specified on the command line
and
-is currently silently ignored when not applied to a pointer type (note: this
+all targets. It only has effect when ``-g`` is specified on the command line.
+
+The attribute can be applied to a pointer type, in which case the tag is
+associated with the pointee type, e.g.:
+
+.. code-block:: c
+
+ int __attribute__((btf_type_tag("tag"))) *p;
+
+It can also be applied to the underlying type of a typedef, in which case the
+tag follows the typedef down to its base type, e.g.:
+
+.. code-block:: c
+
+ typedef struct foo __attribute__((btf_type_tag("tag"))) foo_t;
+
+The attribute is currently silently ignored in any other position (note: this
----------------
eddyz87 wrote:
Maybe expand this a bit by showing how BTF looks for the examples above?
Otherwise it is a bit harder to understand what does it mean for the to be
associated with the pointee/underlying type.
https://github.com/llvm/llvm-project/pull/203089
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits