[PATCH] D111548: [Clang] Add the `annotate_type` attribute

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 09:00:17 PDT 2022


xazax.hun added inline comments.


================
Comment at: clang/include/clang/Basic/AttrDocs.td:6387
+additional information specific to the annotation category. The optional
+arguments must be constant expressions of arbitrary type.
+
----------------
Do we want to mention that it is not actually part of the type system (i.e., annotated and unannotated types are considered the same)?


================
Comment at: clang/include/clang/Basic/AttrDocs.td:6393
+
+  int* [[clang::annotate("category1", "foo", 1)]] f(int[[clang::annotate("category2"]] *);
+
----------------
Missing closing paren for the second annotate. 


================
Comment at: clang/lib/AST/TypePrinter.cpp:1686
+  // would require retrieving the attribute arguments, which we don't have here.
+  if (T->getAttrKind() == attr::AnnotateType)
+    return;
----------------
Would it make sense to print something without the arguments? I wonder which behavior would be less confusing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111548



More information about the cfe-commits mailing list