[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-13 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG49bffa5f8b79: [clang-tidy] misc-no-recursion: a new check (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72362/new/ https://reviews

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 244509. lebedev.ri marked 8 inline comments as done. lebedev.ri added a comment. In D72362#1874690 , @aaron.ballman wrote: > LGTM aside from some nits. Thank you for the review! Nits addressed. Repository: rG

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-13 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 some nits. Comment at: clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp:70 + +template class SmartSmallSetVector { +public: -

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp:28 +// 2. it is immutable, the way it was constructed it will stay. +template class ImmutableSmartSet { + ArrayRef Vector; aaron.ballman wrote: > "Smart" is not

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 244354. lebedev.ri marked 16 inline comments as done and an inline comment as not done. lebedev.ri added a comment. Ping. @aaron.ballman thank you for taking a look! Addressed review notes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp:28 +// 2. it is immutable, the way it was constructed it will stay. +template class ImmutableSmartSet { + ArrayRef Vector; "Smart" is not a descriptive term.

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-05 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-no-recursion.cpp:153 +// CHECK-NOTES: :[[@LINE-7]]:3: note: Frame #1: function 'boo' calls function 'bar' here: +// CHECK-NOTES: :[[@LINE-14]]:18: note: Frame #2: function 'bar' calls functio

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked an inline comment as not done. lebedev.ri added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-no-recursion.cpp:153 +// CHECK-NOTES: :[[@LINE-7]]:3: note: Frame #1: function 'boo' calls function 'bar' here: +// CHECK-NOTES: :[[@LIN

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-no-recursion.cpp:153 +// CHECK-NOTES: :[[@LINE-7]]:3: note: Frame #1: function 'boo' calls function 'bar' here: +// CHECK-NOTES: :[[@LINE-14]]:18: note: Frame #2: function 'bar' calls

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 242725. lebedev.ri marked an inline comment as done. lebedev.ri added a comment. Fixup disclaimer printing, NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72362/new/ https://reviews.llvm.org/D72362 File

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-05 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-no-recursion.cpp:153 +// CHECK-NOTES: :[[@LINE-7]]:3: note: Frame #1: function 'boo' calls function 'bar' here: +// CHECK-NOTES: :[[@LINE-14]]:18: note: Frame #2: function 'bar' calls functio

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp:21 + +inline bool operator==(const CallGraphNode::CallRecord &LHS, + const CallGraphNode::CallRecord &RHS) { NoQ wrote: > lebedev.ri wrote:

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 242713. lebedev.ri marked 11 inline comments as done. lebedev.ri added a comment. @NoQ Thank you for taking a look! Rebased, addressed most of the review notes (some tests could be added), split callgraph changes into a separate review. Repository: rG

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-02-05 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. `CallGraph` changes look nice, i don't see any immediate problems and it's a nice-to-have thing that other users may benefit from (the static analyzer wouldn't though, it's only interested in topological sorting order on the graph). I guess you could have as well stored a `

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-30 Thread Alexey Bader via Phabricator via cfe-commits
bader added a comment. @lebedev.ri, thanks for the suggestion. We will investigate this option when we ready to upload clang diagnostics patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72362/new/ https://reviews.llvm.org/D72362 ___

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Herald added a subscriber: Charusso. In D72362#1819243 , @bader wrote: > In D72362#1817682 , @lebedev.ri > wrote: > > > In D72362#1817599 , @bade

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-14 Thread Alexey Bader via Phabricator via cfe-commits
bader added a subscriber: Naghasan. bader added a comment. In D72362#1817682 , @lebedev.ri wrote: > In D72362#1817599 , @bader wrote: > > > Does it make sense to implement such diagnostics in clang Sema, considering

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 3 inline comments as done. lebedev.ri added a comment. In D72362#1817599 , @bader wrote: > Does it make sense to implement such diagnostics in clang Sema, considering > that OpenCL does not allow recursion? > We implemented similar diag

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-13 Thread Alexey Bader via Phabricator via cfe-commits
bader added a comment. Does it make sense to implement such diagnostics in clang Sema, considering that OpenCL does not allow recursion? We implemented similar diagnostics for SYCL programming model and would be like to upstream it to clang later (https://github.com/intel/llvm/commit/4efe9fcf2d

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-11 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 8 inline comments as done. lebedev.ri added a comment. Thanks for taking a look. Some deflective replies inline. Comment at: clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp:21 + +inline bool operator==(const CallGraphNode::CallRecord &LHS, +

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. So that is were the CTU question comes from? :) Comment at: clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp:21 + +inline bool operator==(const CallGraphNode::CallRecord &LHS, + const CallGraphNode::CallRecord &RHS) { -

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-08 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 236843. lebedev.ri marked an inline comment as done. lebedev.ri added a comment. s/1/true/ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72362/new/ https://reviews.llvm.org/D72362 Files: clang-tools-extra

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-07 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D72362#1808825 , @Eugene.Zelenko wrote: > It'll be reasonable to add CERT alias. I'm not sure about that. This diagnoses **any** potential recursion, while CERT is much more specific than that. (`Avoid cycles during initia

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. It'll be reasonable to add CERT alias. Comment at: clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp:213 + CallGraphNode::CallRecord *Node = &EntryNode; + while (1) { +// Did we see this node before? true ===

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-07 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: JonasToth, aaron.ballman, ffrankies, Eugene.Zelenko, erichkeane, NoQ. lebedev.ri added a project: LLVM. Herald added subscribers: xazax.hun, Anastasia, mgorny. Herald added a project: clang. Recursion is a powerful tool, but like any t