[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-12 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL291757: Avoid multiple -Wunreachable-code diagnostics that are triggered by (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D28231?vs=83819=84094#toc Repository: rL LLVM

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. Thanks, LGTM Repository: rL LLVM https://reviews.llvm.org/D28231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Analysis/ReachableCode.cpp:229 + if (SilenceableCondValNotSet && SilenceableCondVal->getBegin().isValid()) +*SilenceableCondVal = UO->getSourceRange(); + return UO->getOpcode() == UO_LNot && IsSubExprConfigValue;

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 83819. arphaman added a comment. Fix more issues with FIXIT for unary operators. Repository: rL LLVM https://reviews.llvm.org/D28231 Files: lib/Analysis/ReachableCode.cpp lib/Sema/AnalysisBasedWarnings.cpp test/Sema/warn-unreachable.c Index:

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Analysis/ReachableCode.cpp:229 + if (SilenceableCondValNotSet && SilenceableCondVal->getBegin().isValid()) +*SilenceableCondVal = UO->getSourceRange(); + return UO->getOpcode() == UO_LNot && IsSubExprConfigValue;

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-04 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 83032. arphaman added a comment. You're right, the fixit for `if (!s->p || 1)` is wrong, but that was another existing bug. The updated patch fixes this issue. Repository: rL LLVM https://reviews.llvm.org/D28231 Files: lib/Analysis/ReachableCode.cpp

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. If I change the condition to the following, if (!s->p || 1) clang suggests enclosing !s->p with a parenthesis, but the comment in ReachableCode.cpp says the parenthesis should enclose the integer literal. It seems like there is a contradiction here? Repository:

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-03 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: rsmith, bruno, ahatanak. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. This patch fixes an issue with -Wunreachable-code diagnostic that happens with the following code sample: