llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.21k stars 11.14k forks source link

clang/lib/Sema/SemaOpenMP.cpp:24774: Pointless test ? #95670

Open dcb314 opened 1 month ago

dcb314 commented 1 month ago

Static analyser cppcheck says:

clang/lib/Sema/SemaOpenMP.cpp:24774:57: style: Same expression 'DepType!=OMPC_DOACROSS_source' found multiple times in chain of '&&' operators. [duplicateExpression]

Source code is

if (DSAStack->getCurrentDirective() == OMPD_ordered && DepType != OMPC_DOACROSS_source && DepType != OMPC_DOACROSS_sink && DepType != OMPC_DOACROSS_sink_omp_cur_iteration && DepType != OMPC_DOACROSS_source_omp_cur_iteration && DepType != OMPC_DOACROSS_source) {

llvmbot commented 1 month ago

@llvm/issue-subscribers-clang-frontend

Author: None (dcb314)

Static analyser cppcheck says: clang/lib/Sema/SemaOpenMP.cpp:24774:57: style: Same expression 'DepType!=OMPC_DOACROSS_source' found multiple times in chain of '&&' operators. [duplicateExpression] Source code is if (DSAStack->getCurrentDirective() == OMPD_ordered && DepType != OMPC_DOACROSS_source && DepType != OMPC_DOACROSS_sink && DepType != OMPC_DOACROSS_sink_omp_cur_iteration && DepType != OMPC_DOACROSS_source_omp_cur_iteration && DepType != OMPC_DOACROSS_source) {
AaronBallman commented 1 month ago

https://github.com/llvm/llvm-project/pull/95715 is addressing this issue.