[all-commits] [llvm/llvm-project] 40003a: [Clang][NFC] Remove a redundancy check in Sema::ad...

Shivam Gupta via All-commits all-commits at lists.llvm.org
Mon Jan 23 22:26:47 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 40003af98456607f9b6bd1910424c5243eeb5d01
      https://github.com/llvm/llvm-project/commit/40003af98456607f9b6bd1910424c5243eeb5d01
  Author: Shivam Gupta <shivam98.tkg at gmail.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M clang/lib/Sema/SemaType.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list