[Clang][NFC] Remove a redundancy check in Sema::adjustMemberFunctionCC
authorShivam Gupta <shivam98.tkg@gmail.com>
Tue, 24 Jan 2023 06:25:54 +0000 (11:55 +0530)
committerShivam Gupta <shivam98.tkg@gmail.com>
Tue, 24 Jan 2023 06:26:06 +0000 (11:56 +0530)
commit40003af98456607f9b6bd1910424c5243eeb5d01
tree2bc816c1ee10749a34418585624e3b53da52e00a
parent0f5099cd94226479fe30b4fc2d6a9743ebe2b12b
[Clang][NFC] Remove a redundancy check in Sema::adjustMemberFunctionCC

If the current calling convection CurCC is not equal to Target calling
convection ToCC and current calling convention (CurCC) is equal to the
default calling convention (DefaultCC), that means DefaultCC can not be
equal to ToCC so the right part of the expression DefaultCC == ToCC is
not needed.

revelant code -
  if (CurCC == ToCC)
    return;
  if (CurCC != DefaultCC || DefaultCC == ToCC)
    return;

Found by PVS-Studio - https://pvs-studio.com/en/blog/posts/cpp/1003/, N41.

Differential Revision: https://reviews.llvm.org/D142338
clang/lib/Sema/SemaType.cpp