[PATCH] D157783: [clang] Add rmissing fields to DeprecatedAttr and UnavailableAttr json AST dump

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 14 06:24:28 PDT 2023


aaron.ballman added inline comments.


================
Comment at: clang/lib/AST/JSONNodeDumper.cpp:541-548
+void JSONNodeDumper::VisitDeprecatedAttr(const DeprecatedAttr *DA) {
+  JOS.attribute("message", DA->getMessage());
+  JOS.attribute("replacement", DA->getReplacement());
+}
+
+void JSONNodeDumper::VisitUnavailableAttr(const UnavailableAttr *UA) {
+  JOS.attribute("message", UA->getMessage());
----------------
I think we should probably skip emitting the field if the field is empty. e.g., `[[deprecated("")]]` and `[[deprecated]]` should have the same output that doesn't have a `message` field; this keeps the JSON dumps somewhat more succinct for those cases. WDYT?


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

https://reviews.llvm.org/D157783



More information about the cfe-commits mailing list