[all-commits] [llvm/llvm-project] 1e5126: [clang-tidy] performance-* checks: Also allow allo...

shivam-amd via All-commits all-commits at lists.llvm.org
Sun Jul 23 11:38:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e512688376c83d96f097e9b0ddb19132247a646
      https://github.com/llvm/llvm-project/commit/1e512688376c83d96f097e9b0ddb19132247a646
  Author: Shivam Gupta <Shivam.Gupta2 at amd.com>
  Date:   2023-07-24 (Mon, 24 Jul 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/checkers/performance/for-range-copy.cpp
    M clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-copy-initialization.cpp
    M clang-tools-extra/unittests/clang-tidy/DeclRefExprUtilsTest.cpp

  Log Message:
  -----------
  [clang-tidy] performance-* checks: Also allow allow member expressions to be used in a const manner.

Until now when determining all the const uses of a VarDecl we only considered
how the variable itself was used. This change extends checking for const usages
of the type's members as well.

This increases the number of true positives for various performance checks that
share the same const usage analysis.

Path by Felix Berger

Reviewed By: njames93, PiotrZSL

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




More information about the All-commits mailing list