llvm-project/clang-tools-extra/clang-tidy/misc
Gabor Horvath 91c6671a71 [clang-tidy] Misc redundant expression checker updated for ineffective bitwise operator expressions
Examples:
* Always evaluates to 0:

```
  int X;
  if (0 & X) return;
```

* Always evaluates to ~0:

```
  int Y;
  if (Y | ~0) return;
```

* The symbol is unmodified:

```
  int Z;
  Z &= ~0;
```

Patch by: Lilla Barancsuk!

Differential Revision: https://reviews.llvm.org/D39285

llvm-svn: 321168
2017-12-20 12:22:16 +00:00
..
CMakeLists.txt [clang-tidy] Move more checks from misc- to performance- 2017-11-28 16:41:03 +00:00
DefinitionsInHeadersCheck.cpp Fix up clang-tidy after clang r314037. 2017-09-22 23:47:20 +00:00
DefinitionsInHeadersCheck.h [clang-tdiy] Add header file extension configuration support. 2016-02-05 11:23:59 +00:00
ForwardingReferenceOverloadCheck.cpp [clang-tidy] Do not dereference a null BaseType 2017-05-23 16:19:04 +00:00
ForwardingReferenceOverloadCheck.h [clang-tidy] Check for forwarding reference overload in constructors. 2017-04-06 09:56:42 +00:00
IncorrectRoundings.cpp Replace APFloatBase static fltSemantics data members with getter functions 2016-12-14 11:57:17 +00:00
IncorrectRoundings.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
LambdaFunctionNameCheck.cpp [clang-tidy] check for __func__/__FUNCTION__ in lambdas 2017-06-02 17:36:32 +00:00
LambdaFunctionNameCheck.h [clang-tidy] Add `const` to operator() to fix a warning. 2017-06-02 18:47:50 +00:00
MacroParenthesesCheck.cpp [NFC] Update function call names as changed in MacroInfo that should refer to Parameters (as opposed to Arguments). 2017-07-17 17:20:57 +00:00
MacroParenthesesCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
MacroRepeatedSideEffectsCheck.cpp [NFC] Update function call names as changed in MacroInfo that should refer to Parameters (as opposed to Arguments). 2017-07-17 17:20:57 +00:00
MacroRepeatedSideEffectsCheck.h [clang-tidy] Update docs for clang-tidy checks. NFC 2015-08-27 18:01:58 +00:00
MiscTidyModule.cpp [clang-tidy] Move more checks from misc- to performance- 2017-11-28 16:41:03 +00:00
MisplacedConstCheck.cpp Add the misc-misplaced-const check to clang-tidy, which diagnoses when a const-qualifier is applied to a typedef of pointer type rather than to the pointee type. 2016-06-07 17:22:47 +00:00
MisplacedConstCheck.h Add the misc-misplaced-const check to clang-tidy, which diagnoses when a const-qualifier is applied to a typedef of pointer type rather than to the pointee type. 2016-06-07 17:22:47 +00:00
MisplacedWideningCastCheck.cpp [clang-tidy] Fix 'misc-misplaced-widening-cast' assertion error. 2017-08-29 06:25:24 +00:00
MisplacedWideningCastCheck.h [clang-tidy] Extension of checker misc-misplaced-widening-cast 2016-04-06 12:04:51 +00:00
NewDeleteOverloadsCheck.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
NewDeleteOverloadsCheck.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
NonCopyableObjects.cpp [clang-tidy] Simplify matchers 2016-11-08 05:58:07 +00:00
NonCopyableObjects.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
RedundantExpressionCheck.cpp [clang-tidy] Misc redundant expression checker updated for ineffective bitwise operator expressions 2017-12-20 12:22:16 +00:00
RedundantExpressionCheck.h [clang-tidy] Misc redundant expressions checker updated for macros 2017-11-07 13:17:58 +00:00
SizeofContainerCheck.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
SizeofContainerCheck.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
SizeofExpressionCheck.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
SizeofExpressionCheck.h Add missing override keyword to silence -Winconsistent-missing-override. NFC 2016-04-16 02:42:03 +00:00
StaticAssertCheck.cpp [clang-tidy] Make misc-static-assert accept assert(!"msg") 2017-06-03 10:13:55 +00:00
StaticAssertCheck.h [clang-tidy] remove trailing whitespaces and retab 2016-08-01 12:06:18 +00:00
StringCompareCheck.cpp [clang-tidy] Add check 'misc-string-compare'. 2016-12-30 10:09:46 +00:00
StringCompareCheck.h [clang-tidy] Add check 'misc-string-compare'. 2016-12-30 10:09:46 +00:00
StringIntegerAssignmentCheck.cpp [clang-tidy] Cleaning up language options. 2016-09-24 02:13:45 +00:00
StringIntegerAssignmentCheck.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
StringLiteralWithEmbeddedNulCheck.cpp [clang-tidy] add new checker for string literal with NUL character. 2016-04-07 16:16:36 +00:00
StringLiteralWithEmbeddedNulCheck.h [clang-tidy] add new checker for string literal with NUL character. 2016-04-07 16:16:36 +00:00
SuspiciousEnumUsageCheck.cpp [clang-tidy] SuspiciousEnumUsageCheck bugfix 2017-09-12 09:40:13 +00:00
SuspiciousEnumUsageCheck.h [clang-tidy] Add enum misuse check. 2016-12-27 10:07:39 +00:00
SuspiciousMissingCommaCheck.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
SuspiciousMissingCommaCheck.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
SuspiciousSemicolonCheck.cpp [clang-tidy] hasErrorOccurred() -> hasUncompilableErrorOccurred() 2017-02-08 16:11:22 +00:00
SuspiciousSemicolonCheck.h [clang-tidy] Add a check to find unintended semicolons that changes the semantics. 2016-02-11 09:23:33 +00:00
SuspiciousStringCompareCheck.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
SuspiciousStringCompareCheck.h [clang-tidy] Add new checker for comparison with runtime string functions. 2016-04-21 17:19:36 +00:00
SwappedArgumentsCheck.cpp Remove deprecated methods ast_matchers::BoundNodes::{getStmtAs,getDeclAs} 2016-12-13 16:19:19 +00:00
SwappedArgumentsCheck.h [clang-tidy] Update docs for clang-tidy checks. NFC 2015-08-27 18:01:58 +00:00
ThrowByValueCatchByReferenceCheck.cpp [clang-tidy] Fix diag message for catch-by-value 2017-03-23 15:17:44 +00:00
ThrowByValueCatchByReferenceCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
UnconventionalAssignOperatorCheck.cpp [clang-tidy] Don't warn about call to unresolved operator* 2017-02-15 14:01:41 +00:00
UnconventionalAssignOperatorCheck.h Trying to fix docs. 2016-05-09 10:56:57 +00:00
UndelegatedConstructor.cpp Remove deprecated methods ast_matchers::BoundNodes::{getStmtAs,getDeclAs} 2016-12-13 16:19:19 +00:00
UndelegatedConstructor.h [clang-tidy] Update docs for clang-tidy checks. NFC 2015-08-27 18:01:58 +00:00
UniqueptrResetReleaseCheck.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
UniqueptrResetReleaseCheck.h [clang-tidy] Update docs for clang-tidy checks. NFC 2015-08-27 18:01:58 +00:00
UnusedAliasDeclsCheck.cpp [clang-tidy] Cleaning up language options. 2016-09-24 02:13:45 +00:00
UnusedAliasDeclsCheck.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
UnusedParametersCheck.cpp [clang-tidy] Fixed misc-unused-parameters omitting parameters square brackets 2017-09-15 11:28:28 +00:00
UnusedParametersCheck.h [clang-tidy] Optimize misc-unused-parameters. NFCI 2017-05-17 02:25:11 +00:00
UnusedRAIICheck.cpp Remove deprecated methods ast_matchers::BoundNodes::{getStmtAs,getDeclAs} 2016-12-13 16:19:19 +00:00
UnusedRAIICheck.h [clang-tidy] Updated misc-unused-raii documentation. 2015-09-25 17:50:11 +00:00
UnusedUsingDeclsCheck.cpp [clang-tidy] Fix misc-unused-using-decls false positives in presence of compile errors 2017-02-09 10:41:27 +00:00
UnusedUsingDeclsCheck.h [clang-tidy] Ignore function context in misc-unused-using-decls. 2016-06-03 08:05:11 +00:00