[PATCH] D110116: [Clang] Ignore BTFTag attr if used as a type attribute

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 21 05:43:23 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaType.cpp:8132
 
+    case ParsedAttr::AT_BTFTag:
+      // FIXME: Linux kernel may also use this attribute for type casting check,
----------------
Errr, this attribute isn't a type attribute in the first place, so I'd feel more comfortable if this was also modified in Attr.td to be a `DeclOrTypeAttr` instead of an `InheritableAttr`.

There should also be a change to AttrDocs.td to explain what's going on.


================
Comment at: clang/test/Sema/attr-btf_tag.c:45
+void __tag1 * convert(long arg) {
+  return (void __tag1 *)arg;
+}
----------------
I'd appreciate a FIXME comment here about why this is silently accepted but does nothing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110116/new/

https://reviews.llvm.org/D110116



More information about the cfe-commits mailing list