This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add rmissing fields to DeprecatedAttr and UnavailableAttr json AST dump
ClosedPublic

Authored by serge-sans-paille on Aug 12 2023, 8:25 AM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2023, 8:25 AM
serge-sans-paille requested review of this revision.Aug 12 2023, 8:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2023, 8:25 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
serge-sans-paille retitled this revision from [clang] Add reason and replacement fields to DeprecatedAttr json AST dump to [clang] Add rmissing fields to DeprecatedAttr and UnavailableAttr json AST dump.

+ Unavailable attr

aaron.ballman added inline comments.Aug 14 2023, 6:24 AM
clang/lib/AST/JSONNodeDumper.cpp
541–548

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?

Only output extra fields if they are not empty

serge-sans-paille marked an inline comment as done.Aug 14 2023, 7:46 AM

Review taken into account. Thanks for handling this batch of patches o/

This revision is now accepted and ready to land.Aug 14 2023, 8:11 AM
This revision was landed with ongoing or failed builds.Aug 14 2023, 2:01 PM
This revision was automatically updated to reflect the committed changes.