[clang] [Parser][BoundsSafety] Print attribute as macro if it's system defined (PR #107619)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 16 07:07:27 PDT 2024


================
@@ -1105,16 +1120,16 @@ enum AttributeDeclKind {
 
 inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
                                              const ParsedAttr &At) {
-  DB.AddTaggedVal(reinterpret_cast<uint64_t>(At.getAttrName()),
+  const IdentifierInfo *AttrName =
+      At.printAsMacro() ? At.getMacroIdentifier() : At.getAttrName();
+  DB.AddTaggedVal(reinterpret_cast<uint64_t>(AttrName),
----------------
erichkeane wrote:

I like the idea of printing the attribute name as well in the same message (or in a note), I think that is valuable.

https://github.com/llvm/llvm-project/pull/107619


More information about the cfe-commits mailing list