This revision was automatically updated to reflect the committed changes.
Closed by commit rL267542: A clang-tidy check for std:accumulate. (authored by
alexfh).
Changed prior to commit:
http://reviews.llvm.org/D18442?vs=54969&id=54978#toc
Repository:
rL LLVM
http://reviews.llvm.org/D18442
courbet added a comment.
In http://reviews.llvm.org/D18442#411785, @alexfh wrote:
> Looks good now. Thank you for the new check!
Thanks for the review.
> Do you need me to submit the patch for you?
Yes, please.
http://reviews.llvm.org/D18442
_
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.
Looks good now. Thank you for the new check!
Do you need me to submit the patch for you?
http://reviews.llvm.org/D18442
___
cfe-commits mailing
courbet added inline comments.
Comment at: docs/clang-tidy/checks/misc-fold-init-type.rst:16-17
@@ +15,4 @@
+
+.. code:: c++
+ auto a = {0.5f, 0.5f, 0.5f, 0.5f};
+ return std::accumulate(std::begin(a), std::end(a), 0);
alexfh wrote:
> Prazek wrote:
> > Doesn't .
courbet updated this revision to Diff 54969.
courbet marked 2 inline comments as done.
courbet added a comment.
Fix doc formatting and add more doc.
http://reviews.llvm.org/D18442
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/FoldInitTypeCheck.cpp
clang-tidy/misc/FoldInitTypeCheck
alexfh added a comment.
A few nits.
Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:90
@@ +89,3 @@
+ // It's OK to fold an int into:
+ // - an int of the same size and signedness.
+ // - a bigger int, regardless of signedness.
No, I don't have a better na
Prazek added a subscriber: Prazek.
Comment at: docs/clang-tidy/checks/misc-fold-init-type.rst:16-17
@@ +15,4 @@
+
+.. code:: c++
+ auto a = {0.5f, 0.5f, 0.5f, 0.5f};
+ return std::accumulate(std::begin(a), std::end(a), 0);
Doesn't .. code node need new line?
h
courbet updated this revision to Diff 54833.
courbet marked 3 inline comments as done.
courbet added a comment.
Refactoring matchers & cosmetics.
http://reviews.llvm.org/D18442
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/FoldInitTypeCheck.cpp
clang-tidy/misc/FoldInitTypeCheck.h
courbet added inline comments.
Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:89
@@ +88,3 @@
+
+/// Returns true if ValueType is allowed to fold into InitType, i.e. if:
+/// static_cast(ValueType{some_value})
alexfh wrote:
> Is "fold" a commonly used term in
alexfh requested changes to this revision.
This revision now requires changes to proceed.
Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:23
@@ +22,3 @@
+ // Note: Right now we check only builtin types.
+ const auto BuiltinTypeWithId = [](const char *id) {
+return hasCanon
courbet added a comment.
Thanks, PTAL.
Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:21
@@ +20,3 @@
+/// Returns the value_type for an InputIterator type.
+static QualType getInputIteratorValueType(const Type &IteratorType,
+ const AS
courbet updated the summary for this revision.
courbet updated this revision to Diff 54045.
courbet marked 7 inline comments as done.
courbet added a comment.
- Use matchers for most of the check logic,
- Implement checking for reduce and inner_product,
- more tests.
http://reviews.llvm.org/D184
aaron.ballman added a subscriber: aaron.ballman.
Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:21
@@ +20,3 @@
+/// Returns the value_type for an InputIterator type.
+static QualType getInputIteratorValueType(const Type &IteratorType,
+
alexfh added a comment.
Sorry for the delay (mostly due to the holidays here).
The check looks very useful, at least, the pattern is hard to spot by manual
inspection. A few comments though, mostly style-related.
Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:21
@@ +20,3 @@
courbet added a comment.
ping ?
http://reviews.llvm.org/D18442
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
15 matches
Mail list logo