[PATCH] D35932: [clang-tidy] Add integer division check

2017-08-10 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310589: [clang-tidy] Add integer division check (authored by xazax). Changed prior to commit: https://reviews.llvm.org/D35932?vs=110539=110570#toc Repository: rL LLVM

[PATCH] D35932: [clang-tidy] Add integer division check

2017-08-10 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D35932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D35932: [clang-tidy] Add integer division check

2017-08-10 Thread Reka Kovacs via Phabricator via cfe-commits
rnkovacs updated this revision to Diff 110539. rnkovacs marked 3 inline comments as done. rnkovacs edited the summary of this revision. rnkovacs added a comment. Thanks for the comments. I improved the docs and truncated the messages in the test file. We also had concerns about the nested

[PATCH] D35932: [clang-tidy] Add integer division check

2017-08-09 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. A few more nits. Comment at: clang-tidy/bugprone/IntegerDivisionCheck.cpp:40-44 + hasAncestor( +

[PATCH] D35932: [clang-tidy] Add integer division check

2017-08-03 Thread Reka Kovacs via Phabricator via cfe-commits
rnkovacs updated this revision to Diff 109497. rnkovacs edited the summary of this revision. rnkovacs added a comment. Uploaded a more thought-out version of the check with more cases covered and hopefully clearer docs. It produces no hits on LLVM https://reviews.llvm.org/D35932 Files:

[PATCH] D35932: [clang-tidy] Add integer division check

2017-07-28 Thread Reka Kovacs via Phabricator via cfe-commits
rnkovacs added a comment. I run the check on LLVM-Clang, and got this one hit: /home/reka/codechecker_dev_env/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp:1000:43: warning: integer division; possible precision loss [bugprone-integer-division] SDValue TWOHW = DAG.getConstantFP(1 <<

[PATCH] D35932: [clang-tidy] Add integer division check

2017-07-28 Thread Reka Kovacs via Phabricator via cfe-commits
rnkovacs updated this revision to Diff 108605. rnkovacs edited the summary of this revision. https://reviews.llvm.org/D35932 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/IntegerDivisionCheck.cpp

[PATCH] D35932: [clang-tidy] Add integer division check

2017-07-27 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. Could you run the check over LLVM+Clang code and post a summary of results here? https://reviews.llvm.org/D35932 ___ cfe-commits

[PATCH] D35932: [clang-tidy] Add integer division check

2017-07-27 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: docs/clang-tidy/checks/bugprone-integer-division.rst:21-24 + // Do not warn, there are signs of deliberateness. + sin(abs(3) / 5); + sin(1 + abs(1 + 7 / 2)); + 1 << 2 / 3; I'd argue that the presence of `abs` here

[PATCH] D35932: [clang-tidy] Add integer division check

2017-07-27 Thread Reka Kovacs via Phabricator via cfe-commits
rnkovacs created this revision. rnkovacs added a project: clang-tools-extra. Herald added subscribers: baloghadamsoftware, JDevlieghere, mgorny. Finds integer divisions in environments expecting floating-point values. Examples of possibly unintended precision loss: sin(7 / (2 + 3));