summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.h
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2015-12-28 13:21:22 +0000
committerAlexander Kornienko <alexfh@google.com>2015-12-28 13:21:22 +0000
commit4f74ec0dd8828aa80130a2c709239607f6316b8c (patch)
tree0bc25b1616cf6637fffd132bc11b41442c6fd943 /clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.h
parent9c10490efe30ed75d52810c26e83189a96c04926 (diff)
downloadbcm5719-llvm-4f74ec0dd8828aa80130a2c709239607f6316b8c.tar.gz
bcm5719-llvm-4f74ec0dd8828aa80130a2c709239607f6316b8c.zip
[clang-tidy] Preserve comments and preprocessor directives when simplifying boolean expressions
This changeset still emits the diagnostic that the expression could be simplified, but it doesn't generate any fix-its that would lose comments or preprocessor directives within the text that would be replaced. Fixes PR25842 Reviewers: alexfh Subscribers: xazax.hun, cfe-commits Patch by Richard Thomson! (+a naming style fix) Differential Revision: http://reviews.llvm.org/D15737 llvm-svn: 256492
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.h')
-rw-r--r--clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.h b/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.h
index e3a106dd30b..c74e6c45c5a 100644
--- a/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.h
+++ b/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.h
@@ -154,6 +154,10 @@ private:
const ast_matchers::MatchFinder::MatchResult &Result,
const CompoundStmt *Compound, bool Negated = false);
+ void issueDiag(const ast_matchers::MatchFinder::MatchResult &Result,
+ SourceLocation Loc, StringRef Description,
+ SourceRange ReplacementRange, StringRef Replacement);
+
const bool ChainedConditionalReturn;
const bool ChainedConditionalAssignment;
};
OpenPOWER on IntegriCloud