[PATCH] D148700: [clang] Add support for “regular” keyword attributes

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 9 06:02:28 PDT 2023


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/Attr.td:2427-2430
+def ArmStreaming : TypeAttr, TargetSpecificAttr<TargetAArch64> {
+  let Spellings = [RegularKeyword<"__arm_streaming">];
+  let Documentation = [Undocumented];
+}
----------------
I'd feel more comfortable switching an existing attribute over to use this new functionality instead of introducing a new attribute at the same time. (Also, we ask that there be no new undocumented attributes unless there's a Very Good Reason to leave it undocumented.)


================
Comment at: clang/include/clang/Lex/Token.h:122
+
+  /// Return true if K is a keyword that is parsed in the same position as
+  /// a standard attribute, but that has semantic meaning and so cannot be
----------------



================
Comment at: clang/lib/AST/TypePrinter.cpp:1724-1727
+  if (T->getAttrKind() == attr::ArmStreaming) {
+    OS << "__arm_streaming";
+    return;
+  }
----------------
This seems like something that tablegen should automatically handle more generally for these attributes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148700



More information about the cfe-commits mailing list