diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-05-18 14:26:47 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-05-18 14:26:47 +0200 |
commit | 9b51d16771175b1245f755d28877fd61a0b432a1 (patch) | |
tree | 5df632f395a3c5d7afe9b452cf103c0fb8f9ebf0 /compilerplugins/clang | |
parent | a7551b34adf847777de976fdaa3a3432448eea3b (diff) |
Remove unnecessary restrictions
Change-Id: Idc0db273f7ad2d6b11113752ca01a1f2a327e991
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/comparisonwithconstant.cxx | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/compilerplugins/clang/comparisonwithconstant.cxx b/compilerplugins/clang/comparisonwithconstant.cxx index 1c7daf5c3c4f..180e45df3a5c 100644 --- a/compilerplugins/clang/comparisonwithconstant.cxx +++ b/compilerplugins/clang/comparisonwithconstant.cxx @@ -74,11 +74,6 @@ bool ComparisonWithConstant::VisitBinaryOperator(const BinaryOperator* binaryOp) if (!(binaryOp->getOpcode() == BO_EQ || binaryOp->getOpcode() == BO_NE)) { return true; } - // ignore logging macros - if (compiler.getSourceManager().isMacroBodyExpansion(binaryOp->getSourceRange().getBegin()) - || compiler.getSourceManager().isMacroArgExpansion(binaryOp->getSourceRange().getBegin())) { - return true; - } // protect against clang assert if (binaryOp->getLHS()->isValueDependent() || binaryOp->getRHS()->isValueDependent()) { return true; @@ -118,14 +113,6 @@ bool ComparisonWithConstant::rewrite(const BinaryOperator * binaryOp) { const std::string lhsString = getExprAsString(lhsRange); const std::string rhsString = getExprAsString(rhsRange); - /* we can't safely move around stuff containing comments, we mess up the resulting code */ - if ( lhsString.find("/*") != std::string::npos || lhsString.find("//") != std::string::npos ) { - return false; - } - if ( rhsString.find("/*") != std::string::npos || rhsString.find("//") != std::string::npos ) { - return false; - } - // switch LHS and RHS if (!replaceText(lhsRange, rhsString)) { return false; |