[all-commits] [llvm/llvm-project] 2a84c6: [clang-tidy] Optimize misc-confusable-identifiers

Piotr Zegar via All-commits all-commits at lists.llvm.org
Fri May 26 10:46:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a84c635f2a1dcb4546a5d751a32eac24103c7e6
      https://github.com/llvm/llvm-project/commit/2a84c635f2a1dcb4546a5d751a32eac24103c7e6
  Author: Piotr Zegar <me at piotrzegar.pl>
  Date:   2023-05-26 (Fri, 26 May 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp
    M clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.h

  Log Message:
  -----------
  [clang-tidy] Optimize misc-confusable-identifiers

Main performance issue in this check were caused by many
calls to getPrimaryContext and constant walk up to declaration
contexts using getParent. Also there were issue with forallBases
that is slow.

Profiled with perf and tested on open-source project Cataclysm-DDA.
Before changes check took 27320 seconds, after changes 3682 seconds.
That's 86.5% reduction. More optimizations are still possible in this
check.

Reviewed By: serge-sans-paille

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




More information about the All-commits mailing list