Improve RecordVal JSON formatting

No need to create a record introspection table each time when all
the required information can be obtained directly in the RecordVal
and RecordType objects.  Besides the additional overhead, using such
a table will re-order the fields arbitrarily instead of using the
order in which they're defined.
This commit is contained in:
Jon Siwek 2019-09-30 19:04:55 -07:00
parent d258ebe5ca
commit a34ade4876
4 changed files with 25 additions and 24 deletions

View file

@ -498,6 +498,12 @@ public:
return decl && decl->FindAttr(ATTR_DEPRECATED) != 0;
}
bool FieldHasAttr(int field, attr_tag at) const
{
const TypeDecl* decl = FieldDecl(field);
return decl && decl->FindAttr(at) != 0;
}
string GetFieldDeprecationWarning(int field, bool has_check) const;
protected: