[PATCH] D79121: Add nomerge function attribute to clang

2020-05-18 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. I think this looks good and @zequanwu has addressed the concerns of other reviewers. Please wait until Wednesday before pushing in case they raise other concerns. Comment at:

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-15 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79121/new/ https://reviews.llvm.org/D79121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-08 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 262971. zequanwu marked an inline comment as done. zequanwu added a comment. use `ConstEvaluatedExprVisitor` to recursively looking up for call expr CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79121/new/ https://reviews.llvm.org/D79121 Files:

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-08 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaStmtAttr.cpp:178 +return true; + return llvm::any_of(S->children(), hasCallExpr); +} zequanwu wrote: > rsmith wrote: > > This will recurse into too much (eg, the bodies of lambdas and blocks, and

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-08 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 262922. zequanwu added a comment. use `ConstStmtVisitor` to do recursive lookup for call expression. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79121/new/ https://reviews.llvm.org/D79121 Files: clang/include/clang/Basic/Attr.td

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-05 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: clang/lib/Sema/SemaStmtAttr.cpp:178 +return true; + return llvm::any_of(S->children(), hasCallExpr); +} rsmith wrote: > This will recurse into too much (eg, the bodies of

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-04 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaStmtAttr.cpp:178 +return true; + return llvm::any_of(S->children(), hasCallExpr); +} This will recurse into too much (eg, the bodies of lambdas and blocks, and unevaluated operands). It would be

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-04 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added inline comments. Comment at: clang/lib/CodeGen/CGStmt.cpp:611 void CodeGenFunction::EmitAttributedStmt(const AttributedStmt ) { + for (const auto *A: S.getAttrs()) +if (A->getKind() == attr::NoMerge) { rnk wrote: > Can we use S.hasAttr, or

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-04 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 261973. zequanwu marked 10 inline comments as done. zequanwu added a comment. To keep it simple, `nomerge` attribute should not be applied to decl statement. Since label statement calls `ProcessDeclAttributeList` to handle attributes, label statement

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-04 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/lib/CodeGen/CGStmt.cpp:611 void CodeGenFunction::EmitAttributedStmt(const AttributedStmt ) { + for (const auto *A: S.getAttrs()) +if (A->getKind() == attr::NoMerge) { Can we use S.hasAttr, or does that not exist

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-04 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:2755-2756 +def warn_nomerge_attribute_ignored_in_stmt: Warning< + "%0 attribute is ignored because there exists no call expression inside the " + "statement">; def

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-03 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 261698. zequanwu marked 4 inline comments as done. zequanwu added a comment. Add Sema test. Check if nomerge attribute has no arguments and statement contains call expressions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79121/new/

[PATCH] D79121: Add nomerge function attribute to clang

2020-05-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. This is missing Sema tests ensuring that the attribute only appertains to the correct subject, does not accept arguments, etc. Comment at: clang/include/clang/Basic/AttrDocs.td:356 + let Content = [{ +Calls to functions marked `nomerge` will

[PATCH] D79121: Add nomerge function attribute to clang

2020-04-30 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 261406. zequanwu added a comment. change `nomerge` to statement attribute CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79121/new/ https://reviews.llvm.org/D79121 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td

[PATCH] D79121: Add nomerge function attribute to clang

2020-04-30 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1799 + let Spellings = [Clang<"nomerge">]; + let Subjects = SubjectList<[Function]>; + let Documentation = [NoMergeDocs]; rnk wrote: > aaron.ballman wrote: > > zequanwu wrote: > > > rnk

[PATCH] D79121: Add nomerge function attribute to clang

2020-04-30 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1799 + let Spellings = [Clang<"nomerge">]; + let Subjects = SubjectList<[Function]>; + let Documentation = [NoMergeDocs]; aaron.ballman wrote: > zequanwu wrote: > > rnk wrote: > > >

[PATCH] D79121: Add nomerge function attribute to clang

2020-04-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: aaron.ballman. aaron.ballman added a comment. This should also have Sema tests ensuring that it only applies to the correct subjects, accepts no arguments, etc. Comment at: clang/include/clang/Basic/Attr.td:1799 + let Spellings =

[PATCH] D79121: Add nomerge function attribute to clang

2020-04-30 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 261292. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79121/new/ https://reviews.llvm.org/D79121 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td clang/lib/CodeGen/CGCall.cpp clang/test/CodeGen/attr-nomerge.c

[PATCH] D79121: Add nomerge function attribute to clang

2020-04-30 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked 2 inline comments as done. zequanwu added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1799 + let Spellings = [Clang<"nomerge">]; + let Subjects = SubjectList<[Function]>; + let Documentation = [NoMergeDocs]; rnk wrote: >

[PATCH] D79121: Add nomerge function attribute to clang

2020-04-29 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1799 + let Spellings = [Clang<"nomerge">]; + let Subjects = SubjectList<[Function]>; + let Documentation = [NoMergeDocs]; Clang supports many function-like things that are not functions,

[PATCH] D79121: Add nomerge function attribute to clang

2020-04-29 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu created this revision. zequanwu added a reviewer: rnk. zequanwu added a project: clang. Herald added a subscriber: cfe-commits. Related to D78659 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D79121 Files: