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:
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()];
--
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() <
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
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
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
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
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,
+
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:
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
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
11 matches
Mail list logo