[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-02-26 Thread John Brawn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG590dc8d02cd7: Use virtual functions in ParsedAttrInfo instead of function pointers (authored by john.brawn). Changed prior to commit: https://reviews.llvm.org/D31337?vs=242363&id=246765#toc Repository:

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-02-26 Thread John Brawn via Phabricator via cfe-commits
john.brawn marked 2 inline comments as done. john.brawn added inline comments. Comment at: clang/lib/Sema/ParsedAttr.cpp:144 + // otherwise return a default ParsedAttrInfo. + if (A.getKind() < sizeof(AttrInfoMap)/sizeof(AttrInfoMap[0])) +return *AttrInfoMap[A.getKind()]; --

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-02-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM aside from a minor nit and a question. Comment at: clang/lib/Sema/ParsedAttr.cpp:144 + // otherwise return a default ParsedAttrInfo. + if (A.getKind() <

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-02-04 Thread John Brawn via Phabricator via cfe-commits
john.brawn updated this revision to Diff 242363. john.brawn added a comment. Move DefaultParsedAttrInfo out of file scope, and move custom appertains-to function generation out of the loop in EmitClangAttrParsedAttrImpl so we only need to use one output stream. CHANGES SINCE LAST ACTION http

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-02-04 Thread John Brawn via Phabricator via cfe-commits
john.brawn marked 2 inline comments as done. john.brawn added inline comments. Comment at: clang/lib/Sema/ParsedAttr.cpp:141 +static ParsedAttrInfo DefaultParsedAttrInfo; static const ParsedAttrInfo &getInfo(const ParsedAttr &A) { aaron.ballman wrote: > Might

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-02-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/ParsedAttr.cpp:141 +static ParsedAttrInfo DefaultParsedAttrInfo; static const ParsedAttrInfo &getInfo(const ParsedAttr &A) { Might as well lower this variable into the function -- no real need for

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-01-22 Thread John Brawn via Phabricator via cfe-commits
john.brawn updated this revision to Diff 239535. john.brawn added a comment. Update based on review comments. Also fix warnings due to missing virtual destructor that I hadn't noticed before. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D31337/new/ https://reviews.llvm.org/D31337 File

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-01-21 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/utils/TableGen/ClangAttrEmitter.cpp:3400 -static std::string GenerateAppertainsTo(const Record &Attr, raw_ostream &OS) { +static void GenerateAppertainsTo(const Record &Attr, raw_ostream &SS, +

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-01-21 Thread John Brawn via Phabricator via cfe-commits
john.brawn marked 4 inline comments as done. john.brawn added inline comments. Comment at: clang/lib/Sema/ParsedAttr.cpp:143 + // otherwise return a default ParsedAttrInfo. + const ParsedAttrInfo *Info = AttrInfoMap[A.getKind()]; + if (Info) erichkeane wrote:

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-01-21 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/Sema/ParsedAttr.cpp:143 + // otherwise return a default ParsedAttrInfo. + const ParsedAttrInfo *Info = AttrInfoMap[A.getKind()]; + if (Info) I don't think you can do this. The only way to get Info as nul

[PATCH] D31337: Use virtual functions in ParsedAttrInfo instead of function pointers

2020-01-21 Thread John Brawn via Phabricator via cfe-commits
john.brawn updated this revision to Diff 239292. john.brawn added reviewers: erichkeane, aaron.ballman, rjmccall. john.brawn set the repository for this revision to rG LLVM Github Monorepo. john.brawn added a subscriber: llvm-commits. john.brawn added a comment. Herald added a project: clang. Heral